mirror of
https://github.com/torvalds/linux.git
synced 2024-11-28 23:21:31 +00:00
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: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Lee Jones <lee.jones@linaro.org>
This commit is contained in:
parent
18490cdb9e
commit
f2a19c5b78
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user