diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2019-11-15 10:49:30 +0200 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2020-01-24 07:33:56 +0000 |
commit | f2a19c5b78670af5986ab0a625631f8f8a6adac1 (patch) | |
tree | e712cb54de64b77f82b098f947be60b69efd8996 /drivers/mfd | |
parent | 18490cdb9e321a62a9c2cac6fb506843cbc84926 (diff) | |
download | linux-f2a19c5b78670af5986ab0a625631f8f8a6adac1.tar.gz linux-f2a19c5b78670af5986ab0a625631f8f8a6adac1.tar.bz2 linux-f2a19c5b78670af5986ab0a625631f8f8a6adac1.zip |
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>
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/syscon.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c index e22197c832e8..13626bb2d432 100644 --- a/drivers/mfd/syscon.c +++ b/drivers/mfd/syscon.c @@ -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); |