Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mfd: max8997: Naturalise cross-architecture discrepancies

If we compile the MAX8997 for a 64bit architecture we receive the following
warnings:

drivers/mfd/max8997.c: In function ‘max8997_i2c_get_driver_data’:
drivers/mfd/max8997.c:173:10:
warning: cast from pointer to integer of different size
return (int)match->data;
^

Signed-off-by: Lee Jones <lee.jones@linaro.org>

Lee Jones 05fb7a56 38dbfb59

+4 -4
+3 -3
drivers/mfd/max8997.c
··· 164 164 return pd; 165 165 } 166 166 167 - static inline int max8997_i2c_get_driver_data(struct i2c_client *i2c, 167 + static inline unsigned long max8997_i2c_get_driver_data(struct i2c_client *i2c, 168 168 const struct i2c_device_id *id) 169 169 { 170 170 if (IS_ENABLED(CONFIG_OF) && i2c->dev.of_node) { 171 171 const struct of_device_id *match; 172 172 match = of_match_node(max8997_pmic_dt_match, i2c->dev.of_node); 173 - return (int)match->data; 173 + return (unsigned long)match->data; 174 174 } 175 - return (int)id->driver_data; 175 + return id->driver_data; 176 176 } 177 177 178 178 static int max8997_i2c_probe(struct i2c_client *i2c,
+1 -1
include/linux/mfd/max8997-private.h
··· 387 387 struct i2c_client *muic; /* slave addr 0x4a */ 388 388 struct mutex iolock; 389 389 390 - int type; 390 + unsigned long type; 391 391 struct platform_device *battery; /* battery control (not fuel gauge) */ 392 392 393 393 int irq;