This is a note to let you know that I've just added the patch titled pinctrl: at91: Don't mix non-devm calls with devm ones to the 6.3-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: pinctrl-at91-don-t-mix-non-devm-calls-with-devm-ones.patch and it can be found in the queue-6.3 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit c32ef4cd41120e7a4eaf3a1779fdabb058b80166 Author: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx> Date: Wed Feb 15 15:42:39 2023 +0200 pinctrl: at91: Don't mix non-devm calls with devm ones [ Upstream commit 415a099ea55ae716b69beefdcaa654b96087c016 ] Replace devm_clk_get() by devm_clk_get_enabled() and drop unneeded code pieces. This will make sure we keep the ordering of the resource allocation correct. Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx> Reviewed-by: Claudiu Beznea <claudiu.beznea@xxxxxxxxxxxxx> Tested-by: Claudiu Beznea <claudiu.beznea@xxxxxxxxxxxxx> Link: https://lore.kernel.org/r/20230215134242.37618-3-andriy.shevchenko@xxxxxxxxxxxxxxx Signed-off-by: Linus Walleij <linus.walleij@xxxxxxxxxx> Stable-dep-of: 35216718c9ac ("pinctrl: at91: fix a couple NULL vs IS_ERR() checks") Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c index 9fa68ca4a412d..f0b139a1cc3ed 100644 --- a/drivers/pinctrl/pinctrl-at91.c +++ b/drivers/pinctrl/pinctrl-at91.c @@ -1849,19 +1849,13 @@ static int at91_gpio_probe(struct platform_device *pdev) at91_chip->pioc_virq = irq; at91_chip->pioc_idx = alias_idx; - at91_chip->clock = devm_clk_get(&pdev->dev, NULL); + at91_chip->clock = devm_clk_get_enabled(&pdev->dev, NULL); if (IS_ERR(at91_chip->clock)) { dev_err(&pdev->dev, "failed to get clock, ignoring.\n"); ret = PTR_ERR(at91_chip->clock); goto err; } - ret = clk_prepare_enable(at91_chip->clock); - if (ret) { - dev_err(&pdev->dev, "failed to prepare and enable clock, ignoring.\n"); - goto clk_enable_err; - } - at91_chip->chip = at91_gpio_template; at91_chip->id = alias_idx; @@ -1882,7 +1876,7 @@ static int at91_gpio_probe(struct platform_device *pdev) names = devm_kasprintf_strarray(dev, "pio", chip->ngpio); if (!names) { ret = -ENOMEM; - goto clk_enable_err; + goto err; } for (i = 0; i < chip->ngpio; i++) @@ -1915,8 +1909,6 @@ static int at91_gpio_probe(struct platform_device *pdev) return 0; gpiochip_add_err: -clk_enable_err: - clk_disable_unprepare(at91_chip->clock); err: dev_err(&pdev->dev, "Failure %i for GPIO %i\n", ret, alias_idx);