Commit f2a19c5b authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Lee Jones

mfd: syscon: Re-use resource_size() to count max_register

Instead of open coded variant use resource_size() and replace
weird '- 3' to more understandable '- 4'.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent 18490cdb
......@@ -245,7 +245,7 @@ static int syscon_probe(struct platform_device *pdev)
if (!base)
return -ENOMEM;
syscon_config.max_register = res->end - res->start - 3;
syscon_config.max_register = resource_size(res) - 4;
if (pdata)
syscon_config.name = pdata->label;
syscon->regmap = devm_regmap_init_mmio(dev, base, &syscon_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