bcm27xx: update patches from RPi foundation
[oweals/openwrt.git] / target / linux / bcm27xx / patches-5.4 / 950-0522-clk-bcm-rpi-Make-sure-pllb_arm-is-removed.patch
1 From aeb75ab90c35c7bd9778a71d606d52ac3e8ff02d Mon Sep 17 00:00:00 2001
2 From: Maxime Ripard <maxime@cerno.tech>
3 Date: Fri, 7 Feb 2020 15:42:40 +0100
4 Subject: [PATCH] clk: bcm: rpi: Make sure pllb_arm is removed
5
6 The pllb_arm clock was created at probe time, but was never removed if
7 something went wrong later in probe, or if the driver was ever removed from
8 the system.
9
10 Now that we are using clk_hw_register, we can just use its managed variant
11 to take care of that for us.
12
13 Cc: Michael Turquette <mturquette@baylibre.com>
14 Cc: linux-clk@vger.kernel.org
15 Acked-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
16 Reviewed-by: Stephen Boyd <sboyd@kernel.org>
17 Signed-off-by: Maxime Ripard <maxime@cerno.tech>
18 ---
19  drivers/clk/bcm/clk-raspberrypi.c | 3 +--
20  1 file changed, 1 insertion(+), 2 deletions(-)
21
22 --- a/drivers/clk/bcm/clk-raspberrypi.c
23 +++ b/drivers/clk/bcm/clk-raspberrypi.c
24 @@ -240,7 +240,7 @@ static int raspberrypi_register_pllb_arm
25  {
26         int ret;
27  
28 -       ret = clk_hw_register(rpi->dev, &raspberrypi_clk_pllb_arm.hw);
29 +       ret = devm_clk_hw_register(rpi->dev, &raspberrypi_clk_pllb_arm.hw);
30         if (ret) {
31                 dev_err(rpi->dev, "Failed to initialize pllb_arm\n");
32                 return ret;
33 @@ -250,7 +250,6 @@ static int raspberrypi_register_pllb_arm
34                                                 NULL, "cpu0");
35         if (!rpi->pllb_arm_lookup) {
36                 dev_err(rpi->dev, "Failed to initialize pllb_arm_lookup\n");
37 -               clk_hw_unregister_fixed_factor(&raspberrypi_clk_pllb_arm.hw);
38                 return -ENOMEM;
39         }
40