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

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>

Lee Jones 5c6fbd56 7f8279ce

+4 -4
+2 -2
drivers/mfd/tps65217.c
··· 158 158 { 159 159 struct tps65217 *tps; 160 160 unsigned int version; 161 - unsigned int chip_id = ids->driver_data; 161 + unsigned long chip_id = ids->driver_data; 162 162 const struct of_device_id *match; 163 163 bool status_off = false; 164 164 int ret; ··· 170 170 "Failed to find matching dt id\n"); 171 171 return -EINVAL; 172 172 } 173 - chip_id = (unsigned int)(unsigned long)match->data; 173 + chip_id = (unsigned long)match->data; 174 174 status_off = of_property_read_bool(client->dev.of_node, 175 175 "ti,pmic-shutdown-controller"); 176 176 }
+2 -2
include/linux/mfd/tps65217.h
··· 252 252 struct tps65217 { 253 253 struct device *dev; 254 254 struct tps65217_board *pdata; 255 - unsigned int id; 255 + unsigned long id; 256 256 struct regulator_desc desc[TPS65217_NUM_REGULATOR]; 257 257 struct regulator_dev *rdev[TPS65217_NUM_REGULATOR]; 258 258 struct regmap *regmap; ··· 263 263 return dev_get_drvdata(dev); 264 264 } 265 265 266 - static inline int tps65217_chip_id(struct tps65217 *tps65217) 266 + static inline unsigned long tps65217_chip_id(struct tps65217 *tps65217) 267 267 { 268 268 return tps65217->id; 269 269 }