diff options
author | Kai Song <songkai01@inspur.com> | 2021-10-06 17:19:26 +0300 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2021-11-05 17:40:26 +0300 |
commit | fae2570d629cdd72f0611d015fc4ba705ae5422b (patch) | |
tree | 63803b59c2f0e39734b8b39575c57a7bbdf00cd9 /drivers/mfd/altera-sysmgr.c | |
parent | 8616f7ee2cf6021361814a5842eb1ac9845bea21 (diff) | |
download | linux-fae2570d629cdd72f0611d015fc4ba705ae5422b.tar.xz |
mfd: altera-sysmgr: Fix a mistake caused by resource_size conversion
The resource_size defines that:
res->end - res->start + 1;
The origin original code is:
sysmgr_config.max_register = res->end - res->start - 3;
So, the correct fix is that:
sysmgr_config.max_register = resource_size(res) - 4;
Fixes: d12edf9661a4 ("mfd: altera-sysmgr: Use resource_size function on resource object")
Signed-off-by: Kai Song <songkai01@inspur.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211006141926.6120-1-songkai01@inspur.com
Diffstat (limited to 'drivers/mfd/altera-sysmgr.c')
-rw-r--r-- | drivers/mfd/altera-sysmgr.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mfd/altera-sysmgr.c b/drivers/mfd/altera-sysmgr.c index 20cb294c7512..5d3715a28b28 100644 --- a/drivers/mfd/altera-sysmgr.c +++ b/drivers/mfd/altera-sysmgr.c @@ -153,7 +153,7 @@ static int sysmgr_probe(struct platform_device *pdev) if (!base) return -ENOMEM; - sysmgr_config.max_register = resource_size(res) - 3; + sysmgr_config.max_register = resource_size(res) - 4; regmap = devm_regmap_init_mmio(dev, base, &sysmgr_config); } |