Thread (57 messages) flat view 57 messages, 5 authors, 2020-08-28

Re: [PATCH 09/24] Input: bu21013_ts - Simplify with dev_err_probe()

From: Krzysztof Kozlowski <krzk@kernel.org>
Date: 2020-08-27 18:41:46
Also in: lkml, platform-driver-x86

On Thu, Aug 27, 2020 at 12:10:38PM +0300, Andy Shevchenko wrote:
On Wed, Aug 26, 2020 at 9:19 PM Krzysztof Kozlowski [off-list ref] wrote:
quoted
Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.
quoted
        ts->cs_gpiod = devm_gpiod_get(&client->dev, "reset", GPIOD_OUT_HIGH);
        error = PTR_ERR_OR_ZERO(ts->cs_gpiod);
quoted
+       if (error)
+               return dev_err_probe(&client->dev, error, "failed to get CS GPIO\n");
+
if (IS_ERR())
 return ... PTR_ERR()...
Indeed.

Best regards,
Krzysztof
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help