Commit d43f53c6 authored by Sergio Paracuellos's avatar Sergio Paracuellos Committed by Greg Kroah-Hartman

staging: mt7621-pci-phy: remove some unnecessary local variables

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: default avatarSergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent fc1e669a
...@@ -308,11 +308,10 @@ static struct phy *mt7621_pcie_phy_of_xlate(struct device *dev, ...@@ -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) static int mt7621_pci_phy_probe(struct platform_device *pdev)
{ {
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct device_node *child_np;
struct phy_provider *provider; struct phy_provider *provider;
struct mt7621_pci_phy *phy; struct mt7621_pci_phy *phy;
struct resource *res; struct resource *res;
int port, ret; int port;
void __iomem *port_base; void __iomem *port_base;
phy = devm_kzalloc(dev, sizeof(*phy), GFP_KERNEL); phy = devm_kzalloc(dev, sizeof(*phy), GFP_KERNEL);
...@@ -345,18 +344,15 @@ static int mt7621_pci_phy_probe(struct platform_device *pdev) ...@@ -345,18 +344,15 @@ static int mt7621_pci_phy_probe(struct platform_device *pdev)
struct phy *pphy; struct phy *pphy;
instance = devm_kzalloc(dev, sizeof(*instance), GFP_KERNEL); instance = devm_kzalloc(dev, sizeof(*instance), GFP_KERNEL);
if (!instance) { if (!instance)
ret = -ENOMEM; return -ENOMEM;
goto put_child;
}
phy->phys[port] = instance; phy->phys[port] = instance;
pphy = devm_phy_create(dev, dev->of_node, &mt7621_pci_phy_ops); pphy = devm_phy_create(dev, dev->of_node, &mt7621_pci_phy_ops);
if (IS_ERR(phy)) { if (IS_ERR(phy)) {
dev_err(dev, "failed to create phy\n"); dev_err(dev, "failed to create phy\n");
ret = PTR_ERR(phy); return PTR_ERR(phy);
goto put_child;
} }
instance->port_base = port_base; instance->port_base = port_base;
...@@ -368,10 +364,6 @@ static int mt7621_pci_phy_probe(struct platform_device *pdev) ...@@ -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); provider = devm_of_phy_provider_register(dev, mt7621_pcie_phy_of_xlate);
return PTR_ERR_OR_ZERO(provider); 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[] = { static const struct of_device_id mt7621_pci_phy_ids[] = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment