return -ENOMEM;
/* retrieve io base */
- hwspin->io_base = of_iomap(pdev->dev.of_node, 0);
- if (!hwspin->io_base)
- return -ENOMEM;
+ hwspin->io_base = devm_platform_ioremap_resource(pdev, 0);
+ if (IS_ERR(hwspin->io_base))
+ return PTR_ERR(hwspin->io_base);
for (idx = 0; idx < HW_SPINLOCK_NUMBER; idx++) {
hwlock = &hwspin->bank.lock[idx];
reg_failed:
pm_runtime_disable(&pdev->dev);
- iounmap(hwspin->io_base);
return ret;
}
pm_runtime_disable(&pdev->dev);
- iounmap(hwspin->io_base);
-
return 0;
}