mirror of
https://github.com/torvalds/linux.git
synced 2024-11-13 15:41:39 +00:00
i2c: mxs: Remove unneeded platform_device_id
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>
This commit is contained in:
parent
83eb65b6ac
commit
c32abd8b56
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user