Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Axel Lin and committed by
Kishon Vijay Abraham I
8fd0ea39 82ffb676

+5 -18
+5 -18
drivers/phy/phy-xgene.c
··· 1657 1657 struct phy_provider *phy_provider; 1658 1658 struct xgene_phy_ctx *ctx; 1659 1659 struct resource *res; 1660 - int rc = 0; 1661 1660 u32 default_spd[] = DEFAULT_SATA_SPD_SEL; 1662 1661 u32 default_txboost_gain[] = DEFAULT_SATA_TXBOOST_GAIN; 1663 1662 u32 default_txeye_direction[] = DEFAULT_SATA_TXEYEDIRECTION; ··· 1675 1676 1676 1677 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1677 1678 ctx->sds_base = devm_ioremap_resource(&pdev->dev, res); 1678 - if (IS_ERR(ctx->sds_base)) { 1679 - rc = PTR_ERR(ctx->sds_base); 1680 - goto error; 1681 - } 1679 + if (IS_ERR(ctx->sds_base)) 1680 + return PTR_ERR(ctx->sds_base); 1682 1681 1683 1682 /* Retrieve optional clock */ 1684 1683 ctx->clk = clk_get(&pdev->dev, NULL); ··· 1707 1710 ctx->phy = devm_phy_create(ctx->dev, NULL, &xgene_phy_ops); 1708 1711 if (IS_ERR(ctx->phy)) { 1709 1712 dev_dbg(&pdev->dev, "Failed to create PHY\n"); 1710 - rc = PTR_ERR(ctx->phy); 1711 - goto error; 1713 + return PTR_ERR(ctx->phy); 1712 1714 } 1713 1715 phy_set_drvdata(ctx->phy, ctx); 1714 1716 1715 - phy_provider = devm_of_phy_provider_register(ctx->dev, 1716 - xgene_phy_xlate); 1717 - if (IS_ERR(phy_provider)) { 1718 - rc = PTR_ERR(phy_provider); 1719 - goto error; 1720 - } 1721 - 1722 - return 0; 1723 - 1724 - error: 1725 - return rc; 1717 + phy_provider = devm_of_phy_provider_register(ctx->dev, xgene_phy_xlate); 1718 + return PTR_ERR_OR_ZERO(phy_provider); 1726 1719 } 1727 1720 1728 1721 static const struct of_device_id xgene_phy_of_match[] = {