Skip to content

Commit 05fb7a5

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

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎drivers/mfd/max8997.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,15 +164,15 @@ static struct max8997_platform_data *max8997_i2c_parse_dt_pdata(
164164
return pd;
165165
}
166166

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,
168168
const struct i2c_device_id *id)
169169
{
170170
if (IS_ENABLED(CONFIG_OF) && i2c->dev.of_node) {
171171
const struct of_device_id *match;
172172
match = of_match_node(max8997_pmic_dt_match, i2c->dev.of_node);
173-
return (int)match->data;
173+
return (unsigned long)match->data;
174174
}
175-
return (int)id->driver_data;
175+
return id->driver_data;
176176
}
177177

178178
static int max8997_i2c_probe(struct i2c_client *i2c,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ struct max8997_dev {
387387
struct i2c_client *muic; /* slave addr 0x4a */
388388
struct mutex iolock;
389389

390-
int type;
390+
unsigned long type;
391391
struct platform_device *battery; /* battery control (not fuel gauge) */
392392

393393
int irq;

0 commit comments

Comments
 (0)