Skip to content

Commit

Permalink
pinctrl: rza1: remove unnecessary static inline function
Browse files Browse the repository at this point in the history
Having static inline oneliner does not benefit too much when it is
only called from another oneliner function. Remove some of the
'onion'. This simplifies also the coming usage of the gpiolib
defines. We can do conversion from chip bits to gpiolib direction
defines as last step in the get_direction callback. Drivers can
use chip specific values in driver internal functions and do
conversion only once.

Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20191113071045.GA22110@localhost.localdomain
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
  • Loading branch information
Matti Vaittinen authored and Linus Walleij committed Nov 21, 2019
1 parent dabad1f commit 54787d7
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions drivers/pinctrl/pinctrl-rza1.c
Original file line number Diff line number Diff line change
Expand Up @@ -617,12 +617,6 @@ static void rza1_pin_reset(struct rza1_port *port, unsigned int pin)
spin_unlock_irqrestore(&port->lock, irqflags);
}

static inline int rza1_pin_get_direction(struct rza1_port *port,
unsigned int pin)
{
return !!rza1_get_bit(port, RZA1_PM_REG, pin);
}

/**
* rza1_pin_set_direction() - set I/O direction on a pin in port mode
*
Expand Down Expand Up @@ -783,7 +777,7 @@ static int rza1_gpio_get_direction(struct gpio_chip *chip, unsigned int gpio)
{
struct rza1_port *port = gpiochip_get_data(chip);

return rza1_pin_get_direction(port, gpio);
return !!rza1_get_bit(port, RZA1_PM_REG, gpio);
}

static int rza1_gpio_direction_input(struct gpio_chip *chip,
Expand Down

0 comments on commit 54787d7

Please sign in to comment.