diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2023-07-04 11:32:17 +0200 |
---|---|---|
committer | Chanwoo Choi <cw00.choi@samsung.com> | 2023-10-09 00:28:50 +0200 |
commit | 1e0731c05c985deb68a97fa44c1adcd3305dda90 (patch) | |
tree | 9ec215bbb92e14f0b84385d224122903d28b0fa1 /drivers/devfreq | |
parent | PM / devfreq: Switch to dev_pm_opp_find_freq_{ceil/floor}_indexed() APIs (diff) | |
download | linux-1e0731c05c985deb68a97fa44c1adcd3305dda90.tar.xz linux-1e0731c05c985deb68a97fa44c1adcd3305dda90.zip |
PM / devfreq: rockchip-dfi: Make pmu regmap mandatory
As a matter of fact the regmap_pmu already is mandatory because
it is used unconditionally in the driver. Bail out gracefully in
probe() rather than crashing later.
Link: https://lore.kernel.org/lkml/20230704093242.583575-2-s.hauer@pengutronix.de/
Fixes: b9d1262bca0af ("PM / devfreq: event: support rockchip dfi controller")
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Diffstat (limited to 'drivers/devfreq')
-rw-r--r-- | drivers/devfreq/event/rockchip-dfi.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/devfreq/event/rockchip-dfi.c b/drivers/devfreq/event/rockchip-dfi.c index 39ac069cabc7..74893c06aa08 100644 --- a/drivers/devfreq/event/rockchip-dfi.c +++ b/drivers/devfreq/event/rockchip-dfi.c @@ -193,14 +193,15 @@ static int rockchip_dfi_probe(struct platform_device *pdev) return dev_err_probe(dev, PTR_ERR(data->clk), "Cannot get the clk pclk_ddr_mon\n"); - /* try to find the optional reference to the pmu syscon */ node = of_parse_phandle(np, "rockchip,pmu", 0); - if (node) { - data->regmap_pmu = syscon_node_to_regmap(node); - of_node_put(node); - if (IS_ERR(data->regmap_pmu)) - return PTR_ERR(data->regmap_pmu); - } + if (!node) + return dev_err_probe(&pdev->dev, -ENODEV, "Can't find pmu_grf registers\n"); + + data->regmap_pmu = syscon_node_to_regmap(node); + of_node_put(node); + if (IS_ERR(data->regmap_pmu)) + return PTR_ERR(data->regmap_pmu); + data->dev = dev; desc = devm_kzalloc(dev, sizeof(*desc), GFP_KERNEL); |