Skip to content

Commit 8bace2d

Browse files
author
Lee Jones
committed
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>
1 parent 05fb7a5 commit 8bace2d

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎drivers/mfd/max8998.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,16 +169,16 @@ static struct max8998_platform_data *max8998_i2c_parse_dt_pdata(
169169
return pd;
170170
}
171171

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,
173173
const struct i2c_device_id *id)
174174
{
175175
if (IS_ENABLED(CONFIG_OF) && i2c->dev.of_node) {
176176
const struct of_device_id *match;
177177
match = of_match_node(max8998_dt_match, i2c->dev.of_node);
178-
return (int)(long)match->data;
178+
return (unsigned long)match->data;
179179
}
180180

181-
return (int)id->driver_data;
181+
return id->driver_data;
182182
}
183183

184184
static int max8998_i2c_probe(struct i2c_client *i2c,

‎include/linux/mfd/max8998-private.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ struct max8998_dev {
163163
int ono;
164164
u8 irq_masks_cur[MAX8998_NUM_IRQ_REGS];
165165
u8 irq_masks_cache[MAX8998_NUM_IRQ_REGS];
166-
int type;
166+
unsigned long type;
167167
bool wakeup;
168168
};
169169

0 commit comments

Comments
 (0)