Skip to content

Commit

Permalink
staging: fbtft: Don't spam logs when probe is deferred
Browse files Browse the repository at this point in the history
When requesting GPIO line the probe can be deferred.
In such case don't spam logs with an error message.
This can be achieved by switching to dev_err_probe().

Fixes: c440eee ("Staging: fbtft: Switch to the gpio descriptor interface")
Cc: Nishad Kamdar <nishadkamdar@gmail.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20210503172114.27891-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Andy Shevchenko authored and Greg Kroah-Hartman committed May 10, 2021
1 parent ec03c21 commit 37667f6
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions drivers/staging/fbtft/fbtft-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,20 +75,16 @@ static int fbtft_request_one_gpio(struct fbtft_par *par,
struct gpio_desc **gpiop)
{
struct device *dev = par->info->device;
int ret = 0;

*gpiop = devm_gpiod_get_index_optional(dev, name, index,
GPIOD_OUT_LOW);
if (IS_ERR(*gpiop)) {
ret = PTR_ERR(*gpiop);
dev_err(dev,
"Failed to request %s GPIO: %d\n", name, ret);
return ret;
}
if (IS_ERR(*gpiop))
return dev_err_probe(dev, PTR_ERR(*gpiop), "Failed to request %s GPIO\n", name);

fbtft_par_dbg(DEBUG_REQUEST_GPIOS, par, "%s: '%s' GPIO\n",
__func__, name);

return ret;
return 0;
}

static int fbtft_request_gpios(struct fbtft_par *par)
Expand Down

0 comments on commit 37667f6

Please sign in to comment.