lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241203221644.136104-3-rosenp@gmail.com>
Date: Tue,  3 Dec 2024 14:16:44 -0800
From: Rosen Penev <rosenp@...il.com>
To: netdev@...r.kernel.org
Cc: Andrew Lunn <andrew@...n.ch>,
	ansuelsmth@...il.com,
	Heiner Kallweit <hkallweit1@...il.com>,
	Russell King <linux@...linux.org.uk>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>,
	Paolo Abeni <pabeni@...hat.com>,
	linux-kernel@...r.kernel.org (open list)
Subject: [PATCH net-next 2/2] net: mdio-ipq8064: remove _remove function

Change of_mdiobus_register to devm_mdiobus_register as devm allows
removing the _remove function as well as slightly cleaning up the probe
function.

Regular mdiobus_register is fine here as the platform device's of_node
is used. Removes two variables from _probe.

Signed-off-by: Rosen Penev <rosenp@...il.com>
---
 drivers/net/mdio/mdio-ipq8064.c | 17 +----------------
 1 file changed, 1 insertion(+), 16 deletions(-)

diff --git a/drivers/net/mdio/mdio-ipq8064.c b/drivers/net/mdio/mdio-ipq8064.c
index e3d311ce3810..9f13e16edb17 100644
--- a/drivers/net/mdio/mdio-ipq8064.c
+++ b/drivers/net/mdio/mdio-ipq8064.c
@@ -109,12 +109,10 @@ static const struct regmap_config ipq8064_mdio_regmap_config = {
 static int
 ipq8064_mdio_probe(struct platform_device *pdev)
 {
-	struct device_node *np = pdev->dev.of_node;
 	struct ipq8064_mdio *priv;
 	struct resource *res;
 	struct mii_bus *bus;
 	void __iomem *base;
-	int ret;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (!res)
@@ -140,19 +138,7 @@ ipq8064_mdio_probe(struct platform_device *pdev)
 	if (IS_ERR(priv->base))
 		return PTR_ERR(priv->base);
 
-	ret = of_mdiobus_register(bus, np);
-	if (ret)
-		return ret;
-
-	platform_set_drvdata(pdev, bus);
-	return 0;
-}
-
-static void ipq8064_mdio_remove(struct platform_device *pdev)
-{
-	struct mii_bus *bus = platform_get_drvdata(pdev);
-
-	mdiobus_unregister(bus);
+	return devm_mdiobus_register(&pdev->dev, bus);
 }
 
 static const struct of_device_id ipq8064_mdio_dt_ids[] = {
@@ -163,7 +149,6 @@ MODULE_DEVICE_TABLE(of, ipq8064_mdio_dt_ids);
 
 static struct platform_driver ipq8064_mdio_driver = {
 	.probe = ipq8064_mdio_probe,
-	.remove = ipq8064_mdio_remove,
 	.driver = {
 		.name = "ipq8064-mdio",
 		.of_match_table = ipq8064_mdio_dt_ids,
-- 
2.47.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ