summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/imx
diff options
context:
space:
mode:
authorPhilipp Stanner <pstanner@redhat.com>2024-01-24 12:19:04 +0100
committerLaurentiu Palcu <laurentiu.palcu@oss.nxp.com>2024-02-02 15:34:40 +0200
commit90393c9b5408cafededdee2f34082c4c3c671901 (patch)
treed87911f42ebb82d068707547a43398d762e02d65 /drivers/gpu/drm/imx
parent041261ac4c365e03b07427569d6735f8adfd21c8 (diff)
downloadlinux-90393c9b5408cafededdee2f34082c4c3c671901.tar.gz
linux-90393c9b5408cafededdee2f34082c4c3c671901.tar.bz2
linux-90393c9b5408cafededdee2f34082c4c3c671901.zip
drm/imx/dcss: request memory region
The driver's memory regions are currently just ioremap()ed, but not reserved through a request. That's not a bug, but having the request is a little more robust. Implement the region-request through the corresponding managed devres-function. Signed-off-by: Philipp Stanner <pstanner@redhat.com> Reviewed-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com> Signed-off-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240124111904.18261-3-pstanner@redhat.com
Diffstat (limited to 'drivers/gpu/drm/imx')
-rw-r--r--drivers/gpu/drm/imx/dcss/dcss-dev.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/drm/imx/dcss/dcss-dev.c b/drivers/gpu/drm/imx/dcss/dcss-dev.c
index 4f3af0dfb344..d448bf1c205e 100644
--- a/drivers/gpu/drm/imx/dcss/dcss-dev.c
+++ b/drivers/gpu/drm/imx/dcss/dcss-dev.c
@@ -170,6 +170,7 @@ struct dcss_dev *dcss_dev_create(struct device *dev, bool hdmi_output)
struct resource *res;
struct dcss_dev *dcss;
const struct dcss_type_data *devtype;
+ resource_size_t res_len;
devtype = of_device_get_match_data(dev);
if (!devtype) {
@@ -183,6 +184,12 @@ struct dcss_dev *dcss_dev_create(struct device *dev, bool hdmi_output)
return ERR_PTR(-EINVAL);
}
+ res_len = res->end - res->start;
+ if (!devm_request_mem_region(dev, res->start, res_len, "dcss")) {
+ dev_err(dev, "cannot request memory region\n");
+ return ERR_PTR(-EBUSY);
+ }
+
dcss = kzalloc(sizeof(*dcss), GFP_KERNEL);
if (!dcss)
return ERR_PTR(-ENOMEM);