From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id CFF4B1BF32C for ; Wed, 17 Apr 2019 09:53:02 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id C9CDB86D96 for ; Wed, 17 Apr 2019 09:53:02 +0000 (UTC) Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id a3Sbn2o3UNwv for ; Wed, 17 Apr 2019 09:53:02 +0000 (UTC) Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by whitealder.osuosl.org (Postfix) with ESMTPS id D266B86C37 for ; Wed, 17 Apr 2019 09:53:01 +0000 (UTC) Received: by mail-wm1-f68.google.com with SMTP id h18so2793327wml.1 for ; Wed, 17 Apr 2019 02:53:01 -0700 (PDT) From: Sergio Paracuellos Subject: [PATCH 2/3] staging: mt7621-pci-phy: remove some unnecessary local variables Date: Wed, 17 Apr 2019 11:52:55 +0200 Message-Id: <20190417095256.6146-3-sergio.paracuellos@gmail.com> In-Reply-To: <20190417095256.6146-1-sergio.paracuellos@gmail.com> References: <20190417095256.6146-1-sergio.paracuellos@gmail.com> MIME-Version: 1.0 List-Id: Linux Driver Project Developer List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" To: gregkh@linuxfoundation.org Cc: neil@brown.name, driverdev-devel@linuxdriverproject.org Device tree is not using child nodes anymore so the 'child_np' variable can safely removed. This also simplifies the error path to be able to directly return errors removing also the 'ret' variable. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pci-phy/pci-mt7621-phy.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/drivers/staging/mt7621-pci-phy/pci-mt7621-phy.c b/drivers/staging/mt7621-pci-phy/pci-mt7621-phy.c index bac188f00f4e..21f980cc2d8f 100644 --- a/drivers/staging/mt7621-pci-phy/pci-mt7621-phy.c +++ b/drivers/staging/mt7621-pci-phy/pci-mt7621-phy.c @@ -308,11 +308,10 @@ static struct phy *mt7621_pcie_phy_of_xlate(struct device *dev, static int mt7621_pci_phy_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; - struct device_node *child_np; struct phy_provider *provider; struct mt7621_pci_phy *phy; struct resource *res; - int port, ret; + int port; void __iomem *port_base; phy = devm_kzalloc(dev, sizeof(*phy), GFP_KERNEL); @@ -345,18 +344,15 @@ static int mt7621_pci_phy_probe(struct platform_device *pdev) struct phy *pphy; instance = devm_kzalloc(dev, sizeof(*instance), GFP_KERNEL); - if (!instance) { - ret = -ENOMEM; - goto put_child; - } + if (!instance) + return -ENOMEM; phy->phys[port] = instance; pphy = devm_phy_create(dev, dev->of_node, &mt7621_pci_phy_ops); if (IS_ERR(phy)) { dev_err(dev, "failed to create phy\n"); - ret = PTR_ERR(phy); - goto put_child; + return PTR_ERR(phy); } instance->port_base = port_base; @@ -368,10 +364,6 @@ static int mt7621_pci_phy_probe(struct platform_device *pdev) provider = devm_of_phy_provider_register(dev, mt7621_pcie_phy_of_xlate); return PTR_ERR_OR_ZERO(provider); - -put_child: - of_node_put(child_np); - return ret; } static const struct of_device_id mt7621_pci_phy_ids[] = { -- 2.19.1 _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel