Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Sascha Hauer and committed by
Chanwoo Choi
1e0731c0 8b3bd6ff

+8 -7
+8 -7
drivers/devfreq/event/rockchip-dfi.c
··· 193 193 return dev_err_probe(dev, PTR_ERR(data->clk), 194 194 "Cannot get the clk pclk_ddr_mon\n"); 195 195 196 - /* try to find the optional reference to the pmu syscon */ 197 196 node = of_parse_phandle(np, "rockchip,pmu", 0); 198 - if (node) { 199 - data->regmap_pmu = syscon_node_to_regmap(node); 200 - of_node_put(node); 201 - if (IS_ERR(data->regmap_pmu)) 202 - return PTR_ERR(data->regmap_pmu); 203 - } 197 + if (!node) 198 + return dev_err_probe(&pdev->dev, -ENODEV, "Can't find pmu_grf registers\n"); 199 + 200 + data->regmap_pmu = syscon_node_to_regmap(node); 201 + of_node_put(node); 202 + if (IS_ERR(data->regmap_pmu)) 203 + return PTR_ERR(data->regmap_pmu); 204 + 204 205 data->dev = dev; 205 206 206 207 desc = devm_kzalloc(dev, sizeof(*desc), GFP_KERNEL);