Re: [PATCH v4 1/2] gpio: add GPO driver for PCA9570

From: Sungbo Eo
Date: Thu Jul 02 2020 - 20:13:15 EST


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.