[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK8P3a3pFDPa49rXT3hbkptvqsRk5NdVimUT=x8-tGoZKH0yRQ@mail.gmail.com>
Date: Fri, 15 Nov 2019 10:10:58 +0100
From: Arnd Bergmann <arnd@...db.de>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: Lee Jones <lee.jones@...aro.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v1 1/2] mfd: syscon: Re-use resource_size() to count max_register
On Fri, Nov 15, 2019 at 9:49 AM Andy Shevchenko
<andriy.shevchenko@...ux.intel.com> wrote:
>
> Instead of open coded variant use resource_size() and replace
> weird '- 3' to more understandable '- 4'.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> ---
Acked-by: Arnd Bergmann <arnd@...db.de>
> 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
>
Powered by blists - more mailing lists