devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arun Parameswaran <arun.parameswaran@broadcom.com>
To: "David S. Miller" <davem@davemloft.net>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Andrew Lunn <andrew@lunn.ch>, Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>, Ray Jui <rjui@broadcom.com>,
	Scott Branden <sbranden@broadcom.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will.deacon@arm.com>
Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	bcm-kernel-feedback-list@broadcom.com,
	Arun Parameswaran <arun.parameswaran@broadcom.com>
Subject: [PATCH v4 5/8] net: phy: Use devm api for mdio bus allocation in bcm iproc mdio mux
Date: Wed,  1 Aug 2018 17:53:50 -0700	[thread overview]
Message-ID: <1533171233-14557-6-git-send-email-arun.parameswaran@broadcom.com> (raw)
In-Reply-To: <1533171233-14557-1-git-send-email-arun.parameswaran@broadcom.com>

Use devm_mdiobus_alloc() instead of mdiobus_alloc() in the Broadcom
iProc mdio mux driver.

Signed-off-by: Arun Parameswaran <arun.parameswaran@broadcom.com>
---
 drivers/net/phy/mdio-mux-bcm-iproc.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/net/phy/mdio-mux-bcm-iproc.c b/drivers/net/phy/mdio-mux-bcm-iproc.c
index c36ce4b..3ba9616 100644
--- a/drivers/net/phy/mdio-mux-bcm-iproc.c
+++ b/drivers/net/phy/mdio-mux-bcm-iproc.c
@@ -198,7 +198,7 @@ static int mdio_mux_iproc_probe(struct platform_device *pdev)
 		return PTR_ERR(md->base);
 	}
 
-	md->mii_bus = mdiobus_alloc();
+	md->mii_bus = devm_mdiobus_alloc(&pdev->dev);
 	if (!md->mii_bus) {
 		dev_err(&pdev->dev, "mdiomux bus alloc failed\n");
 		return -ENOMEM;
@@ -217,7 +217,7 @@ static int mdio_mux_iproc_probe(struct platform_device *pdev)
 	rc = mdiobus_register(bus);
 	if (rc) {
 		dev_err(&pdev->dev, "mdiomux registration failed\n");
-		goto out;
+		return rc;
 	}
 
 	platform_set_drvdata(pdev, md);
@@ -236,8 +236,6 @@ static int mdio_mux_iproc_probe(struct platform_device *pdev)
 
 out_register:
 	mdiobus_unregister(bus);
-out:
-	mdiobus_free(bus);
 	return rc;
 }
 
@@ -247,7 +245,6 @@ static int mdio_mux_iproc_remove(struct platform_device *pdev)
 
 	mdio_mux_uninit(md->mux_handle);
 	mdiobus_unregister(md->mii_bus);
-	mdiobus_free(md->mii_bus);
 
 	return 0;
 }
-- 
1.9.1

  parent reply	other threads:[~2018-08-02  0:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-02  0:53 [PATCH v4 0/8] Add clock config and pm support to bcm iProc mdio mux Arun Parameswaran
2018-08-02  0:53 ` [PATCH v4 1/8] dt-bindings: net: Fix Broadcom iProc mdio mux driver base address Arun Parameswaran
2018-08-02  0:53 ` [PATCH v4 2/8] net: phy: Fix the register offsets in Broadcom iProc mdio mux driver Arun Parameswaran
2018-08-02  0:53 ` [PATCH v4 3/8] arm64: dts: Fix the base address of the Broadcom iProc mdio mux Arun Parameswaran
2018-08-02  0:53 ` [PATCH v4 4/8] net: phy: Disable external master access in bcm mdio mux driver Arun Parameswaran
2018-08-02  0:53 ` Arun Parameswaran [this message]
2018-08-02  1:39   ` [PATCH v4 5/8] net: phy: Use devm api for mdio bus allocation in bcm iproc mdio mux Florian Fainelli
2018-08-02  0:53 ` [PATCH v4 6/8] dt-bindings: net: Add clock handle to Broadcom iProc " Arun Parameswaran
2018-08-02  0:53 ` [PATCH v4 7/8] net: phy: Add support to configure clock in " Arun Parameswaran
2018-08-02  1:40   ` Florian Fainelli
2018-08-02  0:53 ` [PATCH v4 8/8] net: phy: Add pm support to Broadcom iProc mdio mux driver Arun Parameswaran
2018-08-02  1:40 ` [PATCH v4 0/8] Add clock config and pm support to bcm iProc mdio mux Florian Fainelli
2018-08-02 21:39 ` David Miller

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=1533171233-14557-6-git-send-email-arun.parameswaran@broadcom.com \
    --to=arun.parameswaran@broadcom.com \
    --cc=andrew@lunn.ch \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=catalin.marinas@arm.com \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=f.fainelli@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=netdev@vger.kernel.org \
    --cc=rjui@broadcom.com \
    --cc=robh+dt@kernel.org \
    --cc=sbranden@broadcom.com \
    --cc=will.deacon@arm.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;
as well as URLs for NNTP newsgroup(s).