Commit fae2570d authored by Kai Song's avatar Kai Song Committed by Lee Jones

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: d12edf96 ("mfd: altera-sysmgr: Use resource_size function on resource object")
Signed-off-by: default avatarKai Song <songkai01@inspur.com>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211006141926.6120-1-songkai01@inspur.com
parent 8616f7ee
......@@ -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);
}
......
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