27 Jan
2015
27 Jan
'15
6 p.m.
On Thu, Jan 22, 2015 at 12:01:54AM +0100, Thomas Niederprüm wrote:
- /* GPIOs */
- sta32x->gpiod_nreset = devm_gpiod_get(dev, "reset");
- if (IS_ERR(sta32x->gpiod_nreset)) {
ret = PTR_ERR(sta32x->gpiod_nreset);
if (ret != -ENOENT && ret != -ENOSYS)
return ret;
sta32x->gpiod_nreset = NULL;
I'll apply this but in general this pattern of replacing error pointers with NULL is a bit suspect - if the way you test for failure is IS_ERR() then just carry on using IS_ERR() all through the code to check if you got something valid, it's less likely for GPIOs but most other things can substitute in dummies and NULL can be a good way of specifying a dummy.