diff options
| author | Axel Lin <axel.lin@ingics.com> | 2015-03-23 00:08:18 -0400 |
|---|---|---|
| committer | Kishon Vijay Abraham I <kishon@ti.com> | 2015-04-03 08:46:18 -0400 |
| commit | 52ea796b9161b1b81242e6831d9e128ee207ad2d (patch) | |
| tree | 13bbd70147bbbcd92a70fd790061d3e61a7e535b | |
| parent | 358d6c87e73310c8e6564153cb556c0cd9e523fc (diff) | |
phy: qcom-ufs: Don't return error if fail to get optional resource
"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 <axel.lin@ingics.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
| -rw-r--r-- | drivers/phy/phy-qcom-ufs.c | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/drivers/phy/phy-qcom-ufs.c b/drivers/phy/phy-qcom-ufs.c index a149d92df656..c4199e605ce2 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, | |||
| 135 | int err = 0; | 135 | int err = 0; |
| 136 | 136 | ||
| 137 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "phy_mem"); | 137 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "phy_mem"); |
| 138 | if (!res) { | ||
| 139 | dev_err(dev, "%s: phy_mem resource not found\n", __func__); | ||
| 140 | err = -ENOMEM; | ||
| 141 | goto out; | ||
| 142 | } | ||
| 143 | |||
| 144 | phy_common->mmio = devm_ioremap_resource(dev, res); | 138 | phy_common->mmio = devm_ioremap_resource(dev, res); |
| 145 | if (IS_ERR((void const *)phy_common->mmio)) { | 139 | if (IS_ERR((void const *)phy_common->mmio)) { |
| 146 | err = PTR_ERR((void const *)phy_common->mmio); | 140 | err = PTR_ERR((void const *)phy_common->mmio); |
| 147 | phy_common->mmio = NULL; | 141 | phy_common->mmio = NULL; |
| 148 | dev_err(dev, "%s: ioremap for phy_mem resource failed %d\n", | 142 | dev_err(dev, "%s: ioremap for phy_mem resource failed %d\n", |
| 149 | __func__, err); | 143 | __func__, err); |
| 150 | goto out; | 144 | return err; |
| 151 | } | 145 | } |
| 152 | 146 | ||
| 153 | /* "dev_ref_clk_ctrl_mem" is optional resource */ | 147 | /* "dev_ref_clk_ctrl_mem" is optional resource */ |
| 154 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, | 148 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, |
| 155 | "dev_ref_clk_ctrl_mem"); | 149 | "dev_ref_clk_ctrl_mem"); |
| 156 | if (!res) { | ||
| 157 | dev_dbg(dev, "%s: dev_ref_clk_ctrl_mem resource not found\n", | ||
| 158 | __func__); | ||
| 159 | goto out; | ||
| 160 | } | ||
| 161 | |||
| 162 | phy_common->dev_ref_clk_ctrl_mmio = devm_ioremap_resource(dev, res); | 150 | phy_common->dev_ref_clk_ctrl_mmio = devm_ioremap_resource(dev, res); |
| 163 | if (IS_ERR((void const *)phy_common->dev_ref_clk_ctrl_mmio)) { | 151 | if (IS_ERR((void const *)phy_common->dev_ref_clk_ctrl_mmio)) |
| 164 | err = PTR_ERR((void const *)phy_common->dev_ref_clk_ctrl_mmio); | ||
| 165 | phy_common->dev_ref_clk_ctrl_mmio = NULL; | 152 | phy_common->dev_ref_clk_ctrl_mmio = NULL; |
| 166 | dev_err(dev, "%s: ioremap for dev_ref_clk_ctrl_mem resource failed %d\n", | ||
| 167 | __func__, err); | ||
| 168 | } | ||
| 169 | 153 | ||
| 170 | out: | 154 | return 0; |
| 171 | return err; | ||
| 172 | } | 155 | } |
| 173 | 156 | ||
| 174 | static int __ufs_qcom_phy_clk_get(struct phy *phy, | 157 | static int __ufs_qcom_phy_clk_get(struct phy *phy, |
