diff mbox series

[v2] Input: cyttsp - Make use of the helper function dev_err_probe()

Message ID 20210920103335.243-1-caihuoqing@baidu.com (mailing list archive)
State New, archived
Headers show
Series [v2] Input: cyttsp - Make use of the helper function dev_err_probe() | expand

Commit Message

Cai,Huoqing Sept. 20, 2021, 10:33 a.m. UTC
When possible use dev_err_probe help to properly deal with the
PROBE_DEFER error, the benefit is that DEFER issue will be logged
in the devices_deferred debugfs file.
Using dev_err_probe() can reduce code size, and the error value
gets printed.

Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
---
 drivers/input/touchscreen/cyttsp_core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Linus Walleij Sept. 21, 2021, 6:29 p.m. UTC | #1
On Mon, Sep 20, 2021 at 12:33 PM Cai Huoqing <caihuoqing@baidu.com> wrote:

> When possible use dev_err_probe help to properly deal with the
> PROBE_DEFER error, the benefit is that DEFER issue will be logged
> in the devices_deferred debugfs file.
> Using dev_err_probe() can reduce code size, and the error value
> gets printed.
>
> Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij
diff mbox series

Patch

diff --git a/drivers/input/touchscreen/cyttsp_core.c b/drivers/input/touchscreen/cyttsp_core.c
index 01646910c9db..661b9eb4c6a0 100644
--- a/drivers/input/touchscreen/cyttsp_core.c
+++ b/drivers/input/touchscreen/cyttsp_core.c
@@ -673,8 +673,7 @@  struct cyttsp *cyttsp_probe(const struct cyttsp_bus_ops *bus_ops,
 	ts->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW);
 	if (IS_ERR(ts->reset_gpio)) {
 		error = PTR_ERR(ts->reset_gpio);
-		dev_err_probe(dev, error, "Failed to request reset gpio\n");
-		return ERR_PTR(error);
+		return ERR_PTR(dev_err_probe(dev, error, "Failed to request reset gpio\n"));
 	}
 
 	error = cyttsp_parse_properties(ts);