OSDN Git Service

media: i2c: Convert to new i2c device probe()
authorKieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Wed, 10 Jul 2019 21:51:49 +0000 (18:51 -0300)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Tue, 13 Aug 2019 14:54:04 +0000 (11:54 -0300)
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>
19 files changed:
drivers/media/i2c/adv7343.c
drivers/media/i2c/imx274.c
drivers/media/i2c/max2175.c
drivers/media/i2c/mt9m001.c
drivers/media/i2c/mt9m111.c
drivers/media/i2c/ov2640.c
drivers/media/i2c/ov2659.c
drivers/media/i2c/ov5640.c
drivers/media/i2c/ov5645.c
drivers/media/i2c/ov5647.c
drivers/media/i2c/ov772x.c
drivers/media/i2c/ov7740.c
drivers/media/i2c/ov9650.c
drivers/media/i2c/s5k5baf.c
drivers/media/i2c/s5k6a3.c
drivers/media/i2c/tc358743.c
drivers/media/i2c/ths8200.c
drivers/media/i2c/tvp5150.c
drivers/media/i2c/tvp7002.c

index 4a441ee..63e94df 100644 (file)
@@ -428,8 +428,7 @@ done:
        return pdata;
 }
 
-static int adv7343_probe(struct i2c_client *client,
-                               const struct i2c_device_id *id)
+static int adv7343_probe(struct i2c_client *client)
 {
        struct adv7343_state *state;
        int err;
@@ -524,7 +523,7 @@ static struct i2c_driver adv7343_driver = {
                .of_match_table = of_match_ptr(adv7343_of_match),
                .name   = "adv7343",
        },
-       .probe          = adv7343_probe,
+       .probe_new      = adv7343_probe,
        .remove         = adv7343_remove,
        .id_table       = adv7343_id,
 };
index f3ff1af..6011cec 100644 (file)
@@ -1821,8 +1821,7 @@ static const struct i2c_device_id imx274_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, imx274_id);
 
-static int imx274_probe(struct i2c_client *client,
-                       const struct i2c_device_id *id)
+static int imx274_probe(struct i2c_client *client)
 {
        struct v4l2_subdev *sd;
        struct stimx274 *imx274;
@@ -1984,7 +1983,7 @@ static struct i2c_driver imx274_i2c_driver = {
                .name   = DRIVER_NAME,
                .of_match_table = imx274_of_id_table,
        },
-       .probe          = imx274_probe,
+       .probe_new      = imx274_probe,
        .remove         = imx274_remove,
        .id_table       = imx274_id,
 };
index 7b226fa..19a3cee 100644 (file)
@@ -1271,8 +1271,7 @@ static int max2175_refout_load_to_bits(struct i2c_client *client, u32 load,
        return 0;
 }
 
-static int max2175_probe(struct i2c_client *client,
-                       const struct i2c_device_id *id)
+static int max2175_probe(struct i2c_client *client)
 {
        bool master = true, am_hiz = false;
        u32 refout_load, refout_bits = 0;       /* REFOUT disabled */
@@ -1433,7 +1432,7 @@ static struct i2c_driver max2175_driver = {
                .name   = DRIVER_NAME,
                .of_match_table = max2175_of_ids,
        },
-       .probe          = max2175_probe,
+       .probe_new      = max2175_probe,
        .remove         = max2175_remove,
        .id_table       = max2175_id,
 };
index 2df743c..5613072 100644 (file)
@@ -726,8 +726,7 @@ static const struct v4l2_subdev_ops mt9m001_subdev_ops = {
        .pad    = &mt9m001_subdev_pad_ops,
 };
 
-static int mt9m001_probe(struct i2c_client *client,
-                        const struct i2c_device_id *did)
+static int mt9m001_probe(struct i2c_client *client)
 {
        struct mt9m001 *mt9m001;
        struct i2c_adapter *adapter = client->adapter;
@@ -872,7 +871,7 @@ static struct i2c_driver mt9m001_i2c_driver = {
                .pm = &mt9m001_pm_ops,
                .of_match_table = mt9m001_of_match,
        },
-       .probe          = mt9m001_probe,
+       .probe_new      = mt9m001_probe,
        .remove         = mt9m001_remove,
        .id_table       = mt9m001_id,
 };
index 3e01d1b..17e8253 100644 (file)
@@ -1243,8 +1243,7 @@ out_put_fw:
        return ret;
 }
 
-static int mt9m111_probe(struct i2c_client *client,
-                        const struct i2c_device_id *did)
+static int mt9m111_probe(struct i2c_client *client)
 {
        struct mt9m111 *mt9m111;
        struct i2c_adapter *adapter = client->adapter;
@@ -1388,7 +1387,7 @@ static struct i2c_driver mt9m111_i2c_driver = {
                .name = "mt9m111",
                .of_match_table = of_match_ptr(mt9m111_of_match),
        },
-       .probe          = mt9m111_probe,
+       .probe_new      = mt9m111_probe,
        .remove         = mt9m111_remove,
        .id_table       = mt9m111_id,
 };
index 8fd1766..4a4bd5b 100644 (file)
@@ -1190,8 +1190,7 @@ static int ov2640_probe_dt(struct i2c_client *client,
 /*
  * i2c_driver functions
  */
-static int ov2640_probe(struct i2c_client *client,
-                       const struct i2c_device_id *did)
+static int ov2640_probe(struct i2c_client *client)
 {
        struct ov2640_priv      *priv;
        struct i2c_adapter      *adapter = client->adapter;
@@ -1302,7 +1301,7 @@ static struct i2c_driver ov2640_i2c_driver = {
                .name = "ov2640",
                .of_match_table = of_match_ptr(ov2640_of_match),
        },
-       .probe    = ov2640_probe,
+       .probe_new = ov2640_probe,
        .remove   = ov2640_remove,
        .id_table = ov2640_id,
 };
index a71277e..f4ded06 100644 (file)
@@ -1384,8 +1384,7 @@ done:
        return pdata;
 }
 
-static int ov2659_probe(struct i2c_client *client,
-                       const struct i2c_device_id *id)
+static int ov2659_probe(struct i2c_client *client)
 {
        const struct ov2659_platform_data *pdata = ov2659_get_pdata(client);
        struct v4l2_subdev *sd;
@@ -1513,7 +1512,7 @@ static struct i2c_driver ov2659_i2c_driver = {
                .name   = DRIVER_NAME,
                .of_match_table = of_match_ptr(ov2659_of_match),
        },
-       .probe          = ov2659_probe,
+       .probe_new      = ov2659_probe,
        .remove         = ov2659_remove,
        .id_table       = ov2659_id,
 };
index 4cd2468..a0229df 100644 (file)
@@ -2936,8 +2936,7 @@ power_off:
        return ret;
 }
 
-static int ov5640_probe(struct i2c_client *client,
-                       const struct i2c_device_id *id)
+static int ov5640_probe(struct i2c_client *client)
 {
        struct device *dev = &client->dev;
        struct fwnode_handle *endpoint;
@@ -3100,7 +3099,7 @@ static struct i2c_driver ov5640_i2c_driver = {
                .of_match_table = ov5640_dt_ids,
        },
        .id_table = ov5640_id,
-       .probe    = ov5640_probe,
+       .probe_new = ov5640_probe,
        .remove   = ov5640_remove,
 };
 
index 9602b92..7721cce 100644 (file)
@@ -1039,8 +1039,7 @@ static const struct v4l2_subdev_ops ov5645_subdev_ops = {
        .pad = &ov5645_subdev_pad_ops,
 };
 
-static int ov5645_probe(struct i2c_client *client,
-                       const struct i2c_device_id *id)
+static int ov5645_probe(struct i2c_client *client)
 {
        struct device *dev = &client->dev;
        struct device_node *endpoint;
@@ -1275,7 +1274,7 @@ static struct i2c_driver ov5645_i2c_driver = {
                .of_match_table = of_match_ptr(ov5645_of_match),
                .name  = "ov5645",
        },
-       .probe  = ov5645_probe,
+       .probe_new = ov5645_probe,
        .remove = ov5645_remove,
        .id_table = ov5645_id,
 };
index 4589631..e7d2e5b 100644 (file)
@@ -547,8 +547,7 @@ static int ov5647_parse_dt(struct device_node *np)
        return ret;
 }
 
-static int ov5647_probe(struct i2c_client *client,
-                       const struct i2c_device_id *id)
+static int ov5647_probe(struct i2c_client *client)
 {
        struct device *dev = &client->dev;
        struct ov5647 *sensor;
@@ -644,7 +643,7 @@ static struct i2c_driver ov5647_driver = {
                .of_match_table = of_match_ptr(ov5647_of_match),
                .name   = SENSOR_NAME,
        },
-       .probe          = ov5647_probe,
+       .probe_new      = ov5647_probe,
        .remove         = ov5647_remove,
        .id_table       = ov5647_id,
 };
index 2e9a758..2cc6a67 100644 (file)
@@ -1352,8 +1352,7 @@ static const struct v4l2_subdev_ops ov772x_subdev_ops = {
  * i2c_driver function
  */
 
-static int ov772x_probe(struct i2c_client *client,
-                       const struct i2c_device_id *did)
+static int ov772x_probe(struct i2c_client *client)
 {
        struct ov772x_priv      *priv;
        int                     ret;
@@ -1486,7 +1485,7 @@ static struct i2c_driver ov772x_i2c_driver = {
                .name = "ov772x",
                .of_match_table = ov772x_of_match,
        },
-       .probe    = ov772x_probe,
+       .probe_new = ov772x_probe,
        .remove   = ov772x_remove,
        .id_table = ov772x_id,
 };
index a2f8f19..732655f 100644 (file)
@@ -1062,8 +1062,7 @@ static const struct regmap_config ov7740_regmap_config = {
        .max_register   = OV7740_MAX_REGISTER,
 };
 
-static int ov7740_probe(struct i2c_client *client,
-                       const struct i2c_device_id *id)
+static int ov7740_probe(struct i2c_client *client)
 {
        struct ov7740 *ov7740;
        struct v4l2_subdev *sd;
@@ -1225,7 +1224,7 @@ static struct i2c_driver ov7740_i2c_driver = {
                .pm = &ov7740_pm_ops,
                .of_match_table = of_match_ptr(ov7740_of_match),
        },
-       .probe    = ov7740_probe,
+       .probe_new = ov7740_probe,
        .remove   = ov7740_remove,
        .id_table = ov7740_id,
 };
index 30ab222..8b56011 100644 (file)
@@ -1485,8 +1485,7 @@ out:
        return ret;
 }
 
-static int ov965x_probe(struct i2c_client *client,
-                       const struct i2c_device_id *id)
+static int ov965x_probe(struct i2c_client *client)
 {
        const struct ov9650_platform_data *pdata = client->dev.platform_data;
        struct v4l2_subdev *sd;
@@ -1613,7 +1612,7 @@ static struct i2c_driver ov965x_i2c_driver = {
                .name   = DRIVER_NAME,
                .of_match_table = of_match_ptr(ov965x_of_match),
        },
-       .probe          = ov965x_probe,
+       .probe_new      = ov965x_probe,
        .remove         = ov965x_remove,
        .id_table       = ov965x_id,
 };
index 8e6de06..cdfe008 100644 (file)
@@ -1946,8 +1946,7 @@ static int s5k5baf_configure_regulators(struct s5k5baf *state)
        return ret;
 }
 
-static int s5k5baf_probe(struct i2c_client *c,
-                       const struct i2c_device_id *id)
+static int s5k5baf_probe(struct i2c_client *c)
 {
        struct s5k5baf *state;
        int ret;
@@ -2046,7 +2045,7 @@ static struct i2c_driver s5k5baf_i2c_driver = {
                .of_match_table = s5k5baf_of_match,
                .name = S5K5BAF_DRIVER_NAME
        },
-       .probe          = s5k5baf_probe,
+       .probe_new      = s5k5baf_probe,
        .remove         = s5k5baf_remove,
        .id_table       = s5k5baf_id,
 };
index 3b7721f..bc6cc5a 100644 (file)
@@ -275,8 +275,7 @@ static const struct v4l2_subdev_ops s5k6a3_subdev_ops = {
        .pad = &s5k6a3_pad_ops,
 };
 
-static int s5k6a3_probe(struct i2c_client *client,
-                               const struct i2c_device_id *id)
+static int s5k6a3_probe(struct i2c_client *client)
 {
        struct device *dev = &client->dev;
        struct s5k6a3 *sensor;
@@ -378,7 +377,7 @@ static struct i2c_driver s5k6a3_driver = {
                .of_match_table = of_match_ptr(s5k6a3_of_match),
                .name           = S5K6A3_DRV_NAME,
        },
-       .probe          = s5k6a3_probe,
+       .probe_new      = s5k6a3_probe,
        .remove         = s5k6a3_remove,
        .id_table       = s5k6a3_ids,
 };
index bc2e35e..dbbab75 100644 (file)
@@ -2026,8 +2026,7 @@ static inline int tc358743_probe_of(struct tc358743_state *state)
 }
 #endif
 
-static int tc358743_probe(struct i2c_client *client,
-                         const struct i2c_device_id *id)
+static int tc358743_probe(struct i2c_client *client)
 {
        static struct v4l2_dv_timings default_timing =
                V4L2_DV_BT_CEA_640X480P59_94;
@@ -2222,7 +2221,7 @@ static struct i2c_driver tc358743_driver = {
                .name = "tc358743",
                .of_match_table = of_match_ptr(tc358743_of_match),
        },
-       .probe = tc358743_probe,
+       .probe_new = tc358743_probe,
        .remove = tc358743_remove,
        .id_table = tc358743_id,
 };
index f5ee280..c52fe84 100644 (file)
@@ -436,8 +436,7 @@ static const struct v4l2_subdev_ops ths8200_ops = {
        .pad = &ths8200_pad_ops,
 };
 
-static int ths8200_probe(struct i2c_client *client,
-                        const struct i2c_device_id *id)
+static int ths8200_probe(struct i2c_client *client)
 {
        struct ths8200_state *state;
        struct v4l2_subdev *sd;
@@ -502,7 +501,7 @@ static struct i2c_driver ths8200_driver = {
                .name = "ths8200",
                .of_match_table = of_match_ptr(ths8200_of_match),
        },
-       .probe = ths8200_probe,
+       .probe_new = ths8200_probe,
        .remove = ths8200_remove,
        .id_table = ths8200_id,
 };
index dffe357..edad49c 100644 (file)
@@ -1695,8 +1695,7 @@ static const char * const tvp5150_test_patterns[2] = {
        "Black screen"
 };
 
-static int tvp5150_probe(struct i2c_client *c,
-                        const struct i2c_device_id *id)
+static int tvp5150_probe(struct i2c_client *c)
 {
        struct tvp5150 *core;
        struct v4l2_subdev *sd;
@@ -1845,7 +1844,7 @@ static struct i2c_driver tvp5150_driver = {
                .of_match_table = of_match_ptr(tvp5150_of_match),
                .name   = "tvp5150",
        },
-       .probe          = tvp5150_probe,
+       .probe_new      = tvp5150_probe,
        .remove         = tvp5150_remove,
        .id_table       = tvp5150_id,
 };
index 1b8175c..de313b1 100644 (file)
@@ -930,7 +930,7 @@ done:
  * Returns zero when successful, -EINVAL if register read fails or
  * -EIO if i2c access is not available.
  */
-static int tvp7002_probe(struct i2c_client *c, const struct i2c_device_id *id)
+static int tvp7002_probe(struct i2c_client *c)
 {
        struct tvp7002_config *pdata = tvp7002_get_pdata(c);
        struct v4l2_subdev *sd;
@@ -1075,7 +1075,7 @@ static struct i2c_driver tvp7002_driver = {
                .of_match_table = of_match_ptr(tvp7002_of_match),
                .name = TVP7002_MODULE_NAME,
        },
-       .probe = tvp7002_probe,
+       .probe_new = tvp7002_probe,
        .remove = tvp7002_remove,
        .id_table = tvp7002_id,
 };