From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753322AbbDCQ24 (ORCPT ); Fri, 3 Apr 2015 12:28:56 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:34260 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753054AbbDCQ1P (ORCPT ); Fri, 3 Apr 2015 12:27:15 -0400 From: Kishon Vijay Abraham I To: CC: , Subject: [PATCH 14/20] phy: qcom-ufs: Don't return error if fail to get optional resource Date: Fri, 3 Apr 2015 21:56:42 +0530 Message-ID: <1428078408-13344-15-git-send-email-kishon@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1428078408-13344-1-git-send-email-kishon@ti.com> References: <1428078408-13344-1-git-send-email-kishon@ti.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Axel Lin "dev_ref_clk_ctrl_mem" is optional resource, so don't return error if fail to get the resource. Since it's an optional resource, don't emit error if fail to get dev_ref_clk_ctrl_mem. Also remove redundant test for res, it's done by devm_ioremap_resource(). Signed-off-by: Axel Lin Signed-off-by: Kishon Vijay Abraham I --- drivers/phy/phy-qcom-ufs.c | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/drivers/phy/phy-qcom-ufs.c b/drivers/phy/phy-qcom-ufs.c index a149d92..c4199e6 100644 --- a/drivers/phy/phy-qcom-ufs.c +++ b/drivers/phy/phy-qcom-ufs.c @@ -135,40 +135,23 @@ int ufs_qcom_phy_base_init(struct platform_device *pdev, int err = 0; res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "phy_mem"); - if (!res) { - dev_err(dev, "%s: phy_mem resource not found\n", __func__); - err = -ENOMEM; - goto out; - } - phy_common->mmio = devm_ioremap_resource(dev, res); if (IS_ERR((void const *)phy_common->mmio)) { err = PTR_ERR((void const *)phy_common->mmio); phy_common->mmio = NULL; dev_err(dev, "%s: ioremap for phy_mem resource failed %d\n", __func__, err); - goto out; + return err; } /* "dev_ref_clk_ctrl_mem" is optional resource */ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dev_ref_clk_ctrl_mem"); - if (!res) { - dev_dbg(dev, "%s: dev_ref_clk_ctrl_mem resource not found\n", - __func__); - goto out; - } - phy_common->dev_ref_clk_ctrl_mmio = devm_ioremap_resource(dev, res); - if (IS_ERR((void const *)phy_common->dev_ref_clk_ctrl_mmio)) { - err = PTR_ERR((void const *)phy_common->dev_ref_clk_ctrl_mmio); + if (IS_ERR((void const *)phy_common->dev_ref_clk_ctrl_mmio)) phy_common->dev_ref_clk_ctrl_mmio = NULL; - dev_err(dev, "%s: ioremap for dev_ref_clk_ctrl_mem resource failed %d\n", - __func__, err); - } -out: - return err; + return 0; } static int __ufs_qcom_phy_clk_get(struct phy *phy, -- 1.7.9.5