summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/sprd/sprd_dpu.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/sprd/sprd_dpu.c')
-rw-r--r--drivers/gpu/drm/sprd/sprd_dpu.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/sprd/sprd_dpu.c b/drivers/gpu/drm/sprd/sprd_dpu.c
index 06a3414ee43a..1637203ea103 100644
--- a/drivers/gpu/drm/sprd/sprd_dpu.c
+++ b/drivers/gpu/drm/sprd/sprd_dpu.c
@@ -790,6 +790,11 @@ static int sprd_dpu_context_init(struct sprd_dpu *dpu,
int ret;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ if (!res) {
+ dev_err(dev, "failed to get I/O resource\n");
+ return -EINVAL;
+ }
+
ctx->base = devm_ioremap(dev, res->start, resource_size(res));
if (!ctx->base) {
dev_err(dev, "failed to map dpu registers\n");