Re: [PATCH 5/8] usb: ohci-da8xx: add vbus and overcurrent gpios

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

 



Hi Bartosz,

On 05/02/19 3:55 PM, Bartosz Golaszewski wrote:
> +static irqreturn_t ohci_da8xx_oc_handler(int irq, void *data)
> +{
> +	struct da8xx_ohci_hcd *da8xx_ohci = data;
> +
> +	if (gpiod_get_value_cansleep(da8xx_ohci->oc_gpio))
> +		gpiod_set_value_cansleep(da8xx_ohci->vbus_gpio, 0);
> +
> +	return IRQ_HANDLED;
> +}

Its pretty strange to see gpiod_get_value_cansleep() being called from
irq context, although I agree right now it uses SoC GPIOs so it should
actually never sleep.

Isn't it better to use gpiod_get_value() instead so you get a warning on
incorrect usage?

Thanks,
Sekhar



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux