From: Sergey Shtylyov <s.shtylyov@omp.ru>
To: Rosen Penev <rosenp@gmail.com>, <netdev@vger.kernel.org>
Cc: "Kurt Kanzenbach" <kurt@linutronix.de>,
"Andrew Lunn" <andrew@lunn.ch>,
"Vladimir Oltean" <olteanv@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"Chris Snook" <chris.snook@gmail.com>,
"Marcin Wojtas" <marcin.s.wojtas@gmail.com>,
"Russell King" <linux@armlinux.org.uk>,
"Yoshihiro Shimoda" <yoshihiro.shimoda.uh@renesas.com>,
"Niklas Söderlund" <niklas.soderlund@ragnatech.se>,
"Heiner Kallweit" <hkallweit1@gmail.com>,
"Richard Cochran" <richardcochran@gmail.com>,
"open list" <linux-kernel@vger.kernel.org>,
"open list:RENESAS ETHERNET SWITCH DRIVER"
<linux-renesas-soc@vger.kernel.org>
Subject: Re: [PATCHv3 net-next] net: modernize ioremap in probe
Date: Tue, 19 Nov 2024 23:02:33 +0300 [thread overview]
Message-ID: <26a1dd4d-80b1-411a-abb5-92e20f5751e7@omp.ru> (raw)
In-Reply-To: <20241117212711.13612-1-rosenp@gmail.com>
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@gmail.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...
[...]
Other than that, looks saner now... :-)
MBR, Sergey
next prev parent reply other threads:[~2024-11-19 20:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-17 21:27 Rosen Penev
2024-11-17 22:38 ` Niklas Söderlund
2024-11-17 23:07 ` Rosen Penev
2024-11-19 20:39 ` Niklas Söderlund
2024-11-19 23:40 ` Russell King (Oracle)
2024-11-19 20:02 ` Sergey Shtylyov [this message]
2024-11-20 19:29 ` Rosen Penev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=26a1dd4d-80b1-411a-abb5-92e20f5751e7@omp.ru \
--to=s.shtylyov@omp.ru \
--cc=andrew@lunn.ch \
--cc=chris.snook@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=kurt@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=marcin.s.wojtas@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=niklas.soderlund@ragnatech.se \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--cc=richardcochran@gmail.com \
--cc=rosenp@gmail.com \
--cc=yoshihiro.shimoda.uh@renesas.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®