static int dispc_iomap_resource(struct platform_device *pdev, const char *name,
void __iomem **base)
{
- struct resource *res;
void __iomem *b;
- res = platform_get_resource_byname(pdev, IORESOURCE_MEM, name);
- if (!res) {
- dev_err(&pdev->dev, "cannot get mem resource '%s'\n", name);
- return -EINVAL;
- }
-
- b = devm_ioremap_resource(&pdev->dev, res);
+ b = devm_platform_ioremap_resource_byname(pdev, name);
if (IS_ERR(b)) {
dev_err(&pdev->dev, "cannot ioremap resource '%s'\n", name);
return PTR_ERR(b);