bcm27xx: import latest patches from the RPi foundation
[openwrt/openwrt.git] / target / linux / bcm27xx / patches-5.4 / 950-0516-clk-bcm-rpi-Switch-to-clk_hw_register_clkdev.patch
1 From 2d1c30a79cb9d390d2425852ff8c9527c31b3ab8 Mon Sep 17 00:00:00 2001
2 From: Maxime Ripard <maxime@cerno.tech>
3 Date: Wed, 12 Feb 2020 14:21:45 +0100
4 Subject: [PATCH] clk: bcm: rpi: Switch to clk_hw_register_clkdev
5
6 Since we don't care about retrieving the clk_lookup structure pointer
7 returned by clkdev_hw_create, we can just use the clk_hw_register_clkdev
8 function.
9
10 Cc: Michael Turquette <mturquette@baylibre.com>
11 Cc: linux-clk@vger.kernel.org
12 Acked-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
13 Reviewed-by: Stephen Boyd <sboyd@kernel.org>
14 Signed-off-by: Maxime Ripard <maxime@cerno.tech>
15 ---
16 drivers/clk/bcm/clk-raspberrypi.c | 11 +++++------
17 1 file changed, 5 insertions(+), 6 deletions(-)
18
19 --- a/drivers/clk/bcm/clk-raspberrypi.c
20 +++ b/drivers/clk/bcm/clk-raspberrypi.c
21 @@ -237,7 +237,6 @@ static struct clk_fixed_factor raspberry
22
23 static int raspberrypi_register_pllb_arm(struct raspberrypi_clk *rpi)
24 {
25 - struct clk_lookup *pllb_arm_lookup;
26 int ret;
27
28 ret = devm_clk_hw_register(rpi->dev, &raspberrypi_clk_pllb_arm.hw);
29 @@ -246,11 +245,11 @@ static int raspberrypi_register_pllb_arm
30 return ret;
31 }
32
33 - pllb_arm_lookup = clkdev_hw_create(&raspberrypi_clk_pllb_arm.hw,
34 - NULL, "cpu0");
35 - if (!pllb_arm_lookup) {
36 - dev_err(rpi->dev, "Failed to initialize pllb_arm_lookup\n");
37 - return -ENOMEM;
38 + ret = clk_hw_register_clkdev(&raspberrypi_clk_pllb_arm.hw,
39 + NULL, "cpu0");
40 + if (ret) {
41 + dev_err(rpi->dev, "Failed to initialize clkdev\n");
42 + return ret;
43 }
44
45 return 0;