i2c: mxs: Remove unneeded platform_device_id
authorFabio Estevam <festevam@gmail.com>
Tue, 24 Nov 2020 00:28:49 +0000 (21:28 -0300)
committerWolfram Sang <wsa@kernel.org>
Wed, 2 Dec 2020 20:29:31 +0000 (21:29 +0100)
The i2c-mxs driver only runs on DT-platform and there is no
need to use the platform_device_id structure to pass the driver
data.

Get rid of it to make the code simpler.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
drivers/i2c/busses/i2c-mxs.c

index c4b08a9..f97243f 100644 (file)
@@ -781,28 +781,15 @@ static int mxs_i2c_get_ofdata(struct mxs_i2c_dev *i2c)
        return 0;
 }
 
-static const struct platform_device_id mxs_i2c_devtype[] = {
-       {
-               .name = "imx23-i2c",
-               .driver_data = MXS_I2C_V1,
-       }, {
-               .name = "imx28-i2c",
-               .driver_data = MXS_I2C_V2,
-       }, { /* sentinel */ }
-};
-MODULE_DEVICE_TABLE(platform, mxs_i2c_devtype);
-
 static const struct of_device_id mxs_i2c_dt_ids[] = {
-       { .compatible = "fsl,imx23-i2c", .data = &mxs_i2c_devtype[0], },
-       { .compatible = "fsl,imx28-i2c", .data = &mxs_i2c_devtype[1], },
+       { .compatible = "fsl,imx23-i2c", .data = (void *)MXS_I2C_V1, },
+       { .compatible = "fsl,imx28-i2c", .data = (void *)MXS_I2C_V2, },
        { /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, mxs_i2c_dt_ids);
 
 static int mxs_i2c_probe(struct platform_device *pdev)
 {
-       const struct of_device_id *of_id =
-                               of_match_device(mxs_i2c_dt_ids, &pdev->dev);
        struct device *dev = &pdev->dev;
        struct mxs_i2c_dev *i2c;
        struct i2c_adapter *adap;
@@ -812,10 +799,7 @@ static int mxs_i2c_probe(struct platform_device *pdev)
        if (!i2c)
                return -ENOMEM;
 
-       if (of_id) {
-               const struct platform_device_id *device_id = of_id->data;
-               i2c->dev_type = device_id->driver_data;
-       }
+       i2c->dev_type = (enum mxs_i2c_devtype)of_device_get_match_data(&pdev->dev);
 
        i2c->regs = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(i2c->regs))