]> git.baikalelectronics.ru Git - kernel.git/commit
staging: mt7621-gpio: fix masks for gpio pin
authorSergio Paracuellos <sergio.paracuellos@gmail.com>
Fri, 25 May 2018 16:54:49 +0000 (18:54 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 1 Jun 2018 09:17:05 +0000 (11:17 +0200)
commit7a5810eba16aab7f5562ff87eb7fc4edcf7ded3c
tree2f1fcfb03e4a0a3004d7f31c95cf5d6633d36aca
parent9a6daeb2418e09e85ead881bc7b49d7ec6e59972
staging: mt7621-gpio: fix masks for gpio pin

BIT macro is being used to get mask for gpio's pin
which is retrieved using 'hwirq' from struct irq_data.
The problem here is that 'hwirq' can be as large as 95,
and 1UL << 95 is unlikely to work well. Instead of using
BIT macro use a new PIN_MASK macro which takes into account
pin and WIDTH of the bank in order to make a proper mask for
the gpio pin. Also 'd->hwirq' has been replaced by 'pin' in
some places because there was a 'pin' variable in changed
functions with the proper value. This improves readability.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/mt7621-gpio/gpio-mt7621.c