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

media: i2c: Convert to new i2c device probe()

The I2C core framework provides a simplified probe framework from commit
b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() call-back type").

These drivers do not utilise the i2c_device_id table in the probe, so we
can easily convert them to utilise the simplified i2c driver
registration.

Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Acked-by: Andrzej Hajda <a.hajda@samsung.com>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>

authored by

Kieran Bingham and committed by
Mauro Carvalho Chehab
e6714993 bec5352d

+38 -56
+2 -3
drivers/media/i2c/adv7343.c
··· 428 428 return pdata; 429 429 } 430 430 431 - static int adv7343_probe(struct i2c_client *client, 432 - const struct i2c_device_id *id) 431 + static int adv7343_probe(struct i2c_client *client) 433 432 { 434 433 struct adv7343_state *state; 435 434 int err; ··· 523 524 .of_match_table = of_match_ptr(adv7343_of_match), 524 525 .name = "adv7343", 525 526 }, 526 - .probe = adv7343_probe, 527 + .probe_new = adv7343_probe, 527 528 .remove = adv7343_remove, 528 529 .id_table = adv7343_id, 529 530 };
+2 -3
drivers/media/i2c/imx274.c
··· 1821 1821 }; 1822 1822 MODULE_DEVICE_TABLE(i2c, imx274_id); 1823 1823 1824 - static int imx274_probe(struct i2c_client *client, 1825 - const struct i2c_device_id *id) 1824 + static int imx274_probe(struct i2c_client *client) 1826 1825 { 1827 1826 struct v4l2_subdev *sd; 1828 1827 struct stimx274 *imx274; ··· 1983 1984 .name = DRIVER_NAME, 1984 1985 .of_match_table = imx274_of_id_table, 1985 1986 }, 1986 - .probe = imx274_probe, 1987 + .probe_new = imx274_probe, 1987 1988 .remove = imx274_remove, 1988 1989 .id_table = imx274_id, 1989 1990 };
+2 -3
drivers/media/i2c/max2175.c
··· 1271 1271 return 0; 1272 1272 } 1273 1273 1274 - static int max2175_probe(struct i2c_client *client, 1275 - const struct i2c_device_id *id) 1274 + static int max2175_probe(struct i2c_client *client) 1276 1275 { 1277 1276 bool master = true, am_hiz = false; 1278 1277 u32 refout_load, refout_bits = 0; /* REFOUT disabled */ ··· 1432 1433 .name = DRIVER_NAME, 1433 1434 .of_match_table = max2175_of_ids, 1434 1435 }, 1435 - .probe = max2175_probe, 1436 + .probe_new = max2175_probe, 1436 1437 .remove = max2175_remove, 1437 1438 .id_table = max2175_id, 1438 1439 };
+2 -3
drivers/media/i2c/mt9m001.c
··· 726 726 .pad = &mt9m001_subdev_pad_ops, 727 727 }; 728 728 729 - static int mt9m001_probe(struct i2c_client *client, 730 - const struct i2c_device_id *did) 729 + static int mt9m001_probe(struct i2c_client *client) 731 730 { 732 731 struct mt9m001 *mt9m001; 733 732 struct i2c_adapter *adapter = client->adapter; ··· 871 872 .pm = &mt9m001_pm_ops, 872 873 .of_match_table = mt9m001_of_match, 873 874 }, 874 - .probe = mt9m001_probe, 875 + .probe_new = mt9m001_probe, 875 876 .remove = mt9m001_remove, 876 877 .id_table = mt9m001_id, 877 878 };
+2 -3
drivers/media/i2c/mt9m111.c
··· 1243 1243 return ret; 1244 1244 } 1245 1245 1246 - static int mt9m111_probe(struct i2c_client *client, 1247 - const struct i2c_device_id *did) 1246 + static int mt9m111_probe(struct i2c_client *client) 1248 1247 { 1249 1248 struct mt9m111 *mt9m111; 1250 1249 struct i2c_adapter *adapter = client->adapter; ··· 1387 1388 .name = "mt9m111", 1388 1389 .of_match_table = of_match_ptr(mt9m111_of_match), 1389 1390 }, 1390 - .probe = mt9m111_probe, 1391 + .probe_new = mt9m111_probe, 1391 1392 .remove = mt9m111_remove, 1392 1393 .id_table = mt9m111_id, 1393 1394 };
+2 -3
drivers/media/i2c/ov2640.c
··· 1190 1190 /* 1191 1191 * i2c_driver functions 1192 1192 */ 1193 - static int ov2640_probe(struct i2c_client *client, 1194 - const struct i2c_device_id *did) 1193 + static int ov2640_probe(struct i2c_client *client) 1195 1194 { 1196 1195 struct ov2640_priv *priv; 1197 1196 struct i2c_adapter *adapter = client->adapter; ··· 1301 1302 .name = "ov2640", 1302 1303 .of_match_table = of_match_ptr(ov2640_of_match), 1303 1304 }, 1304 - .probe = ov2640_probe, 1305 + .probe_new = ov2640_probe, 1305 1306 .remove = ov2640_remove, 1306 1307 .id_table = ov2640_id, 1307 1308 };
+2 -3
drivers/media/i2c/ov2659.c
··· 1384 1384 return pdata; 1385 1385 } 1386 1386 1387 - static int ov2659_probe(struct i2c_client *client, 1388 - const struct i2c_device_id *id) 1387 + static int ov2659_probe(struct i2c_client *client) 1389 1388 { 1390 1389 const struct ov2659_platform_data *pdata = ov2659_get_pdata(client); 1391 1390 struct v4l2_subdev *sd; ··· 1512 1513 .name = DRIVER_NAME, 1513 1514 .of_match_table = of_match_ptr(ov2659_of_match), 1514 1515 }, 1515 - .probe = ov2659_probe, 1516 + .probe_new = ov2659_probe, 1516 1517 .remove = ov2659_remove, 1517 1518 .id_table = ov2659_id, 1518 1519 };
+2 -3
drivers/media/i2c/ov5640.c
··· 2936 2936 return ret; 2937 2937 } 2938 2938 2939 - static int ov5640_probe(struct i2c_client *client, 2940 - const struct i2c_device_id *id) 2939 + static int ov5640_probe(struct i2c_client *client) 2941 2940 { 2942 2941 struct device *dev = &client->dev; 2943 2942 struct fwnode_handle *endpoint; ··· 3099 3100 .of_match_table = ov5640_dt_ids, 3100 3101 }, 3101 3102 .id_table = ov5640_id, 3102 - .probe = ov5640_probe, 3103 + .probe_new = ov5640_probe, 3103 3104 .remove = ov5640_remove, 3104 3105 }; 3105 3106
+2 -3
drivers/media/i2c/ov5645.c
··· 1039 1039 .pad = &ov5645_subdev_pad_ops, 1040 1040 }; 1041 1041 1042 - static int ov5645_probe(struct i2c_client *client, 1043 - const struct i2c_device_id *id) 1042 + static int ov5645_probe(struct i2c_client *client) 1044 1043 { 1045 1044 struct device *dev = &client->dev; 1046 1045 struct device_node *endpoint; ··· 1274 1275 .of_match_table = of_match_ptr(ov5645_of_match), 1275 1276 .name = "ov5645", 1276 1277 }, 1277 - .probe = ov5645_probe, 1278 + .probe_new = ov5645_probe, 1278 1279 .remove = ov5645_remove, 1279 1280 .id_table = ov5645_id, 1280 1281 };
+2 -3
drivers/media/i2c/ov5647.c
··· 547 547 return ret; 548 548 } 549 549 550 - static int ov5647_probe(struct i2c_client *client, 551 - const struct i2c_device_id *id) 550 + static int ov5647_probe(struct i2c_client *client) 552 551 { 553 552 struct device *dev = &client->dev; 554 553 struct ov5647 *sensor; ··· 643 644 .of_match_table = of_match_ptr(ov5647_of_match), 644 645 .name = SENSOR_NAME, 645 646 }, 646 - .probe = ov5647_probe, 647 + .probe_new = ov5647_probe, 647 648 .remove = ov5647_remove, 648 649 .id_table = ov5647_id, 649 650 };
+2 -3
drivers/media/i2c/ov772x.c
··· 1352 1352 * i2c_driver function 1353 1353 */ 1354 1354 1355 - static int ov772x_probe(struct i2c_client *client, 1356 - const struct i2c_device_id *did) 1355 + static int ov772x_probe(struct i2c_client *client) 1357 1356 { 1358 1357 struct ov772x_priv *priv; 1359 1358 int ret; ··· 1485 1486 .name = "ov772x", 1486 1487 .of_match_table = ov772x_of_match, 1487 1488 }, 1488 - .probe = ov772x_probe, 1489 + .probe_new = ov772x_probe, 1489 1490 .remove = ov772x_remove, 1490 1491 .id_table = ov772x_id, 1491 1492 };
+2 -3
drivers/media/i2c/ov7740.c
··· 1062 1062 .max_register = OV7740_MAX_REGISTER, 1063 1063 }; 1064 1064 1065 - static int ov7740_probe(struct i2c_client *client, 1066 - const struct i2c_device_id *id) 1065 + static int ov7740_probe(struct i2c_client *client) 1067 1066 { 1068 1067 struct ov7740 *ov7740; 1069 1068 struct v4l2_subdev *sd; ··· 1224 1225 .pm = &ov7740_pm_ops, 1225 1226 .of_match_table = of_match_ptr(ov7740_of_match), 1226 1227 }, 1227 - .probe = ov7740_probe, 1228 + .probe_new = ov7740_probe, 1228 1229 .remove = ov7740_remove, 1229 1230 .id_table = ov7740_id, 1230 1231 };
+2 -3
drivers/media/i2c/ov9650.c
··· 1485 1485 return ret; 1486 1486 } 1487 1487 1488 - static int ov965x_probe(struct i2c_client *client, 1489 - const struct i2c_device_id *id) 1488 + static int ov965x_probe(struct i2c_client *client) 1490 1489 { 1491 1490 const struct ov9650_platform_data *pdata = client->dev.platform_data; 1492 1491 struct v4l2_subdev *sd; ··· 1612 1613 .name = DRIVER_NAME, 1613 1614 .of_match_table = of_match_ptr(ov965x_of_match), 1614 1615 }, 1615 - .probe = ov965x_probe, 1616 + .probe_new = ov965x_probe, 1616 1617 .remove = ov965x_remove, 1617 1618 .id_table = ov965x_id, 1618 1619 };
+2 -3
drivers/media/i2c/s5k5baf.c
··· 1946 1946 return ret; 1947 1947 } 1948 1948 1949 - static int s5k5baf_probe(struct i2c_client *c, 1950 - const struct i2c_device_id *id) 1949 + static int s5k5baf_probe(struct i2c_client *c) 1951 1950 { 1952 1951 struct s5k5baf *state; 1953 1952 int ret; ··· 2045 2046 .of_match_table = s5k5baf_of_match, 2046 2047 .name = S5K5BAF_DRIVER_NAME 2047 2048 }, 2048 - .probe = s5k5baf_probe, 2049 + .probe_new = s5k5baf_probe, 2049 2050 .remove = s5k5baf_remove, 2050 2051 .id_table = s5k5baf_id, 2051 2052 };
+2 -3
drivers/media/i2c/s5k6a3.c
··· 275 275 .pad = &s5k6a3_pad_ops, 276 276 }; 277 277 278 - static int s5k6a3_probe(struct i2c_client *client, 279 - const struct i2c_device_id *id) 278 + static int s5k6a3_probe(struct i2c_client *client) 280 279 { 281 280 struct device *dev = &client->dev; 282 281 struct s5k6a3 *sensor; ··· 377 378 .of_match_table = of_match_ptr(s5k6a3_of_match), 378 379 .name = S5K6A3_DRV_NAME, 379 380 }, 380 - .probe = s5k6a3_probe, 381 + .probe_new = s5k6a3_probe, 381 382 .remove = s5k6a3_remove, 382 383 .id_table = s5k6a3_ids, 383 384 };
+2 -3
drivers/media/i2c/tc358743.c
··· 2026 2026 } 2027 2027 #endif 2028 2028 2029 - static int tc358743_probe(struct i2c_client *client, 2030 - const struct i2c_device_id *id) 2029 + static int tc358743_probe(struct i2c_client *client) 2031 2030 { 2032 2031 static struct v4l2_dv_timings default_timing = 2033 2032 V4L2_DV_BT_CEA_640X480P59_94; ··· 2221 2222 .name = "tc358743", 2222 2223 .of_match_table = of_match_ptr(tc358743_of_match), 2223 2224 }, 2224 - .probe = tc358743_probe, 2225 + .probe_new = tc358743_probe, 2225 2226 .remove = tc358743_remove, 2226 2227 .id_table = tc358743_id, 2227 2228 };
+2 -3
drivers/media/i2c/ths8200.c
··· 436 436 .pad = &ths8200_pad_ops, 437 437 }; 438 438 439 - static int ths8200_probe(struct i2c_client *client, 440 - const struct i2c_device_id *id) 439 + static int ths8200_probe(struct i2c_client *client) 441 440 { 442 441 struct ths8200_state *state; 443 442 struct v4l2_subdev *sd; ··· 501 502 .name = "ths8200", 502 503 .of_match_table = of_match_ptr(ths8200_of_match), 503 504 }, 504 - .probe = ths8200_probe, 505 + .probe_new = ths8200_probe, 505 506 .remove = ths8200_remove, 506 507 .id_table = ths8200_id, 507 508 };
+2 -3
drivers/media/i2c/tvp5150.c
··· 1695 1695 "Black screen" 1696 1696 }; 1697 1697 1698 - static int tvp5150_probe(struct i2c_client *c, 1699 - const struct i2c_device_id *id) 1698 + static int tvp5150_probe(struct i2c_client *c) 1700 1699 { 1701 1700 struct tvp5150 *core; 1702 1701 struct v4l2_subdev *sd; ··· 1844 1845 .of_match_table = of_match_ptr(tvp5150_of_match), 1845 1846 .name = "tvp5150", 1846 1847 }, 1847 - .probe = tvp5150_probe, 1848 + .probe_new = tvp5150_probe, 1848 1849 .remove = tvp5150_remove, 1849 1850 .id_table = tvp5150_id, 1850 1851 };
+2 -2
drivers/media/i2c/tvp7002.c
··· 930 930 * Returns zero when successful, -EINVAL if register read fails or 931 931 * -EIO if i2c access is not available. 932 932 */ 933 - static int tvp7002_probe(struct i2c_client *c, const struct i2c_device_id *id) 933 + static int tvp7002_probe(struct i2c_client *c) 934 934 { 935 935 struct tvp7002_config *pdata = tvp7002_get_pdata(c); 936 936 struct v4l2_subdev *sd; ··· 1075 1075 .of_match_table = of_match_ptr(tvp7002_of_match), 1076 1076 .name = TVP7002_MODULE_NAME, 1077 1077 }, 1078 - .probe = tvp7002_probe, 1078 + .probe_new = tvp7002_probe, 1079 1079 .remove = tvp7002_remove, 1080 1080 .id_table = tvp7002_id, 1081 1081 };