On 2/19/2016 11:28 AM, Rhyland Klein wrote:The pdata_size initialization is also not correct. This is not the array count but the size
On 2/19/2016 3:50 AM, Lee Jones wrote:
On Thu, 18 Feb 2016, Rhyland Klein wrote:
#define MFD_ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)))
-#define MFD_CELL_ALL(_name, _res, _pdata, _id, _compat, _match) \
+#define MFD_CELL_ALL(_name, _nres, _res, _pdata, _id, _compat, _match) \
.name = (_name), \
.resources = (_res), \
- .num_resources = MFD_ARRAY_SIZE((_res)), \
+ .num_resources = (_nres), \
.platform_data = (_pdata), \
.pdata_size = MFD_ARRAY_SIZE((_pdata)), \
I think the following change also crash in runtime:#define MFD_CELL_ALL(_name, _res, _pdata, _id, _compat, _match) \Did you not see warnings like this when you compiled the kernel? Did you
That was my first thought too. However, I see this when I try to compile
In file included from drivers/mfd/max77620.c:18:0:
include/linux/mfd/core.h:19:34: warning: the address of âgpio_resourcesâ
will always evaluate as âtrueâ [-Waddress]
#define MFD_ARRAY_SIZE(arr) (arr ? (sizeof(arr) / sizeof((arr))) : 0)
7 different times. This patch was the only way I seemed to be able to
WAR around compile time warnings.
find a different approach than what I proposed above to deal with it?
I'd like to get this in soon so that when the max77620 drivers are all
in and using it, it should be functional.