]> git.baikalelectronics.ru Git - kernel.git/commit
gpio: pca953x: Correctly initialize registers 6 and 7 for PCA957x
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 30 Sep 2020 14:20:13 +0000 (17:20 +0300)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 1 Oct 2020 08:00:18 +0000 (10:00 +0200)
commit6437714c3908c003ef51ac673ccaecc11eed8e45
treed68610a7c4580748e6975bda590f901b45f1bf81
parent1bf5de4fdf66c6dbe75abe7391de358dc1f34a89
gpio: pca953x: Correctly initialize registers 6 and 7 for PCA957x

When driver has been converted to the bitmap API the non-bitmap functions
started behaving differently on 32-bit BE architectures since the bytes in
two consequent unsigned longs are in different order in comparison to byte
array. Hence if the chip had had more than 32 lines the memset() call over
it would have not set up upper lines correctly.
Although it's currently a theoretical case (no supported chips of this type
has 32+ lines), it's better to provide a clean code to avoid people thinking
this is okay and potentially producing not fully working things.

Fixes: b1a814da17f9 ("gpio: pca953x: convert to use bitmap API")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Link: https://lore.kernel.org/r/20200930142013.59247-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-pca953x.c