* [PATCH 1/2] pinctrl: at91: Make at91_gpio_template const
@ 2016-04-29 12:50 Alexander Stein
2016-04-29 12:50 ` [PATCH 2/2] pinctrl: at91: Merge clk_prepare and clk_enable into clk_prepare_enable Alexander Stein
2016-05-02 11:52 ` [PATCH 1/2] pinctrl: at91: Make at91_gpio_template const Linus Walleij
0 siblings, 2 replies; 4+ messages in thread
From: Alexander Stein @ 2016-04-29 12:50 UTC (permalink / raw)
To: Jean-Christophe Plagniol-Villard, Linus Walleij
Cc: Alexander Stein, linux-arm-kernel, linux-gpio
This template is only assigned, so make it const.
Signed-off-by: Alexander Stein <alexanders83@web.de>
---
drivers/pinctrl/pinctrl-at91.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c
index 523b6b794d1f..29d57118e35c 100644
--- a/drivers/pinctrl/pinctrl-at91.c
+++ b/drivers/pinctrl/pinctrl-at91.c
@@ -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,
--
2.8.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] pinctrl: at91: Merge clk_prepare and clk_enable into clk_prepare_enable
2016-04-29 12:50 [PATCH 1/2] pinctrl: at91: Make at91_gpio_template const Alexander Stein
@ 2016-04-29 12:50 ` Alexander Stein
2016-05-02 11:53 ` Linus Walleij
2016-05-02 11:52 ` [PATCH 1/2] pinctrl: at91: Make at91_gpio_template const Linus Walleij
1 sibling, 1 reply; 4+ messages in thread
From: Alexander Stein @ 2016-04-29 12:50 UTC (permalink / raw)
To: Jean-Christophe Plagniol-Villard, Linus Walleij
Cc: Alexander Stein, linux-arm-kernel, linux-gpio
This simplifies the normal as well as the error path.
Signed-off-by: Alexander Stein <alexanders83@web.de>
---
drivers/pinctrl/pinctrl-at91.c | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c
index 29d57118e35c..e380333dad46 100644
--- a/drivers/pinctrl/pinctrl-at91.c
+++ b/drivers/pinctrl/pinctrl-at91.c
@@ -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);
--
2.8.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] pinctrl: at91: Make at91_gpio_template const
2016-04-29 12:50 [PATCH 1/2] pinctrl: at91: Make at91_gpio_template const Alexander Stein
2016-04-29 12:50 ` [PATCH 2/2] pinctrl: at91: Merge clk_prepare and clk_enable into clk_prepare_enable Alexander Stein
@ 2016-05-02 11:52 ` Linus Walleij
1 sibling, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2016-05-02 11:52 UTC (permalink / raw)
To: Alexander Stein
Cc: Jean-Christophe Plagniol-Villard,
linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org
On Fri, Apr 29, 2016 at 2:50 PM, Alexander Stein <alexanders83@web.de> wrote:
> This template is only assigned, so make it const.
>
> Signed-off-by: Alexander Stein <alexanders83@web.de>
Patch applied.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-05-02 11:53 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-29 12:50 [PATCH 1/2] pinctrl: at91: Make at91_gpio_template const Alexander Stein
2016-04-29 12:50 ` [PATCH 2/2] pinctrl: at91: Merge clk_prepare and clk_enable into clk_prepare_enable Alexander Stein
2016-05-02 11:53 ` Linus Walleij
2016-05-02 11:52 ` [PATCH 1/2] pinctrl: at91: Make at91_gpio_template const Linus Walleij
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).