Commit c32abd8b authored by Fabio Estevam's avatar Fabio Estevam Committed by Wolfram Sang
Browse files

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: default avatarFabio Estevam <festevam@gmail.com>
Reported-by: default avatarkernel test robot <lkp@intel.com>
Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
parent 83eb65b6
Loading
Loading
Loading
Loading
+3 −19
Original line number Diff line number Diff line
@@ -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))