bcm27xx: import latest patches from the RPi foundation
[openwrt/openwrt.git] / target / linux / bcm27xx / patches-5.4 / 950-0517-clk-bcm-rpi-Make-sure-the-clkdev-lookup-is-removed.patch
1 From 31fe609e3f5f9d4e52f0f88f8ebfd20fb606c672 Mon Sep 17 00:00:00 2001
2 From: Maxime Ripard <maxime@cerno.tech>
3 Date: Fri, 7 Feb 2020 15:47:13 +0100
4 Subject: [PATCH] clk: bcm: rpi: Make sure the clkdev lookup is removed
5
6 The clkdev lookup created for the cpufreq device is never removed if
7 there's an issue later in probe or at module removal time.
8
9 Let's convert to the managed variant of the clk_hw_register_clkdev function
10 to make sure it happens.
11
12 Cc: Michael Turquette <mturquette@baylibre.com>
13 Cc: linux-clk@vger.kernel.org
14 Acked-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
15 Reviewed-by: Stephen Boyd <sboyd@kernel.org>
16 Signed-off-by: Maxime Ripard <maxime@cerno.tech>
17 ---
18 drivers/clk/bcm/clk-raspberrypi.c | 5 +++--
19 1 file changed, 3 insertions(+), 2 deletions(-)
20
21 --- a/drivers/clk/bcm/clk-raspberrypi.c
22 +++ b/drivers/clk/bcm/clk-raspberrypi.c
23 @@ -245,8 +245,9 @@ static int raspberrypi_register_pllb_arm
24 return ret;
25 }
26
27 - ret = clk_hw_register_clkdev(&raspberrypi_clk_pllb_arm.hw,
28 - NULL, "cpu0");
29 + ret = devm_clk_hw_register_clkdev(rpi->dev,
30 + &raspberrypi_clk_pllb_arm.hw,
31 + NULL, "cpu0");
32 if (ret) {
33 dev_err(rpi->dev, "Failed to initialize clkdev\n");
34 return ret;