mirror of
https://github.com/torvalds/linux.git
synced 2024-11-21 19:46:16 +00:00
USB: gadget: pxa27x_udc: Avoid using GPIOF_ACTIVE_LOW
Avoid using GPIOF_ACTIVE_LOW as it's deprecated and subject to remove. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20241104093609.156059-6-andriy.shevchenko@linux.intel.com Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
This commit is contained in:
parent
15998583b1
commit
62d2a940f2
@ -2355,18 +2355,19 @@ static int pxa_udc_probe(struct platform_device *pdev)
|
|||||||
struct pxa_udc *udc = &memory;
|
struct pxa_udc *udc = &memory;
|
||||||
int retval = 0, gpio;
|
int retval = 0, gpio;
|
||||||
struct pxa2xx_udc_mach_info *mach = dev_get_platdata(&pdev->dev);
|
struct pxa2xx_udc_mach_info *mach = dev_get_platdata(&pdev->dev);
|
||||||
unsigned long gpio_flags;
|
|
||||||
|
|
||||||
if (mach) {
|
if (mach) {
|
||||||
gpio_flags = mach->gpio_pullup_inverted ? GPIOF_ACTIVE_LOW : 0;
|
|
||||||
gpio = mach->gpio_pullup;
|
gpio = mach->gpio_pullup;
|
||||||
if (gpio_is_valid(gpio)) {
|
if (gpio_is_valid(gpio)) {
|
||||||
retval = devm_gpio_request_one(&pdev->dev, gpio,
|
retval = devm_gpio_request_one(&pdev->dev, gpio,
|
||||||
gpio_flags,
|
GPIOF_OUT_INIT_LOW,
|
||||||
"USB D+ pullup");
|
"USB D+ pullup");
|
||||||
if (retval)
|
if (retval)
|
||||||
return retval;
|
return retval;
|
||||||
udc->gpiod = gpio_to_desc(mach->gpio_pullup);
|
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;
|
udc->udc_command = mach->udc_command;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user