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

misc: apds990x, bh1770glc, lis3lv02d: use to_i2c_client

Use to_i2c_client() instead of open-coding it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Geliang Tang and committed by
Greg Kroah-Hartman
8c99d8e6 50e6315d

+12 -12
+4 -4
drivers/misc/apds990x.c
··· 1215 1215 #ifdef CONFIG_PM_SLEEP 1216 1216 static int apds990x_suspend(struct device *dev) 1217 1217 { 1218 - struct i2c_client *client = container_of(dev, struct i2c_client, dev); 1218 + struct i2c_client *client = to_i2c_client(dev); 1219 1219 struct apds990x_chip *chip = i2c_get_clientdata(client); 1220 1220 1221 1221 apds990x_chip_off(chip); ··· 1224 1224 1225 1225 static int apds990x_resume(struct device *dev) 1226 1226 { 1227 - struct i2c_client *client = container_of(dev, struct i2c_client, dev); 1227 + struct i2c_client *client = to_i2c_client(dev); 1228 1228 struct apds990x_chip *chip = i2c_get_clientdata(client); 1229 1229 1230 1230 /* ··· 1240 1240 #ifdef CONFIG_PM 1241 1241 static int apds990x_runtime_suspend(struct device *dev) 1242 1242 { 1243 - struct i2c_client *client = container_of(dev, struct i2c_client, dev); 1243 + struct i2c_client *client = to_i2c_client(dev); 1244 1244 struct apds990x_chip *chip = i2c_get_clientdata(client); 1245 1245 1246 1246 apds990x_chip_off(chip); ··· 1249 1249 1250 1250 static int apds990x_runtime_resume(struct device *dev) 1251 1251 { 1252 - struct i2c_client *client = container_of(dev, struct i2c_client, dev); 1252 + struct i2c_client *client = to_i2c_client(dev); 1253 1253 struct apds990x_chip *chip = i2c_get_clientdata(client); 1254 1254 1255 1255 apds990x_chip_on(chip);
+4 -4
drivers/misc/bh1770glc.c
··· 1323 1323 #ifdef CONFIG_PM_SLEEP 1324 1324 static int bh1770_suspend(struct device *dev) 1325 1325 { 1326 - struct i2c_client *client = container_of(dev, struct i2c_client, dev); 1326 + struct i2c_client *client = to_i2c_client(dev); 1327 1327 struct bh1770_chip *chip = i2c_get_clientdata(client); 1328 1328 1329 1329 bh1770_chip_off(chip); ··· 1333 1333 1334 1334 static int bh1770_resume(struct device *dev) 1335 1335 { 1336 - struct i2c_client *client = container_of(dev, struct i2c_client, dev); 1336 + struct i2c_client *client = to_i2c_client(dev); 1337 1337 struct bh1770_chip *chip = i2c_get_clientdata(client); 1338 1338 int ret = 0; 1339 1339 ··· 1361 1361 #ifdef CONFIG_PM 1362 1362 static int bh1770_runtime_suspend(struct device *dev) 1363 1363 { 1364 - struct i2c_client *client = container_of(dev, struct i2c_client, dev); 1364 + struct i2c_client *client = to_i2c_client(dev); 1365 1365 struct bh1770_chip *chip = i2c_get_clientdata(client); 1366 1366 1367 1367 bh1770_chip_off(chip); ··· 1371 1371 1372 1372 static int bh1770_runtime_resume(struct device *dev) 1373 1373 { 1374 - struct i2c_client *client = container_of(dev, struct i2c_client, dev); 1374 + struct i2c_client *client = to_i2c_client(dev); 1375 1375 struct bh1770_chip *chip = i2c_get_clientdata(client); 1376 1376 1377 1377 bh1770_chip_on(chip);
+4 -4
drivers/misc/lis3lv02d/lis3lv02d_i2c.c
··· 209 209 #ifdef CONFIG_PM_SLEEP 210 210 static int lis3lv02d_i2c_suspend(struct device *dev) 211 211 { 212 - struct i2c_client *client = container_of(dev, struct i2c_client, dev); 212 + struct i2c_client *client = to_i2c_client(dev); 213 213 struct lis3lv02d *lis3 = i2c_get_clientdata(client); 214 214 215 215 if (!lis3->pdata || !lis3->pdata->wakeup_flags) ··· 219 219 220 220 static int lis3lv02d_i2c_resume(struct device *dev) 221 221 { 222 - struct i2c_client *client = container_of(dev, struct i2c_client, dev); 222 + struct i2c_client *client = to_i2c_client(dev); 223 223 struct lis3lv02d *lis3 = i2c_get_clientdata(client); 224 224 225 225 /* ··· 238 238 #ifdef CONFIG_PM 239 239 static int lis3_i2c_runtime_suspend(struct device *dev) 240 240 { 241 - struct i2c_client *client = container_of(dev, struct i2c_client, dev); 241 + struct i2c_client *client = to_i2c_client(dev); 242 242 struct lis3lv02d *lis3 = i2c_get_clientdata(client); 243 243 244 244 lis3lv02d_poweroff(lis3); ··· 247 247 248 248 static int lis3_i2c_runtime_resume(struct device *dev) 249 249 { 250 - struct i2c_client *client = container_of(dev, struct i2c_client, dev); 250 + struct i2c_client *client = to_i2c_client(dev); 251 251 struct lis3lv02d *lis3 = i2c_get_clientdata(client); 252 252 253 253 lis3lv02d_poweron(lis3);