Skip to content

Commit 5c6fbd5

Browse files
author
Lee Jones
committed
mfd: tps65217: Naturalise cross-architecture discrepancies
If we compile the TPS65217 for a 64bit architecture we receive the following warnings: drivers/mfd/tps65217.c: In function ‘tps65217_probe’: drivers/mfd/tps65217.c:173:13: warning: cast from pointer to integer of different size chip_id = (unsigned int)match->data; ^ Signed-off-by: Lee Jones <lee.jones@linaro.org>
1 parent 7f8279c commit 5c6fbd5

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎drivers/mfd/tps65217.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ static int tps65217_probe(struct i2c_client *client,
158158
{
159159
struct tps65217 *tps;
160160
unsigned int version;
161-
unsigned int chip_id = ids->driver_data;
161+
unsigned long chip_id = ids->driver_data;
162162
const struct of_device_id *match;
163163
bool status_off = false;
164164
int ret;
@@ -170,7 +170,7 @@ static int tps65217_probe(struct i2c_client *client,
170170
"Failed to find matching dt id\n");
171171
return -EINVAL;
172172
}
173-
chip_id = (unsigned int)(unsigned long)match->data;
173+
chip_id = (unsigned long)match->data;
174174
status_off = of_property_read_bool(client->dev.of_node,
175175
"ti,pmic-shutdown-controller");
176176
}

‎include/linux/mfd/tps65217.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ struct tps65217_board {
252252
struct tps65217 {
253253
struct device *dev;
254254
struct tps65217_board *pdata;
255-
unsigned int id;
255+
unsigned long id;
256256
struct regulator_desc desc[TPS65217_NUM_REGULATOR];
257257
struct regulator_dev *rdev[TPS65217_NUM_REGULATOR];
258258
struct regmap *regmap;
@@ -263,7 +263,7 @@ static inline struct tps65217 *dev_to_tps65217(struct device *dev)
263263
return dev_get_drvdata(dev);
264264
}
265265

266-
static inline int tps65217_chip_id(struct tps65217 *tps65217)
266+
static inline unsigned long tps65217_chip_id(struct tps65217 *tps65217)
267267
{
268268
return tps65217->id;
269269
}

0 commit comments

Comments
 (0)