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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux