From patchwork Thu Aug 2 00:53:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arun Parameswaran X-Patchwork-Id: 10553165 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4A042174A for ; Thu, 2 Aug 2018 00:55:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 399FA2B11A for ; Thu, 2 Aug 2018 00:55:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2CB4C2B295; Thu, 2 Aug 2018 00:55:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D28342B11A for ; Thu, 2 Aug 2018 00:55:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=o+332X5vl6XB368TdQnxKeDg6lKO5bxEArdVz7PMABc=; b=MZ8e1HH4eFyGcwKY1rvTRoFdWc TzIev6swSfeK8sKL3s3p90V3sqelI6S9SsEjdcIzHYsUQ9f0hXGQ9AcOaAb6NqXANlfQaCtqmeuQ1 SSEew6waba6jLlIx7fxbdQH1eXe4deinbe0rNdN3yfzKBzCuhn2UzX012ZK4TFpLN1r3Nyo6+O1qr CUmBm3P4xGjC8kj0G3ezmCYA4t/nArwRmgXgUipgIm3a8DGyiYuIOq3672Nleby70xnUhLhNbaC94 8jsB1oHmlUwMZfaavfOBeptefMUDTa1v4V1BDmdkLyfa5b4HAjVAxAlv2eQ5vF+X9k7RMIgPZ3MZF gDZKRFgw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fl1tK-00060Y-GF; Thu, 02 Aug 2018 00:54:58 +0000 Received: from mail-qt0-x241.google.com ([2607:f8b0:400d:c0d::241]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fl1sT-0004Sz-AN for linux-arm-kernel@lists.infradead.org; Thu, 02 Aug 2018 00:54:12 +0000 Received: by mail-qt0-x241.google.com with SMTP id y19-v6so541870qto.5 for ; Wed, 01 Aug 2018 17:53:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=27NQGqCuJeCZzYDzyqMtf4gclMxWU9BJMx0JatVN93M=; b=E1ZGKzuyLwXdkbCF9PRa0754sL7wKat2ynufKI/WLe7BeVS3f4I2UCPplLXPcGlixU Tjg8acoB/22G94yG+zLvExTV5xi3osjReQxPc9f1WkEqcICklkfMvv3xRQV15P0gHgwd PbwvZsoV3+yxQtuBNwcd+Z9iStj5V0soXW1DI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=27NQGqCuJeCZzYDzyqMtf4gclMxWU9BJMx0JatVN93M=; b=Cw+2j/gkM5vNS61wZLCl4+Zb4Hg6fznXaVL49JADxfeNuxA3B8Vu3J5oEKHNCj7LS+ VlXXG4Hf06qyRlLW26T//IO/1vGiTW2bVwCoBboqInfPGkUw0PWamwKa0sBwJO/zpvwj XSyZSYjPWChqFx4LKxbZk/lm9ksyLe8F3f9y29TkP12EV0JdMpeRX+c9xKZmJ4HzZVdU x5k1z+LA9vuS8crhTXLqkB7yZSR8alv8YPYNPKha+SBaZxeUz484zn5OxjqZZ3xVh2aw h1O7yGuQvrcMKTMiiZe3GGubuq3w7apPpFuz7eUR+xnacz0hpTi/u9uxgNgcw6vSK/Nw FgXQ== X-Gm-Message-State: AOUpUlEZiJRWpYp+J8S39D1b83j4SPC82+mwDXAKKmBiJwpqzhGHRNgU KLKQ14DFwJGV20loiiUYUuKzcw== X-Google-Smtp-Source: AAOMgpdpPS1QTP6WNym13vW/yroJQNS6bssvnZXJ22Xt9X1gpC00mIqKaXamtrtPK/HpGs0mlgeIGA== X-Received: by 2002:a0c:d21d:: with SMTP id m29-v6mr650053qvh.86.1533171234515; Wed, 01 Aug 2018 17:53:54 -0700 (PDT) Received: from lbrmn-lnxub86.ric.broadcom.com ([192.19.228.250]) by smtp.gmail.com with ESMTPSA id e81-v6sm325116qka.3.2018.08.01.17.53.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 01 Aug 2018 17:53:53 -0700 (PDT) From: Arun Parameswaran To: "David S. Miller" , Florian Fainelli , Andrew Lunn , Rob Herring , Mark Rutland , Ray Jui , Scott Branden , Catalin Marinas , Will Deacon 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 Message-Id: <1533171233-14557-6-git-send-email-arun.parameswaran@broadcom.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1533171233-14557-1-git-send-email-arun.parameswaran@broadcom.com> References: <1533171233-14557-1-git-send-email-arun.parameswaran@broadcom.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180801_175406_028963_C2E2C220 X-CRM114-Status: GOOD ( 16.62 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, netdev@vger.kernel.org, Arun Parameswaran , linux-kernel@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Use devm_mdiobus_alloc() instead of mdiobus_alloc() in the Broadcom iProc mdio mux driver. Signed-off-by: Arun Parameswaran Reviewed-by: Florian Fainelli --- 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; }