]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
gpio: mxs: read pin level directly instead of using .get
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Tue, 18 Dec 2018 08:47:57 +0000 (09:47 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Fri, 21 Dec 2018 10:29:57 +0000 (11:29 +0100)
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>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-mxs.c

index ea874fd033a5e2da19b4d3d8e6fb02afd598180d..5e5437a2c607ee9c4817a36040431b5e7ac08a20 100644 (file)
@@ -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