OSDN Git Service

gpio: xilinx: Switch to use bitmap APIs
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 10 May 2021 19:46:32 +0000 (22:46 +0300)
committerBartosz Golaszewski <bgolaszewski@baylibre.com>
Wed, 12 May 2021 11:54:12 +0000 (13:54 +0200)
commit02b3f84d9080b0f4297f31258307f626a43faba5
tree7b026cbe9a23a0f1db040faf3fedc673f7f0a993
parent043aa3db1cbb51251849c262c4c549b665ad93de
gpio: xilinx: Switch to use bitmap APIs

It seems that Xilinx GPIO driver operates with bit arrays longer than 32 and
thus can leverage bitmap APIs for that. It makes code better to understand.

The ->probe() function is modified to try read properties for both channels
since is_dual check makes only sense for the amount of pins used for the second
channel. On top of that kzalloc() guarantees zero initial values for the fields
in the private data structure, hence drop unneeded conditionals and assignments.

The change is inspired by Syed Nayyar Waris' ideas about bitmap API extension.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Neeli Srinivas <sneeli@xilinx.com>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
drivers/gpio/gpio-xilinx.c