diff options
author | Axel Lin <axel.lin@ingics.com> | 2015-03-04 20:33:38 -0500 |
---|---|---|
committer | Kishon Vijay Abraham I <kishon@ti.com> | 2015-03-10 04:42:27 -0400 |
commit | 8fd0ea395f96b1419083f850190f175d5ddd98e9 (patch) | |
tree | 997c0bf72a84e43d7cfd161e8738ec6ba1b0aaf7 /drivers/phy | |
parent | 82ffb676c820629b7f1b62d15f6bc546f29a7025 (diff) |
phy: xgene: Use PTR_ERR_OR_ZERO
Also remove unneeded goto and rc variable.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Diffstat (limited to 'drivers/phy')
-rw-r--r-- | drivers/phy/phy-xgene.c | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/drivers/phy/phy-xgene.c b/drivers/phy/phy-xgene.c index 29214a36ea28..bae9cccc08f0 100644 --- a/drivers/phy/phy-xgene.c +++ b/drivers/phy/phy-xgene.c | |||
@@ -1657,7 +1657,6 @@ static int xgene_phy_probe(struct platform_device *pdev) | |||
1657 | struct phy_provider *phy_provider; | 1657 | struct phy_provider *phy_provider; |
1658 | struct xgene_phy_ctx *ctx; | 1658 | struct xgene_phy_ctx *ctx; |
1659 | struct resource *res; | 1659 | struct resource *res; |
1660 | int rc = 0; | ||
1661 | u32 default_spd[] = DEFAULT_SATA_SPD_SEL; | 1660 | u32 default_spd[] = DEFAULT_SATA_SPD_SEL; |
1662 | u32 default_txboost_gain[] = DEFAULT_SATA_TXBOOST_GAIN; | 1661 | u32 default_txboost_gain[] = DEFAULT_SATA_TXBOOST_GAIN; |
1663 | u32 default_txeye_direction[] = DEFAULT_SATA_TXEYEDIRECTION; | 1662 | u32 default_txeye_direction[] = DEFAULT_SATA_TXEYEDIRECTION; |
@@ -1676,10 +1675,8 @@ static int xgene_phy_probe(struct platform_device *pdev) | |||
1676 | 1675 | ||
1677 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 1676 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
1678 | ctx->sds_base = devm_ioremap_resource(&pdev->dev, res); | 1677 | ctx->sds_base = devm_ioremap_resource(&pdev->dev, res); |
1679 | if (IS_ERR(ctx->sds_base)) { | 1678 | if (IS_ERR(ctx->sds_base)) |
1680 | rc = PTR_ERR(ctx->sds_base); | 1679 | return PTR_ERR(ctx->sds_base); |
1681 | goto error; | ||
1682 | } | ||
1683 | 1680 | ||
1684 | /* Retrieve optional clock */ | 1681 | /* Retrieve optional clock */ |
1685 | ctx->clk = clk_get(&pdev->dev, NULL); | 1682 | ctx->clk = clk_get(&pdev->dev, NULL); |
@@ -1710,22 +1707,12 @@ static int xgene_phy_probe(struct platform_device *pdev) | |||
1710 | ctx->phy = devm_phy_create(ctx->dev, NULL, &xgene_phy_ops); | 1707 | ctx->phy = devm_phy_create(ctx->dev, NULL, &xgene_phy_ops); |
1711 | if (IS_ERR(ctx->phy)) { | 1708 | if (IS_ERR(ctx->phy)) { |
1712 | dev_dbg(&pdev->dev, "Failed to create PHY\n"); | 1709 | dev_dbg(&pdev->dev, "Failed to create PHY\n"); |
1713 | rc = PTR_ERR(ctx->phy); | 1710 | return PTR_ERR(ctx->phy); |
1714 | goto error; | ||
1715 | } | 1711 | } |
1716 | phy_set_drvdata(ctx->phy, ctx); | 1712 | phy_set_drvdata(ctx->phy, ctx); |
1717 | 1713 | ||
1718 | phy_provider = devm_of_phy_provider_register(ctx->dev, | 1714 | phy_provider = devm_of_phy_provider_register(ctx->dev, xgene_phy_xlate); |
1719 | xgene_phy_xlate); | 1715 | return PTR_ERR_OR_ZERO(phy_provider); |
1720 | if (IS_ERR(phy_provider)) { | ||
1721 | rc = PTR_ERR(phy_provider); | ||
1722 | goto error; | ||
1723 | } | ||
1724 | |||
1725 | return 0; | ||
1726 | |||
1727 | error: | ||
1728 | return rc; | ||
1729 | } | 1716 | } |
1730 | 1717 | ||
1731 | static const struct of_device_id xgene_phy_of_match[] = { | 1718 | static const struct of_device_id xgene_phy_of_match[] = { |