linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] i2c: imx: Remove unused .id_table support
@ 2021-01-19  0:31 Fabio Estevam
  2021-01-19  0:31 ` [PATCH 2/2] i2c: imx: Remove unneeded 'match' variable Fabio Estevam
  2021-01-19  8:47 ` [PATCH] i2c: imx: Remove unused .id_table support Sascha Hauer
  0 siblings, 2 replies; 6+ messages in thread
From: Fabio Estevam @ 2021-01-19  0:31 UTC (permalink / raw)
  To: linux; +Cc: linux-i2c, kernel, wsa, Fabio Estevam

Since 5.10-rc1 i.MX is a devicetree-only platform and the existing
.id_table support in this driver was only useful for old non-devicetree
platforms.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
 drivers/i2c/busses/i2c-imx.c | 20 +-------------------
 1 file changed, 1 insertion(+), 19 deletions(-)

diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
index c98529c76348..ebf66120c51e 100644
--- a/drivers/i2c/busses/i2c-imx.c
+++ b/drivers/i2c/busses/i2c-imx.c
@@ -233,19 +233,6 @@ static struct imx_i2c_hwdata vf610_i2c_hwdata = {
 
 };
 
-static const struct platform_device_id imx_i2c_devtype[] = {
-	{
-		.name = "imx1-i2c",
-		.driver_data = (kernel_ulong_t)&imx1_i2c_hwdata,
-	}, {
-		.name = "imx21-i2c",
-		.driver_data = (kernel_ulong_t)&imx21_i2c_hwdata,
-	}, {
-		/* sentinel */
-	}
-};
-MODULE_DEVICE_TABLE(platform, imx_i2c_devtype);
-
 static const struct of_device_id i2c_imx_dt_ids[] = {
 	{ .compatible = "fsl,imx1-i2c", .data = &imx1_i2c_hwdata, },
 	{ .compatible = "fsl,imx21-i2c", .data = &imx21_i2c_hwdata, },
@@ -1141,11 +1128,7 @@ static int i2c_imx_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	match = device_get_match_data(&pdev->dev);
-	if (match)
-		i2c_imx->hwdata = match;
-	else
-		i2c_imx->hwdata = (struct imx_i2c_hwdata *)
-				platform_get_device_id(pdev)->driver_data;
+	i2c_imx->hwdata = match;
 
 	/* Setup i2c_imx driver structure */
 	strlcpy(i2c_imx->adapter.name, pdev->name, sizeof(i2c_imx->adapter.name));
@@ -1316,7 +1299,6 @@ static struct platform_driver i2c_imx_driver = {
 		.of_match_table = i2c_imx_dt_ids,
 		.acpi_match_table = i2c_imx_acpi_ids,
 	},
-	.id_table = imx_i2c_devtype,
 };
 
 static int __init i2c_adap_imx_init(void)
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] i2c: imx: Remove unneeded 'match' variable
  2021-01-19  0:31 [PATCH] i2c: imx: Remove unused .id_table support Fabio Estevam
@ 2021-01-19  0:31 ` Fabio Estevam
  2021-01-19  8:47 ` [PATCH] i2c: imx: Remove unused .id_table support Sascha Hauer
  1 sibling, 0 replies; 6+ messages in thread
From: Fabio Estevam @ 2021-01-19  0:31 UTC (permalink / raw)
  To: linux; +Cc: linux-i2c, kernel, wsa, Fabio Estevam

There is no need to have the intermediate 'match' variable.

Assign the device_get_match_data() directly to simplify the code.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
 drivers/i2c/busses/i2c-imx.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
index 5d0ce70411ad..6e5d26cf3f2f 100644
--- a/drivers/i2c/busses/i2c-imx.c
+++ b/drivers/i2c/busses/i2c-imx.c
@@ -1309,7 +1309,6 @@ static int i2c_imx_probe(struct platform_device *pdev)
 	void __iomem *base;
 	int irq, ret;
 	dma_addr_t phy_addr;
-	const struct imx_i2c_hwdata *match;
 
 	dev_dbg(&pdev->dev, "<%s>\n", __func__);
 
@@ -1327,8 +1326,7 @@ static int i2c_imx_probe(struct platform_device *pdev)
 	if (!i2c_imx)
 		return -ENOMEM;
 
-	match = device_get_match_data(&pdev->dev);
-	i2c_imx->hwdata = match;
+	i2c_imx->hwdata = device_get_match_data(&pdev->dev);
 
 	/* Setup i2c_imx driver structure */
 	strlcpy(i2c_imx->adapter.name, pdev->name, sizeof(i2c_imx->adapter.name));
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] i2c: imx: Remove unused .id_table support
  2021-01-19  0:31 [PATCH] i2c: imx: Remove unused .id_table support Fabio Estevam
  2021-01-19  0:31 ` [PATCH 2/2] i2c: imx: Remove unneeded 'match' variable Fabio Estevam
@ 2021-01-19  8:47 ` Sascha Hauer
  1 sibling, 0 replies; 6+ messages in thread
From: Sascha Hauer @ 2021-01-19  8:47 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: linux, wsa, linux-i2c, kernel

Hi Fabio,

On Mon, Jan 18, 2021 at 09:31:47PM -0300, Fabio Estevam wrote:
> Since 5.10-rc1 i.MX is a devicetree-only platform and the existing
> .id_table support in this driver was only useful for old non-devicetree
> platforms.
> 
> Signed-off-by: Fabio Estevam <festevam@gmail.com>
> ---
>  drivers/i2c/busses/i2c-imx.c | 20 +-------------------
>  1 file changed, 1 insertion(+), 19 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
> index c98529c76348..ebf66120c51e 100644
> --- a/drivers/i2c/busses/i2c-imx.c
> +++ b/drivers/i2c/busses/i2c-imx.c
> @@ -233,19 +233,6 @@ static struct imx_i2c_hwdata vf610_i2c_hwdata = {
>  
>  };
>  
> -static const struct platform_device_id imx_i2c_devtype[] = {
> -	{
> -		.name = "imx1-i2c",
> -		.driver_data = (kernel_ulong_t)&imx1_i2c_hwdata,
> -	}, {

Please grep for the driver name instead of guessing that it is unused.
This driver is indeed used with platform binding in the coldfire
architecture.

Regards,
 Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] i2c: imx: Remove unused .id_table support
  2020-11-16 20:29 Fabio Estevam
  2020-11-17  7:01 ` Uwe Kleine-König
@ 2020-12-02 15:46 ` Wolfram Sang
  1 sibling, 0 replies; 6+ messages in thread
From: Wolfram Sang @ 2020-12-02 15:46 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: kernel, shawnguo, linux-i2c

[-- Attachment #1: Type: text/plain, Size: 314 bytes --]

On Mon, Nov 16, 2020 at 05:29:10PM -0300, Fabio Estevam wrote:
> Since 5.10-rc1 i.MX is a devicetree-only platform and the existing
> .id_table support in this driver was only useful for old non-devicetree
> platforms.
> 
> Signed-off-by: Fabio Estevam <festevam@gmail.com>

Applied to for-next, thanks!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] i2c: imx: Remove unused .id_table support
  2020-11-16 20:29 Fabio Estevam
@ 2020-11-17  7:01 ` Uwe Kleine-König
  2020-12-02 15:46 ` Wolfram Sang
  1 sibling, 0 replies; 6+ messages in thread
From: Uwe Kleine-König @ 2020-11-17  7:01 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: wsa, shawnguo, linux-i2c, kernel

[-- Attachment #1: Type: text/plain, Size: 517 bytes --]

On Mon, Nov 16, 2020 at 05:29:10PM -0300, Fabio Estevam wrote:
> Since 5.10-rc1 i.MX is a devicetree-only platform and the existing
> .id_table support in this driver was only useful for old non-devicetree
> platforms.
> 
> Signed-off-by: Fabio Estevam <festevam@gmail.com>

Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Thanks
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] i2c: imx: Remove unused .id_table support
@ 2020-11-16 20:29 Fabio Estevam
  2020-11-17  7:01 ` Uwe Kleine-König
  2020-12-02 15:46 ` Wolfram Sang
  0 siblings, 2 replies; 6+ messages in thread
From: Fabio Estevam @ 2020-11-16 20:29 UTC (permalink / raw)
  To: wsa; +Cc: kernel, shawnguo, linux-i2c, Fabio Estevam

Since 5.10-rc1 i.MX is a devicetree-only platform and the existing
.id_table support in this driver was only useful for old non-devicetree
platforms.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
 drivers/i2c/busses/i2c-imx.c | 20 +-------------------
 1 file changed, 1 insertion(+), 19 deletions(-)

diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
index c98529c76348..ebf66120c51e 100644
--- a/drivers/i2c/busses/i2c-imx.c
+++ b/drivers/i2c/busses/i2c-imx.c
@@ -233,19 +233,6 @@ static struct imx_i2c_hwdata vf610_i2c_hwdata = {
 
 };
 
-static const struct platform_device_id imx_i2c_devtype[] = {
-	{
-		.name = "imx1-i2c",
-		.driver_data = (kernel_ulong_t)&imx1_i2c_hwdata,
-	}, {
-		.name = "imx21-i2c",
-		.driver_data = (kernel_ulong_t)&imx21_i2c_hwdata,
-	}, {
-		/* sentinel */
-	}
-};
-MODULE_DEVICE_TABLE(platform, imx_i2c_devtype);
-
 static const struct of_device_id i2c_imx_dt_ids[] = {
 	{ .compatible = "fsl,imx1-i2c", .data = &imx1_i2c_hwdata, },
 	{ .compatible = "fsl,imx21-i2c", .data = &imx21_i2c_hwdata, },
@@ -1141,11 +1128,7 @@ static int i2c_imx_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	match = device_get_match_data(&pdev->dev);
-	if (match)
-		i2c_imx->hwdata = match;
-	else
-		i2c_imx->hwdata = (struct imx_i2c_hwdata *)
-				platform_get_device_id(pdev)->driver_data;
+	i2c_imx->hwdata = match;
 
 	/* Setup i2c_imx driver structure */
 	strlcpy(i2c_imx->adapter.name, pdev->name, sizeof(i2c_imx->adapter.name));
@@ -1316,7 +1299,6 @@ static struct platform_driver i2c_imx_driver = {
 		.of_match_table = i2c_imx_dt_ids,
 		.acpi_match_table = i2c_imx_acpi_ids,
 	},
-	.id_table = imx_i2c_devtype,
 };
 
 static int __init i2c_adap_imx_init(void)
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-01-19  8:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-19  0:31 [PATCH] i2c: imx: Remove unused .id_table support Fabio Estevam
2021-01-19  0:31 ` [PATCH 2/2] i2c: imx: Remove unneeded 'match' variable Fabio Estevam
2021-01-19  8:47 ` [PATCH] i2c: imx: Remove unused .id_table support Sascha Hauer
  -- strict thread matches above, loose matches on Subject: below --
2020-11-16 20:29 Fabio Estevam
2020-11-17  7:01 ` Uwe Kleine-König
2020-12-02 15:46 ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).