[PATCH 19/21] usb: udc: pxa: remove unused platform_data

Andy Shevchenko andriy.shevchenko at linux.intel.com
Sat Aug 9 03:15:57 PDT 2025


On Fri, Aug 08, 2025 at 05:18:04PM +0200, Arnd Bergmann wrote:
> 
> None of the remaining boards put useful data into the platform_data
> structures, so effectively this only works with DT based probing.
> 
> Remove all code that references this data, to stop using the legacy
> gpiolib interfaces. The pxa27x version already supports gpio
> descriptors, while the pxa25x version now does it the same way.

Reviewed-by: Andy Shevchenko <andriy.shevchenko at linux.intel.com>
See a comment below.

...

>  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);
> -
> -	if (mach) {
> -		gpio = mach->gpio_pullup;
> -		if (gpio_is_valid(gpio)) {
> -			retval = devm_gpio_request_one(&pdev->dev, gpio,
> -						       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 {
> -		udc->gpiod = devm_gpiod_get(&pdev->dev, NULL, GPIOD_ASIS);
> -	}
> +	int retval = 0;
> +
> +	udc->gpiod = devm_gpiod_get(&pdev->dev, NULL, GPIOD_ASIS);

Missed error check, in particular it will ignore deferred probe case.

>  	udc->regs = devm_platform_ioremap_resource(pdev, 0);

-- 
With Best Regards,
Andy Shevchenko





More information about the linux-arm-kernel mailing list