Commit f385b731 authored by Stephen Boyd's avatar Stephen Boyd Committed by Vinod Koul

phy: qcom-qmp: Use devm_platform_ioremap_resource() to simplify

We can use the wrapper API here to save some lines and remove the need
for the 'base' and 'res' local variable.
Suggested-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: default avatarStephen Boyd <swboyd@chromium.org>
Cc: Jeykumar Sankaran <jsanka@codeaurora.org>
Cc: Chandan Uddaraju <chandanu@codeaurora.org>
Cc: Vara Reddy <varar@codeaurora.org>
Cc: Tanmay Shah <tanmay@codeaurora.org>
Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Manu Gautam <mgautam@codeaurora.org>
Cc: Sandeep Maheswaram <sanm@codeaurora.org>
Cc: Douglas Anderson <dianders@chromium.org>
Cc: Sean Paul <seanpaul@chromium.org>
Cc: Jonathan Marek <jonathan@marek.ca>
Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: Rob Clark <robdclark@chromium.org>
Link: https://lore.kernel.org/r/20200916231202.3637932-7-swboyd@chromium.orgSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent dab7b10d
...@@ -3237,10 +3237,8 @@ static int qcom_qmp_phy_probe(struct platform_device *pdev) ...@@ -3237,10 +3237,8 @@ static int qcom_qmp_phy_probe(struct platform_device *pdev)
{ {
struct qcom_qmp *qmp; struct qcom_qmp *qmp;
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct resource *res;
struct device_node *child; struct device_node *child;
struct phy_provider *phy_provider; struct phy_provider *phy_provider;
void __iomem *base;
void __iomem *serdes; void __iomem *serdes;
const struct qmp_phy_cfg *cfg; const struct qmp_phy_cfg *cfg;
int num, id; int num, id;
...@@ -3258,13 +3256,10 @@ static int qcom_qmp_phy_probe(struct platform_device *pdev) ...@@ -3258,13 +3256,10 @@ static int qcom_qmp_phy_probe(struct platform_device *pdev)
if (!cfg) if (!cfg)
return -EINVAL; return -EINVAL;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
base = devm_ioremap_resource(dev, res);
if (IS_ERR(base))
return PTR_ERR(base);
/* per PHY serdes; usually located at base address */ /* per PHY serdes; usually located at base address */
serdes = base; serdes = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(serdes))
return PTR_ERR(serdes);
/* per PHY dp_com; if PHY has dp_com control block */ /* per PHY dp_com; if PHY has dp_com control block */
if (cfg->has_phy_dp_com_ctrl) { if (cfg->has_phy_dp_com_ctrl) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment