[PATCH AUTOSEL 5.10 6/6] USB: gadget: pxa27x_udc: Avoid using GPIOF_ACTIVE_LOW

Pavel Machek pavel at denx.de
Mon Dec 2 04:09:50 PST 2024


Hi!

> From: Andy Shevchenko <andriy.shevchenko at linux.intel.com>
> 
> [ Upstream commit 62d2a940f29e6aa5a1d844a90820ca6240a99b34 ]
> 
> Avoid using GPIOF_ACTIVE_LOW as it's deprecated and subject to remove.

Well, we won't be removing it in -stable, so we don't need this.

Best regards,
								Pavel
								
> +++ b/drivers/usb/gadget/udc/pxa27x_udc.c
> @@ -2356,18 +2356,19 @@ static int pxa_udc_probe(struct platform_device *pdev)
>  	struct pxa_udc *udc = &memory;
>  	int retval = 0, gpio;
>  	struct pxa2xx_udc_mach_info *mach = dev_get_platdata(&pdev->dev);
> -	unsigned long gpio_flags;
>  
>  	if (mach) {
> -		gpio_flags = mach->gpio_pullup_inverted ? GPIOF_ACTIVE_LOW : 0;
>  		gpio = mach->gpio_pullup;
>  		if (gpio_is_valid(gpio)) {
>  			retval = devm_gpio_request_one(&pdev->dev, gpio,
> -						       gpio_flags,
> +						       GPIOF_OUT_INIT_LOW,
>  						       "USB D+ pullup");
>  			if (retval)
>  				return retval;
>  			udc->gpiod = gpio_to_desc(mach->gpio_pullup);
> +
> +			if (mach->gpio_pullup_inverted ^ gpiod_is_active_low(udc->gpiod))
> +				gpiod_toggle_active_low(udc->gpiod);
>  		}
>  		udc->udc_command = mach->udc_command;
>  	} else {

-- 
DENX Software Engineering GmbH,        Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20241202/4b79f851/attachment.sig>


More information about the linux-arm-kernel mailing list