[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAKxU2N8NCGJqXAkHO0TiuPUa44TLMHUm--WP2r3WJhuHWPk9Mw@mail.gmail.com>
Date: Wed, 20 Nov 2024 11:29:04 -0800
From: Rosen Penev <rosenp@...il.com>
To: Sergey Shtylyov <s.shtylyov@....ru>
Cc: netdev@...r.kernel.org, Kurt Kanzenbach <kurt@...utronix.de>,
Andrew Lunn <andrew@...n.ch>, Vladimir Oltean <olteanv@...il.com>,
"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, Chris Snook <chris.snook@...il.com>,
Marcin Wojtas <marcin.s.wojtas@...il.com>, Russell King <linux@...linux.org.uk>,
Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>,
Niklas Söderlund <niklas.soderlund@...natech.se>,
Heiner Kallweit <hkallweit1@...il.com>, Richard Cochran <richardcochran@...il.com>,
open list <linux-kernel@...r.kernel.org>,
"open list:RENESAS ETHERNET SWITCH DRIVER" <linux-renesas-soc@...r.kernel.org>
Subject: Re: [PATCHv3 net-next] net: modernize ioremap in probe
On Tue, Nov 19, 2024 at 12:02 PM Sergey Shtylyov <s.shtylyov@....ru> wrote:
>
> On 11/18/24 12:27 AM, Rosen Penev wrote:
>
> > Convert platform_get_resource_bynam + devm_ioremap_resource to
> > devm_platform_ioremap_resource_byname.
> >
> > Convert platform_get_resource + devm_ioremap_resource to
> > devm_platform_ioremap_resource.
> >
> > resource aquisition and ioremap can be performed in one step.
> >
> > Signed-off-by: Rosen Penev <rosenp@...il.com>
> > ---
> > v3: reworded commit message again. Also removed devm_ioremap
> > conversions. Even though they use normal resource, they are not
> > the same.
> > v2: fixed compilation errors on PPC and reworded commit message
> > drivers/net/dsa/hirschmann/hellcreek.c | 18 +++---------------
> > drivers/net/ethernet/atheros/ag71xx.c | 13 +++++--------
> > drivers/net/ethernet/broadcom/bcm63xx_enet.c | 6 ++----
> > .../net/ethernet/marvell/mvpp2/mvpp2_main.c | 14 +++++---------
> > drivers/net/ethernet/renesas/rswitch.c | 9 +--------
> > drivers/net/ethernet/renesas/rtsn.c | 10 ++--------
> > drivers/net/mdio/mdio-ipq4019.c | 5 +----
> > 7 files changed, 19 insertions(+), 56 deletions(-)
> >
> > diff --git a/drivers/net/dsa/hirschmann/hellcreek.c b/drivers/net/dsa/hirschmann/hellcreek.c
> > index 283ec5a6e23c..940c4fa6a924 100644
> > --- a/drivers/net/dsa/hirschmann/hellcreek.c
> > +++ b/drivers/net/dsa/hirschmann/hellcreek.c
> [...]
> > @@ -1982,23 +1981,12 @@ static int hellcreek_probe(struct platform_device *pdev)
> >
> > hellcreek->dev = dev;
> >
> > - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "tsn");
> > - if (!res) {
> > - dev_err(dev, "No memory region provided!\n");
> > - return -ENODEV;
> > - }
> > -
> > - hellcreek->base = devm_ioremap_resource(dev, res);
> > + hellcreek->base = devm_platform_ioremap_resource_byname(pdev, "tsn");
> > if (IS_ERR(hellcreek->base))
> > return PTR_ERR(hellcreek->base);
> >
> > - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ptp");
> > - if (!res) {
> > - dev_err(dev, "No PTP memory region provided!\n");
> > - return -ENODEV;
> > - }
> > -
> > - hellcreek->ptp_base = devm_ioremap_resource(dev, res);
> > + hellcreek->ptp_base =
> > + devm_platform_ioremap_resource_byname(pdev, "ptp");
>
> You have full 100 columns now, so doing this with 2 lines doesn't seem necessary --
> checkpatch.pl shouldn't complain...
Looks like that's bdc48fa11e46f according to git blame. Reading the
commit message, 80 is still prefered. The reason it's done here is
because of .clang-format, which still lists 80.
>
> [...]
>
> Other than that, looks saner now... :-)
>
> MBR, Sergey
>
Powered by blists - more mailing lists