Commit 437cbbb0 authored by Cai Huoqing's avatar Cai Huoqing Committed by Stephen Boyd

clk: qcom: common: Make use of the helper function devm_platform_ioremap_resource()

Use the devm_platform_ioremap_resource() helper instead of
calling platform_get_resource() and devm_ioremap_resource()
separately
Signed-off-by: default avatarCai Huoqing <caihuoqing@baidu.com>
Link: https://lore.kernel.org/r/20210907084851.4050-1-caihuoqing@baidu.comSigned-off-by: default avatarStephen Boyd <sboyd@kernel.org>
parent aacbbe6b
...@@ -73,11 +73,9 @@ struct regmap * ...@@ -73,11 +73,9 @@ struct regmap *
qcom_cc_map(struct platform_device *pdev, const struct qcom_cc_desc *desc) qcom_cc_map(struct platform_device *pdev, const struct qcom_cc_desc *desc)
{ {
void __iomem *base; void __iomem *base;
struct resource *res;
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); base = devm_platform_ioremap_resource(pdev, 0);
base = devm_ioremap_resource(dev, res);
if (IS_ERR(base)) if (IS_ERR(base))
return ERR_CAST(base); return ERR_CAST(base);
...@@ -313,11 +311,9 @@ int qcom_cc_probe_by_index(struct platform_device *pdev, int index, ...@@ -313,11 +311,9 @@ int qcom_cc_probe_by_index(struct platform_device *pdev, int index,
const struct qcom_cc_desc *desc) const struct qcom_cc_desc *desc)
{ {
struct regmap *regmap; struct regmap *regmap;
struct resource *res;
void __iomem *base; void __iomem *base;
res = platform_get_resource(pdev, IORESOURCE_MEM, index); base = devm_platform_ioremap_resource(pdev, index);
base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(base)) if (IS_ERR(base))
return -ENOMEM; return -ENOMEM;
......
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