Skip to content

Commit 9d55cb3

Browse files
krzkdlezcano
authored andcommitted
thermal/drivers/broadcom: Simplify with dev_err_probe()
Error handling in probe() can be a bit simpler with dev_err_probe(). Signed-off-by: Krzysztof Kozlowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Daniel Lezcano <[email protected]>
1 parent fd972a1 commit 9d55cb3

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

drivers/thermal/broadcom/bcm2835_thermal.c

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -186,12 +186,8 @@ static int bcm2835_thermal_probe(struct platform_device *pdev)
186186
}
187187

188188
data->clk = devm_clk_get_enabled(dev, NULL);
189-
if (IS_ERR(data->clk)) {
190-
err = PTR_ERR(data->clk);
191-
if (err != -EPROBE_DEFER)
192-
dev_err(dev, "Could not get clk: %d\n", err);
193-
return err;
194-
}
189+
if (IS_ERR(data->clk))
190+
return dev_err_probe(dev, PTR_ERR(data->clk), "Could not get clk\n");
195191

196192
rate = clk_get_rate(data->clk);
197193
if ((rate < 1920000) || (rate > 5000000))
@@ -201,11 +197,8 @@ static int bcm2835_thermal_probe(struct platform_device *pdev)
201197

202198
/* register of thermal sensor and get info from DT */
203199
tz = devm_thermal_of_zone_register(dev, 0, data, &bcm2835_thermal_ops);
204-
if (IS_ERR(tz)) {
205-
err = PTR_ERR(tz);
206-
dev_err(dev, "Failed to register the thermal device: %d\n", err);
207-
return err;
208-
}
200+
if (IS_ERR(tz))
201+
return dev_err_probe(dev, PTR_ERR(tz), "Failed to register the thermal device\n");
209202

210203
/*
211204
* right now the FW does set up the HW-block, so we are not

0 commit comments

Comments
 (0)