linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/2] mfd: syscon: Re-use resource_size() to count max_register
@ 2019-11-15  8:49 Andy Shevchenko
  2019-11-15  8:49 ` [PATCH v1 2/2] mfd: syscon: Switch to use devm_ioremap_resource() Andy Shevchenko
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Andy Shevchenko @ 2019-11-15  8:49 UTC (permalink / raw)
  To: Lee Jones, Arnd Bergmann, linux-kernel; +Cc: Andy Shevchenko

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>
---
 drivers/mfd/syscon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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);
-- 
2.24.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-12-09  8:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-15  8:49 [PATCH v1 1/2] mfd: syscon: Re-use resource_size() to count max_register Andy Shevchenko
2019-11-15  8:49 ` [PATCH v1 2/2] mfd: syscon: Switch to use devm_ioremap_resource() Andy Shevchenko
2019-11-15  9:12   ` Arnd Bergmann
2019-11-15 10:20     ` Andy Shevchenko
2019-11-15  9:10 ` [PATCH v1 1/2] mfd: syscon: Re-use resource_size() to count max_register Arnd Bergmann
2019-12-09  8:45 ` Lee Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).