mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-23 20:24:12 +08:00
pwm: jz4740: Don't use dev_err_probe() in .request()
commit9320fc509b
upstream. 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 commitc0bfe9606e
("pwm: jz4740: Simplify with dev_err_probe()"). Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20240106141302.1253365-2-u.kleine-koenig@pengutronix.de Fixes:c0bfe9606e
("pwm: jz4740: Simplify with dev_err_probe()") Cc: stable@vger.kernel.org Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
7baa33837e
commit
080d2c608b
@ -60,9 +60,10 @@ static int jz4740_pwm_request(struct pwm_chip *chip, struct pwm_device *pwm)
|
||||
snprintf(name, sizeof(name), "timer%u", pwm->hwpwm);
|
||||
|
||||
clk = clk_get(chip->dev, name);
|
||||
if (IS_ERR(clk))
|
||||
return dev_err_probe(chip->dev, PTR_ERR(clk),
|
||||
"Failed to get clock\n");
|
||||
if (IS_ERR(clk)) {
|
||||
dev_err(chip->dev, "error %pe: Failed to get clock\n", clk);
|
||||
return PTR_ERR(clk);
|
||||
}
|
||||
|
||||
err = clk_prepare_enable(clk);
|
||||
if (err < 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user