Re: [PATCH v2] gpio: mmio: use devm_platform_ioremap_resource_byname()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



pon., 17 lut 2020 o 11:48 <qiwuchen55@xxxxxxxxx> napisał(a):
>
> From: chenqiwu <chenqiwu@xxxxxxxxxx>
>
> Use devm_platform_ioremap_resource_byname() instead of calling
> platform_get_resource_byname() and devm_ioremap_resource()
> separately to simplify code.
>
> Signed-off-by: chenqiwu <chenqiwu@xxxxxxxxxx>
> ---
> changes in v2:
>  - remove bgpio_map() entirely.
> ---
>  drivers/gpio/gpio-mmio.c | 28 +++++-----------------------
>  1 file changed, 5 insertions(+), 23 deletions(-)
>
> diff --git a/drivers/gpio/gpio-mmio.c b/drivers/gpio/gpio-mmio.c
> index f729e3e..b7170d6 100644
> --- a/drivers/gpio/gpio-mmio.c
> +++ b/drivers/gpio/gpio-mmio.c
> @@ -654,24 +654,6 @@ int bgpio_init(struct gpio_chip *gc, struct device *dev,
>
>  #if IS_ENABLED(CONFIG_GPIO_GENERIC_PLATFORM)
>
> -static void __iomem *bgpio_map(struct platform_device *pdev,
> -                              const char *name,
> -                              resource_size_t sane_sz)
> -{
> -       struct resource *r;
> -       resource_size_t sz;
> -
> -       r = platform_get_resource_byname(pdev, IORESOURCE_MEM, name);
> -       if (!r)
> -               return NULL;
> -
> -       sz = resource_size(r);
> -       if (sz != sane_sz)
> -               return IOMEM_ERR_PTR(-EINVAL);

I missed this in v1: are you sure that this check is not needed? I'd
say it's up to users to correctly define the size of mapped regions
but I'd also assume the original author added this if for a reason.

Bart




[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux