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:
Родитель
18490cdb9e
Коммит
f2a19c5b78
|
@ -245,7 +245,7 @@ static int syscon_probe(struct platform_device *pdev)
|
||||||
if (!base)
|
if (!base)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
syscon_config.max_register = res->end - res->start - 3;
|
syscon_config.max_register = resource_size(res) - 4;
|
||||||
if (pdata)
|
if (pdata)
|
||||||
syscon_config.name = pdata->label;
|
syscon_config.name = pdata->label;
|
||||||
syscon->regmap = devm_regmap_init_mmio(dev, base, &syscon_config);
|
syscon->regmap = devm_regmap_init_mmio(dev, base, &syscon_config);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче