mirror of
https://github.com/torvalds/linux.git
synced 2025-11-02 01:29:02 +02:00
drm/imx/dcss: fix resource size calculation
The resource is inclusive of the ->start and ->end addresses so this
calculation is not correct. It should be "res->end - res->start + 1".
Use the resource_size() to do the calculation.
Fixes: 90393c9b54 ("drm/imx/dcss: request memory region")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
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/4914592b-4256-4c9c-bc1d-6dec1e473831@moroto.mountain
This commit is contained in:
parent
9fa2679b7f
commit
9cb3542aee
1 changed files with 1 additions and 3 deletions
|
|
@ -167,7 +167,6 @@ 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) {
|
||||
|
|
@ -181,8 +180,7 @@ 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")) {
|
||||
if (!devm_request_mem_region(dev, res->start, resource_size(res), "dcss")) {
|
||||
dev_err(dev, "cannot request memory region\n");
|
||||
return ERR_PTR(-EBUSY);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue