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

mfd: max8998: Naturalise cross-architecture discrepancies

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

drivers/mfd/max8998.c: In function ‘max8998_i2c_get_driver_data’:
drivers/mfd/max8998.c:178: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 8bace2d5 05fb7a56

+4 -4
+3 -3
drivers/mfd/max8998.c
··· 169 169 return pd; 170 170 } 171 171 172 - static inline int max8998_i2c_get_driver_data(struct i2c_client *i2c, 172 + static inline unsigned long max8998_i2c_get_driver_data(struct i2c_client *i2c, 173 173 const struct i2c_device_id *id) 174 174 { 175 175 if (IS_ENABLED(CONFIG_OF) && i2c->dev.of_node) { 176 176 const struct of_device_id *match; 177 177 match = of_match_node(max8998_dt_match, i2c->dev.of_node); 178 - return (int)(long)match->data; 178 + return (unsigned long)match->data; 179 179 } 180 180 181 - return (int)id->driver_data; 181 + return id->driver_data; 182 182 } 183 183 184 184 static int max8998_i2c_probe(struct i2c_client *i2c,
+1 -1
include/linux/mfd/max8998-private.h
··· 163 163 int ono; 164 164 u8 irq_masks_cur[MAX8998_NUM_IRQ_REGS]; 165 165 u8 irq_masks_cache[MAX8998_NUM_IRQ_REGS]; 166 - int type; 166 + unsigned long type; 167 167 bool wakeup; 168 168 }; 169 169