mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] phy-mvebu-a3700-utmi: Use devm_platform_ioremap_resource() in mvebu_a3700_utmi_phy_probe()
@ 2019-09-26 16:20 Markus Elfring
  2019-10-23  5:25 ` Kishon Vijay Abraham I
  0 siblings, 1 reply; 2+ messages in thread
From: Markus Elfring @ 2019-09-26 16:20 UTC (permalink / raw)
  To: kernel-janitors, Igal Liberman, Kishon Vijay Abraham I, Miquel Raynal
  Cc: LKML

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Thu, 26 Sep 2019 18:15:23 +0200

Simplify this function implementation by using a known wrapper function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/phy/marvell/phy-mvebu-a3700-utmi.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/drivers/phy/marvell/phy-mvebu-a3700-utmi.c b/drivers/phy/marvell/phy-mvebu-a3700-utmi.c
index ded900b06f5a..23bc3bf5c4c0 100644
--- a/drivers/phy/marvell/phy-mvebu-a3700-utmi.c
+++ b/drivers/phy/marvell/phy-mvebu-a3700-utmi.c
@@ -216,20 +216,13 @@ static int mvebu_a3700_utmi_phy_probe(struct platform_device *pdev)
 	struct device *dev = &pdev->dev;
 	struct mvebu_a3700_utmi *utmi;
 	struct phy_provider *provider;
-	struct resource *res;

 	utmi = devm_kzalloc(dev, sizeof(*utmi), GFP_KERNEL);
 	if (!utmi)
 		return -ENOMEM;

 	/* Get UTMI memory region */
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!res) {
-		dev_err(dev, "Missing UTMI PHY memory resource\n");
-		return -ENODEV;
-	}
-
-	utmi->regs = devm_ioremap_resource(dev, res);
+	utmi->regs = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(utmi->regs))
 		return PTR_ERR(utmi->regs);

--
2.23.0


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

* Re: [PATCH] phy-mvebu-a3700-utmi: Use devm_platform_ioremap_resource() in mvebu_a3700_utmi_phy_probe()
  2019-09-26 16:20 [PATCH] phy-mvebu-a3700-utmi: Use devm_platform_ioremap_resource() in mvebu_a3700_utmi_phy_probe() Markus Elfring
@ 2019-10-23  5:25 ` Kishon Vijay Abraham I
  0 siblings, 0 replies; 2+ messages in thread
From: Kishon Vijay Abraham I @ 2019-10-23  5:25 UTC (permalink / raw)
  To: Markus Elfring, kernel-janitors, Igal Liberman, Miquel Raynal; +Cc: LKML


On 26/09/19 9:50 PM, Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Thu, 26 Sep 2019 18:15:23 +0200
> 
> Simplify this function implementation by using a known wrapper function.
> 
> This issue was detected by using the Coccinelle software.
> 
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>

merged, thanks!

-Kishon

> ---
>  drivers/phy/marvell/phy-mvebu-a3700-utmi.c | 9 +--------
>  1 file changed, 1 insertion(+), 8 deletions(-)
> 
> diff --git a/drivers/phy/marvell/phy-mvebu-a3700-utmi.c b/drivers/phy/marvell/phy-mvebu-a3700-utmi.c
> index ded900b06f5a..23bc3bf5c4c0 100644
> --- a/drivers/phy/marvell/phy-mvebu-a3700-utmi.c
> +++ b/drivers/phy/marvell/phy-mvebu-a3700-utmi.c
> @@ -216,20 +216,13 @@ static int mvebu_a3700_utmi_phy_probe(struct platform_device *pdev)
>  	struct device *dev = &pdev->dev;
>  	struct mvebu_a3700_utmi *utmi;
>  	struct phy_provider *provider;
> -	struct resource *res;
> 
>  	utmi = devm_kzalloc(dev, sizeof(*utmi), GFP_KERNEL);
>  	if (!utmi)
>  		return -ENOMEM;
> 
>  	/* Get UTMI memory region */
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	if (!res) {
> -		dev_err(dev, "Missing UTMI PHY memory resource\n");
> -		return -ENODEV;
> -	}
> -
> -	utmi->regs = devm_ioremap_resource(dev, res);
> +	utmi->regs = devm_platform_ioremap_resource(pdev, 0);
>  	if (IS_ERR(utmi->regs))
>  		return PTR_ERR(utmi->regs);
> 
> --
> 2.23.0
> 

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

end of thread, other threads:[~2019-10-23  5:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-26 16:20 [PATCH] phy-mvebu-a3700-utmi: Use devm_platform_ioremap_resource() in mvebu_a3700_utmi_phy_probe() Markus Elfring
2019-10-23  5:25 ` Kishon Vijay Abraham I

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®