Re: [PATCH] Input: cyttsp - Make use of the helper function dev_err_probe()
From: Linus Walleij <hidden>
Date: 2021-09-19 19:28:57
Also in:
lkml
From: Linus Walleij <hidden>
Date: 2021-09-19 19:28:57
Also in:
lkml
On Fri, Sep 17, 2021 at 3:35 AM Cai Huoqing [off-list ref] wrote:
On 17 9月 21 00:30:32, Linus Walleij wrote:quoted
On Thu, Sep 16, 2021 at 5:32 PM Cai Huoqing [off-list ref] wrote:quoted
if (IS_ERR(ts->reset_gpio)) { error = PTR_ERR(ts->reset_gpio); - dev_err(dev, "Failed to request reset gpio, error %d\n", error); + dev_err_probe(dev, error, "Failed to request reset gpio\n"); return ERR_PTR(error);In this case you're supposed to do return dev_err_probe(dev, error, "Failed to request reset gpio\n");the probe function is defined: "struct cyttsp *cyttsp_probe(" so it is required to return a PTR:cyttsp *.
What about return ERR_PTR(dev_err_probe(dev, error, "Failed to request reset gpio\n")); Yours, Linus Walleij