From: Rosen Penev <rosenp@gmail.com>
To: netdev@vger.kernel.org
Cc: Hans Ulli Kroll <ulli.kroll@googlemail.com>,
Linus Walleij <linusw@kernel.org>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
linux-arm-kernel@lists.infradead.org (moderated list:ARM/CORTINA
SYSTEMS GEMINI ARM ARCHITECTURE),
linux-kernel@vger.kernel.org (open list)
Subject: [PATCH net-next 1/2] net: ethernet: cortina: use devm to enable clocks
Date: Thu, 19 Feb 2026 18:19:48 -0800 [thread overview]
Message-ID: <20260220021949.40817-2-rosenp@gmail.com> (raw)
In-Reply-To: <20260220021949.40817-1-rosenp@gmail.com>
Avoid manually disabling them. devm can handle this.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
drivers/net/ethernet/cortina/gemini.c | 23 +++++------------------
1 file changed, 5 insertions(+), 18 deletions(-)
diff --git a/drivers/net/ethernet/cortina/gemini.c b/drivers/net/ethernet/cortina/gemini.c
index a55f4b82d1ba..8726e5ffbce7 100644
--- a/drivers/net/ethernet/cortina/gemini.c
+++ b/drivers/net/ethernet/cortina/gemini.c
@@ -2348,7 +2348,6 @@ static void gemini_port_remove(struct gemini_ethernet_port *port)
phy_disconnect(port->netdev->phydev);
unregister_netdev(port->netdev);
}
- clk_disable_unprepare(port->pclk);
geth_cleanup_freeq(port->geth);
}
@@ -2475,14 +2474,11 @@ static int gemini_ethernet_port_probe(struct platform_device *pdev)
port->irq = irq;
/* Clock the port */
- port->pclk = devm_clk_get(dev, "PCLK");
+ port->pclk = devm_clk_get_enabled(dev, "PCLK");
if (IS_ERR(port->pclk)) {
dev_err(dev, "no PCLK\n");
return PTR_ERR(port->pclk);
}
- ret = clk_prepare_enable(port->pclk);
- if (ret)
- return ret;
/* Maybe there is a nice ethernet address we should use */
gemini_port_save_mac_addr(port);
@@ -2491,8 +2487,7 @@ static int gemini_ethernet_port_probe(struct platform_device *pdev)
port->reset = devm_reset_control_get_exclusive(dev, NULL);
if (IS_ERR(port->reset)) {
dev_err(dev, "no reset\n");
- ret = PTR_ERR(port->reset);
- goto unprepare;
+ return PTR_ERR(port->reset);
}
reset_control_reset(port->reset);
usleep_range(100, 500);
@@ -2554,24 +2549,16 @@ static int gemini_ethernet_port_probe(struct platform_device *pdev)
port_names[port->id],
port);
if (ret)
- goto unprepare;
+ return ret;
ret = gmac_setup_phy(netdev);
if (ret) {
netdev_err(netdev,
"PHY init failed\n");
- goto unprepare;
+ return ret;
}
- ret = register_netdev(netdev);
- if (ret)
- goto unprepare;
-
- return 0;
-
-unprepare:
- clk_disable_unprepare(port->pclk);
- return ret;
+ return register_netdev(netdev);
}
static void gemini_ethernet_port_remove(struct platform_device *pdev)
--
2.53.0
next prev parent reply other threads:[~2026-02-20 2:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-20 2:19 [PATCH net-next 0/2] net: ethernet: cortina: support deferral Rosen Penev
2026-02-20 2:19 ` Rosen Penev [this message]
2026-02-20 2:19 ` [PATCH net-next 2/2] net: ethernet: cortina: fix nvmem mac addresses Rosen Penev
2026-02-20 8:40 ` [PATCH net-next 0/2] net: ethernet: cortina: support deferral Linus Walleij
2026-02-20 13:04 ` Andrew Lunn
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=20260220021949.40817-2-rosenp@gmail.com \
--to=rosenp@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linusw@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=ulli.kroll@googlemail.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