Re: [PATCH -next 15/30] pinctrl: oxnas: use devm_platform_ioremap_resource() to simplify code

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

 



On 17/10/2019 14:26, YueHaibing wrote:
> Use devm_platform_ioremap_resource() to simplify the code a bit.
> This is detected by coccinelle.
> 
> Signed-off-by: YueHaibing <yuehaibing@xxxxxxxxxx>
> ---
>  drivers/pinctrl/pinctrl-oxnas.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/pinctrl/pinctrl-oxnas.c b/drivers/pinctrl/pinctrl-oxnas.c
> index 40dc125..674b7b5 100644
> --- a/drivers/pinctrl/pinctrl-oxnas.c
> +++ b/drivers/pinctrl/pinctrl-oxnas.c
> @@ -1196,7 +1196,6 @@ static int oxnas_gpio_probe(struct platform_device *pdev)
>  	struct oxnas_gpio_bank *bank;
>  	unsigned int id, ngpios;
>  	int irq, ret;
> -	struct resource *res;
>  	struct gpio_irq_chip *girq;
>  
>  	if (of_parse_phandle_with_fixed_args(np, "gpio-ranges",
> @@ -1220,8 +1219,7 @@ static int oxnas_gpio_probe(struct platform_device *pdev)
>  
>  	bank = &oxnas_gpio_banks[id];
>  
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	bank->reg_base = devm_ioremap_resource(&pdev->dev, res);
> +	bank->reg_base = devm_platform_ioremap_resource(pdev, 0);
>  	if (IS_ERR(bank->reg_base))
>  		return PTR_ERR(bank->reg_base);
>  
> 

Acked-by: Neil Armstrong <narmstrong@xxxxxxxxxxxx>



[Index of Archives]     [ARM Kernel]     [Linux ARM]     [Linux ARM MSM]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux