Re: [PATCH v4 1/5] gpio: pca953x: code shrink

2016-09-07 Thread Joe Perches
On Wed, 2016-09-07 at 16:49 +0200, Bartosz Golaszewski wrote: > There are multiple places in the driver code where a > switch (chip->chip_type) is used to determine the proper register > offset. > > Unduplicate the code by adding a simple structure holding the possible > offsets that differ betwee

[PATCH v4 1/5] gpio: pca953x: code shrink

2016-09-07 Thread Bartosz Golaszewski
There are multiple places in the driver code where a switch (chip->chip_type) is used to determine the proper register offset. Unduplicate the code by adding a simple structure holding the possible offsets that differ between the pca953x and pca957x chip families and use it to avoid the checks. S