linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] nvmem: imx-iim: Use of_device_get_match_data()
@ 2020-11-28 13:58 Fabio Estevam
  2021-01-05 16:23 ` Srinivas Kandagatla
  0 siblings, 1 reply; 2+ messages in thread
From: Fabio Estevam @ 2020-11-28 13:58 UTC (permalink / raw)
  To: srinivas.kandagatla; +Cc: m.grzeschik, Fabio Estevam, linux-arm-kernel

The retrieval of driver data via of_device_get_match_data() can make
the code simpler.

Use of_device_get_match_data() to simplify the code.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
 drivers/nvmem/imx-iim.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/nvmem/imx-iim.c b/drivers/nvmem/imx-iim.c
index 701704b87dc9..c86339a7f583 100644
--- a/drivers/nvmem/imx-iim.c
+++ b/drivers/nvmem/imx-iim.c
@@ -96,7 +96,6 @@ MODULE_DEVICE_TABLE(of, imx_iim_dt_ids);
 
 static int imx_iim_probe(struct platform_device *pdev)
 {
-	const struct of_device_id *of_id;
 	struct device *dev = &pdev->dev;
 	struct iim_priv *iim;
 	struct nvmem_device *nvmem;
@@ -111,11 +110,7 @@ static int imx_iim_probe(struct platform_device *pdev)
 	if (IS_ERR(iim->base))
 		return PTR_ERR(iim->base);
 
-	of_id = of_match_device(imx_iim_dt_ids, dev);
-	if (!of_id)
-		return -ENODEV;
-
-	drvdata = of_id->data;
+	drvdata = of_device_get_match_data(&pdev->dev);
 
 	iim->clk = devm_clk_get(dev, NULL);
 	if (IS_ERR(iim->clk))
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] nvmem: imx-iim: Use of_device_get_match_data()
  2020-11-28 13:58 [PATCH] nvmem: imx-iim: Use of_device_get_match_data() Fabio Estevam
@ 2021-01-05 16:23 ` Srinivas Kandagatla
  0 siblings, 0 replies; 2+ messages in thread
From: Srinivas Kandagatla @ 2021-01-05 16:23 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: m.grzeschik, linux-arm-kernel



On 28/11/2020 13:58, Fabio Estevam wrote:
> The retrieval of driver data via of_device_get_match_data() can make
> the code simpler.
> 
> Use of_device_get_match_data() to simplify the code.
> 
> Signed-off-by: Fabio Estevam <festevam@gmail.com>


Applied, thanks

--srini

> ---
>   drivers/nvmem/imx-iim.c | 7 +------
>   1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/drivers/nvmem/imx-iim.c b/drivers/nvmem/imx-iim.c
> index 701704b87dc9..c86339a7f583 100644
> --- a/drivers/nvmem/imx-iim.c
> +++ b/drivers/nvmem/imx-iim.c
> @@ -96,7 +96,6 @@ MODULE_DEVICE_TABLE(of, imx_iim_dt_ids);
>   
>   static int imx_iim_probe(struct platform_device *pdev)
>   {
> -	const struct of_device_id *of_id;
>   	struct device *dev = &pdev->dev;
>   	struct iim_priv *iim;
>   	struct nvmem_device *nvmem;
> @@ -111,11 +110,7 @@ static int imx_iim_probe(struct platform_device *pdev)
>   	if (IS_ERR(iim->base))
>   		return PTR_ERR(iim->base);
>   
> -	of_id = of_match_device(imx_iim_dt_ids, dev);
> -	if (!of_id)
> -		return -ENODEV;
> -
> -	drvdata = of_id->data;
> +	drvdata = of_device_get_match_data(&pdev->dev);
>   
>   	iim->clk = devm_clk_get(dev, NULL);
>   	if (IS_ERR(iim->clk))
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2021-01-05 16:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-28 13:58 [PATCH] nvmem: imx-iim: Use of_device_get_match_data() Fabio Estevam
2021-01-05 16:23 ` Srinivas Kandagatla

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).