From: Rosen Penev <rosenp@gmail.com>
To: netdev@vger.kernel.org
Cc: andrew@lunn.ch, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com, linux-kernel@vger.kernel.org,
olek2@wp.pl, shannon.nelson@amd.com
Subject: [PATCH net-next 7/9] net: lantiq_etop: remove struct resource
Date: Mon, 30 Sep 2024 13:24:32 -0700 [thread overview]
Message-ID: <20240930202434.296960-8-rosenp@gmail.com> (raw)
In-Reply-To: <20240930202434.296960-1-rosenp@gmail.com>
All of this can be simplified with devm_platformn_ioremap_resource. No
need for extra code.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
drivers/net/ethernet/lantiq_etop.c | 23 +++--------------------
1 file changed, 3 insertions(+), 20 deletions(-)
diff --git a/drivers/net/ethernet/lantiq_etop.c b/drivers/net/ethernet/lantiq_etop.c
index bc97b189785e..0cb5d536f351 100644
--- a/drivers/net/ethernet/lantiq_etop.c
+++ b/drivers/net/ethernet/lantiq_etop.c
@@ -90,7 +90,6 @@ struct ltq_etop_priv {
struct net_device *netdev;
struct platform_device *pdev;
struct ltq_eth_data *pldata;
- struct resource *res;
struct mii_bus *mii_bus;
@@ -620,28 +619,13 @@ ltq_etop_probe(struct platform_device *pdev)
{
struct net_device *dev;
struct ltq_etop_priv *priv;
- struct resource *res;
int err;
int i;
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!res) {
- dev_err(&pdev->dev, "failed to get etop resource");
- return -ENOENT;
- }
-
- res = devm_request_mem_region(&pdev->dev, res->start,
- resource_size(res), dev_name(&pdev->dev));
- if (!res) {
- dev_err(&pdev->dev, "failed to request etop resource");
- return -EBUSY;
- }
-
- ltq_etop_membase = devm_ioremap(&pdev->dev, res->start,
- resource_size(res));
- if (!ltq_etop_membase) {
+ ltq_etop_membase = devm_platformn_ioremap_resource(pdev, 0);
+ if (IS_ERR(ltq_etop_membase)) {
dev_err(&pdev->dev, "failed to remap etop engine %d", pdev->id);
- return -ENOMEM;
+ return PTR_ERR(ltq_etop_membase);
}
dev = devm_alloc_etherdev_mqs(&pdev->dev, sizeof(struct ltq_etop_priv),
@@ -651,7 +635,6 @@ ltq_etop_probe(struct platform_device *pdev)
dev->netdev_ops = <q_eth_netdev_ops;
dev->ethtool_ops = <q_etop_ethtool_ops;
priv = netdev_priv(dev);
- priv->res = res;
priv->pdev = pdev;
priv->pldata = dev_get_platdata(&pdev->dev);
priv->netdev = dev;
--
2.46.2
next prev parent reply other threads:[~2024-09-30 20:24 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-30 20:24 [PATCH net-next 0/9] net: lantiq_etop: some cleanups Rosen Penev
2024-09-30 20:24 ` [PATCH net-next 1/9] net: lantiq_etop: use netif_receive_skb_list Rosen Penev
2024-09-30 20:24 ` [PATCH net-next 2/9] net: lantiq_etop: use devm_alloc_etherdev_mqs Rosen Penev
2024-09-30 20:24 ` [PATCH net-next 3/9] net: lantiq_etop: use devm for register_netdev Rosen Penev
2024-09-30 20:24 ` [PATCH net-next 4/9] net: lantiq_etop: use devm for mdiobus Rosen Penev
2024-09-30 20:24 ` [PATCH net-next 5/9] net: lantiq_etop: move phy_disconnect to stop Rosen Penev
2024-09-30 20:24 ` [PATCH net-next 6/9] net: lantiq_etop: use devm_err_probe Rosen Penev
2024-09-30 20:24 ` Rosen Penev [this message]
2024-10-01 15:33 ` [PATCH net-next 7/9] net: lantiq_etop: remove struct resource Simon Horman
2024-09-30 20:24 ` [PATCH net-next 8/9] net: lantiq_etop: use module_platform_driver_probe Rosen Penev
2024-09-30 20:24 ` [PATCH net-next 9/9] net: lantiq_etop: no queue stop in remove Rosen Penev
2024-09-30 22:02 ` [PATCH net-next 0/9] net: lantiq_etop: some cleanups Nelson, Shannon
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=20240930202434.296960-8-rosenp@gmail.com \
--to=rosenp@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=olek2@wp.pl \
--cc=pabeni@redhat.com \
--cc=shannon.nelson@amd.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