Skip to content

Commit 9320fc5

Browse files
author
Uwe Kleine-König
committed
pwm: jz4740: Don't use dev_err_probe() in .request()
dev_err_probe() is only supposed to be used in probe functions. While it probably doesn't hurt, both the EPROBE_DEFER handling and calling device_set_deferred_probe_reason() are conceptually wrong in the request callback. So replace the call by dev_err() and a separate return statement. This effectively reverts commit c0bfe96 ("pwm: jz4740: Simplify with dev_err_probe()"). Reviewed-by: Krzysztof Kozlowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Fixes: c0bfe96 ("pwm: jz4740: Simplify with dev_err_probe()") Cc: [email protected] Signed-off-by: Uwe Kleine-König <[email protected]>
1 parent a297d07 commit 9320fc5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/pwm/pwm-jz4740.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,10 @@ static int jz4740_pwm_request(struct pwm_chip *chip, struct pwm_device *pwm)
6161
snprintf(name, sizeof(name), "timer%u", pwm->hwpwm);
6262

6363
clk = clk_get(chip->dev, name);
64-
if (IS_ERR(clk))
65-
return dev_err_probe(chip->dev, PTR_ERR(clk),
66-
"Failed to get clock\n");
64+
if (IS_ERR(clk)) {
65+
dev_err(chip->dev, "error %pe: Failed to get clock\n", clk);
66+
return PTR_ERR(clk);
67+
}
6768

6869
err = clk_prepare_enable(clk);
6970
if (err < 0) {

0 commit comments

Comments
 (0)