Skip to content

Commit 2ef26ba

Browse files
geertuYuryNorov
authored andcommitted
gpio: aspeed: Convert to common field_{get,prep}() helpers
Drop the driver-specific field_get() and field_prep() macros, in favor of the globally available variants from <linux/bitfield.h>. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Yury Norov (NVIDIA) <yury.norov@gmail.com>
1 parent 331a145 commit 2ef26ba

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

drivers/gpio/gpio-aspeed.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* Joel Stanley <joel@jms.id.au>
66
*/
77

8+
#include <linux/bitfield.h>
89
#include <linux/cleanup.h>
910
#include <linux/clk.h>
1011
#include <linux/gpio/aspeed.h>
@@ -31,12 +32,6 @@
3132
#include <linux/gpio/consumer.h>
3233
#include "gpiolib.h"
3334

34-
/* Non-constant mask variant of FIELD_GET() and FIELD_PREP() */
35-
#undef field_get
36-
#define field_get(_mask, _reg) (((_reg) & (_mask)) >> (ffs(_mask) - 1))
37-
#undef field_prep
38-
#define field_prep(_mask, _val) (((_val) << (ffs(_mask) - 1)) & (_mask))
39-
4035
#define GPIO_G7_IRQ_STS_BASE 0x100
4136
#define GPIO_G7_IRQ_STS_OFFSET(x) (GPIO_G7_IRQ_STS_BASE + (x) * 0x4)
4237
#define GPIO_G7_CTRL_REG_BASE 0x180

0 commit comments

Comments
 (0)