Commit 7bc1cfae authored by Yangtao Li's avatar Yangtao Li Committed by Bjorn Andersson

soc: qcom: spm: Convert to devm_platform_ioremap_resource()

Use devm_platform_ioremap_resource() to simplify code.
Signed-off-by: default avatarYangtao Li <frank.li@vivo.com>
Link: https://lore.kernel.org/r/20230705122644.32236-3-frank.li@vivo.comSigned-off-by: default avatarBjorn Andersson <andersson@kernel.org>
parent 412bf52d
...@@ -275,15 +275,13 @@ static int spm_dev_probe(struct platform_device *pdev) ...@@ -275,15 +275,13 @@ static int spm_dev_probe(struct platform_device *pdev)
{ {
const struct of_device_id *match_id; const struct of_device_id *match_id;
struct spm_driver_data *drv; struct spm_driver_data *drv;
struct resource *res;
void __iomem *addr; void __iomem *addr;
drv = devm_kzalloc(&pdev->dev, sizeof(*drv), GFP_KERNEL); drv = devm_kzalloc(&pdev->dev, sizeof(*drv), GFP_KERNEL);
if (!drv) if (!drv)
return -ENOMEM; return -ENOMEM;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); drv->reg_base = devm_platform_ioremap_resource(pdev, 0);
drv->reg_base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(drv->reg_base)) if (IS_ERR(drv->reg_base))
return PTR_ERR(drv->reg_base); return PTR_ERR(drv->reg_base);
......
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