diff options
author | Mark Brown <broonie@kernel.org> | 2016-01-05 18:06:29 +0000 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-01-05 18:06:29 +0000 |
commit | ee1e4e3f0d50aebdc6dac2a2cd4ae203ed2a75c1 (patch) | |
tree | 3ae1d5d33402f3459a65fe492c97d75c168bb04c /drivers/phy/phy-miphy28lp.c | |
parent | 55fc205600ff3b529631cfe03b58645e3844bd92 (diff) | |
parent | d8018361b58bb7b9a2a657104e54c33c2ef1439d (diff) | |
download | linux-next-ee1e4e3f0d50aebdc6dac2a2cd4ae203ed2a75c1.tar.gz |
Merge branch 'fix/intel' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-intel
Diffstat (limited to 'drivers/phy/phy-miphy28lp.c')
-rw-r--r-- | drivers/phy/phy-miphy28lp.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/phy/phy-miphy28lp.c b/drivers/phy/phy-miphy28lp.c index c47b56b4a2b8..3acd2a1808df 100644 --- a/drivers/phy/phy-miphy28lp.c +++ b/drivers/phy/phy-miphy28lp.c @@ -1226,15 +1226,18 @@ static int miphy28lp_probe(struct platform_device *pdev) miphy_phy = devm_kzalloc(&pdev->dev, sizeof(*miphy_phy), GFP_KERNEL); - if (!miphy_phy) - return -ENOMEM; + if (!miphy_phy) { + ret = -ENOMEM; + goto put_child; + } miphy_dev->phys[port] = miphy_phy; phy = devm_phy_create(&pdev->dev, child, &miphy28lp_ops); if (IS_ERR(phy)) { dev_err(&pdev->dev, "failed to create PHY\n"); - return PTR_ERR(phy); + ret = PTR_ERR(phy); + goto put_child; } miphy_dev->phys[port]->phy = phy; @@ -1242,11 +1245,11 @@ static int miphy28lp_probe(struct platform_device *pdev) ret = miphy28lp_of_probe(child, miphy_phy); if (ret) - return ret; + goto put_child; ret = miphy28lp_probe_resets(child, miphy_dev->phys[port]); if (ret) - return ret; + goto put_child; phy_set_drvdata(phy, miphy_dev->phys[port]); port++; @@ -1255,6 +1258,9 @@ static int miphy28lp_probe(struct platform_device *pdev) provider = devm_of_phy_provider_register(&pdev->dev, miphy28lp_xlate); return PTR_ERR_OR_ZERO(provider); +put_child: + of_node_put(child); + return ret; } static const struct of_device_id miphy28lp_of_match[] = { |