diff mbox series

gpio: mxs: read pin level directly instead of using .get

Message ID 20181218084757.15644-1-u.kleine-koenig@pengutronix.de
State New
Headers show
Series gpio: mxs: read pin level directly instead of using .get | expand

Commit Message

Uwe Kleine-König Dec. 18, 2018, 8:47 a.m. UTC
Calling readl directly instead of going through another function that
results in the same result to remove some overhead. I didn't try to
measure the performance gain, but IMHO there is little benefit from
abstracting a GPIO register access in the GPIO driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/gpio/gpio-mxs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Linus Walleij Dec. 21, 2018, 10:30 a.m. UTC | #1
On Tue, Dec 18, 2018 at 9:48 AM Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:

> Calling readl directly instead of going through another function that
> results in the same result to remove some overhead. I didn't try to
> measure the performance gain, but IMHO there is little benefit from
> abstracting a GPIO register access in the GPIO driver.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Excellent! Patch applied.

Yours,
Linus Walleij
diff mbox series

Patch

diff --git a/drivers/gpio/gpio-mxs.c b/drivers/gpio/gpio-mxs.c
index ea874fd033a5..5e5437a2c607 100644
--- a/drivers/gpio/gpio-mxs.c
+++ b/drivers/gpio/gpio-mxs.c
@@ -84,7 +84,7 @@  static int mxs_gpio_set_irq_type(struct irq_data *d, unsigned int type)
 	port->both_edges &= ~pin_mask;
 	switch (type) {
 	case IRQ_TYPE_EDGE_BOTH:
-		val = port->gc.get(&port->gc, d->hwirq);
+		val = readl(port->base + PINCTRL_DIN(port)) & pin_mask;
 		if (val)
 			edge = GPIO_INT_FALL_EDGE;
 		else