Thread (13 messages) 13 messages, 4 authors, 2019-02-08

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

flat view

From: Sekhar Nori <hidden>
Date: 2019-02-08 11:30:02
Also in: linux-usb, lkml

Hi Bartosz,

On 05/02/19 3:55 PM, Bartosz Golaszewski wrote:
quoted hunk ↗ jump to hunk
+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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help