[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f7a1960b-97b8-4a09-20bf-452e29307257@gorani.run>
Date: Fri, 3 Jul 2020 09:12:58 +0900
From: Sungbo Eo <mans0n@...ani.run>
To: Andy Shevchenko <andy.shevchenko@...il.com>
Cc: Linus Walleij <linus.walleij@...aro.org>,
Bartosz Golaszewski <bgolaszewski@...libre.com>,
Michael Walle <michael@...le.cc>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
"open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>
Subject: Re: [PATCH v4 1/2] gpio: add GPO driver for PCA9570
On 2020-07-02 21:36, Andy Shevchenko wrote:
>> + gpio->chip.ngpio = i2c_match_id(pca9570_id_table, client)->driver_data;
>
> Oh, avoid direct access to the table like this. And you may simply use
> device_get_match_data().
I'm not sure if it really does the same thing, but I'll try following
your suggestion.
> ...
>
>> + /* Read the current output level */
>> + (void) pca9570_read(gpio, &gpio->out);
>
> (void) casting is not needed. And I'm not sure hiding an error is a
> good idea. But the latter is up to you.
>
If it returns an error then it might be because the chip could not be
detected on the bus at that time. But I think aborting probe for that is
too much.
(void) casting was to indicate that I want to ignore the error, but I'll
remove it as you said.
Thanks.
Powered by blists - more mailing lists