lkml.org 
[lkml]   [2022]   [Mar]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] driver: pca953x: avoid error message when resuming
On Mon, Mar 7, 2022 at 5:04 PM Alifer Moraes <alifer.m@variscite.com> wrote:
>
> From: FrancescoFerraro <francesco.f@variscite.com>
>
> Avoids the error messages "pca953x 1-0020: failed reading register"
> when resuming from suspend using gpio-key attached to pca9534.

Thanks for your report and fix. My comments below.

First of all, how many of them do you get and why is it a problem?

...

> const struct pca953x_reg_config *regs;
> + int is_in_suspend;

Usually we call it is_suspended or so, check existing code by `git
grep ...`. And it can be boolean.

...

> ret = regmap_bulk_read(chip->regmap, regaddr, value, NBANK(chip));
> if (ret < 0) {
> - dev_err(&chip->client->dev, "failed reading register\n");
> + if (!chip->is_in_suspend)
> + dev_err(&chip->client->dev, "failed reading register\n");

Hmm... Maybe we can simply move it to debug level?

> return ret;
> }

...

> chip = devm_kzalloc(&client->dev, sizeof(*chip), GFP_KERNEL);
> if (chip == NULL)
> return -ENOMEM;

> + chip->is_in_suspend = 0;

Redundant change.

--
With Best Regards,
Andy Shevchenko

\
 
 \ /
  Last update: 2022-03-07 17:24    [W:1.245 / U:0.756 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site