[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6a8ffcab-4534-1692-5f6a-8a7906d07a09@gmail.com>
Date: Mon, 20 Sep 2021 14:56:44 -0700
From: Florian Fainelli <f.fainelli@...il.com>
To: Wolfram Sang <wsa+renesas@...g-engineering.com>,
linux-kernel@...r.kernel.org
Cc: linux-renesas-soc@...r.kernel.org, Andrew Lunn <andrew@...n.ch>,
Heiner Kallweit <hkallweit1@...il.com>,
Russell King <linux@...linux.org.uk>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>, Ray Jui <rjui@...adcom.com>,
Scott Branden <sbranden@...adcom.com>,
bcm-kernel-feedback-list@...adcom.com, netdev@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH 7/9] net: mdio: mdio-bcm-iproc: simplify getting
.driver_data
On 9/20/21 2:05 AM, Wolfram Sang wrote:
> We should get 'driver_data' from 'struct device' directly. Going via
> platform_device is an unneeded step back and forth.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@...g-engineering.com>
> ---
>
> Build tested only. buildbot is happy.
>
> drivers/net/mdio/mdio-bcm-iproc.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/net/mdio/mdio-bcm-iproc.c b/drivers/net/mdio/mdio-bcm-iproc.c
> index 77fc970cdfde..5666cfab15b9 100644
> --- a/drivers/net/mdio/mdio-bcm-iproc.c
> +++ b/drivers/net/mdio/mdio-bcm-iproc.c
> @@ -181,8 +181,7 @@ static int iproc_mdio_remove(struct platform_device *pdev)
> #ifdef CONFIG_PM_SLEEP
> static int iproc_mdio_resume(struct device *dev)
> {
> - struct platform_device *pdev = to_platform_device(dev);
> - struct iproc_mdio_priv *priv = platform_get_drvdata(pdev);
> + struct iproc_mdio_priv *priv = dev_get_drvdata(dev);
The change looks good to me, however if you change from
platform_get_drvdata() to dev_get_drvdata(), you might also want to
change from using platform_set_drvdata() to dev_set_drvdata() for
symmetry no? If not, then maybe this patch should be dropped?
--
Florian
Powered by blists - more mailing lists