pinctrl: at91: Make at91_gpio_template const
PATCH 1/2 pinctrl: at91: Make at91_gpio_template const
This template is only assigned, so make it const.
Signed-off-by Alexander Stein <[email protected]>
--- drivers/pinctrl/pinctrl-at91.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/pinctrl-at91.c +1 -1
@@ -1660,7 +1660,7 @@ static int at91_gpio_of_irq_setup(struct platform_device *pdev, }/* This structure is replicated for each GPIO block allocated at probe time */ -static struct gpio_chip at91_gpio_template = { +static const struct gpio_chip at91_gpio_template = { .request = gpiochip_generic_request, .free = gpiochip_generic_free, .get_direction = at91_gpio_get_direction,
Signature · 1 line
2.8.1
PATCH 2/2 pinctrl: at91: Merge clk_prepare and clk_enable into clk_prepare_enable
This simplifies the normal as well as the error path.
Signed-off-by Alexander Stein <[email protected]>
--- drivers/pinctrl/pinctrl-at91.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-)
drivers/pinctrl/pinctrl-at91.c +3 -10
@@ -1730,14 +1730,9 @@ static int at91_gpio_probe(struct platform_device *pdev) goto err; } - ret =clk_prepare (at91_chip->clock); -if (ret) - goto clk_prepare_err; - -/* enable PIO controller's clock */ - ret =clk_enable (at91_chip->clock); + ret =clk_prepare_enable (at91_chip->clock);if (ret) { -dev_err (&pdev->dev,"failed to enable clock, ignoring.\n" ); +dev_err (&pdev->dev,"failed to prepare and enable clock, ignoring.\n" ); goto clk_enable_err; }
@@ -1797,10 +1792,8 @@ static int at91_gpio_probe(struct platform_device *pdev) irq_setup_err:gpiochip_remove (chip); gpiochip_add_err: -clk_disable (at91_chip->clock); clk_enable_err: -clk_unprepare (at91_chip->clock); -clk_prepare_err: +clk_disable_unprepare (at91_chip->clock); err:dev_err (&pdev->dev,"Failure %i for GPIO %i\n" , ret, alias_idx);
Signature · 1 line
2.8.1
PATCH 1/2 pinctrl: at91: Make at91_gpio_template const
In reply to Alexander SteinQuoted 3 lines · Alexander Stein
This template is only assigned, so make it const.
Signed-off-by Alexander Stein <[email protected]>
Patch applied.
Yours,
Linus Walleij
PATCH 2/2 pinctrl: at91: Merge clk_prepare and clk_enable into clk_prepare_enable
In reply to Alexander SteinQuoted 3 lines · Alexander Stein
This simplifies the normal as well as the error path.
Signed-off-by Alexander Stein <[email protected]>
Patch applied.
Yours,
Linus Walleij