Commit 3945ac0e authored by Wang Xiaojun's avatar Wang Xiaojun Committed by Tomi Valkeinen

drm/tidss: use devm_platform_ioremap_resource_byname

Use the devm_platform_ioremap_resource_byname() helper instead of
calling platform_get_resource_byname() and devm_ioremap_resource()
separately.
Signed-off-by: default avatarWang Xiaojun <wangxiaojun11@huawei.com>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200917062958.2183496-1-wangxiaojun11@huawei.com
parent ae36fccc
...@@ -2608,16 +2608,9 @@ void dispc_remove(struct tidss_device *tidss) ...@@ -2608,16 +2608,9 @@ void dispc_remove(struct tidss_device *tidss)
static int dispc_iomap_resource(struct platform_device *pdev, const char *name, static int dispc_iomap_resource(struct platform_device *pdev, const char *name,
void __iomem **base) void __iomem **base)
{ {
struct resource *res;
void __iomem *b; void __iomem *b;
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, name); b = devm_platform_ioremap_resource_byname(pdev, name);
if (!res) {
dev_err(&pdev->dev, "cannot get mem resource '%s'\n", name);
return -EINVAL;
}
b = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(b)) { if (IS_ERR(b)) {
dev_err(&pdev->dev, "cannot ioremap resource '%s'\n", name); dev_err(&pdev->dev, "cannot ioremap resource '%s'\n", name);
return PTR_ERR(b); return PTR_ERR(b);
......
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