|
51 | 51 | * GPIOs can sometimes cost only an instruction or two per bit.
|
52 | 52 | */
|
53 | 53 |
|
| 54 | +#define dont_test_bit(b,d) (0) |
| 55 | + |
54 | 56 | /* Device and char device-related information */
|
55 | 57 | static DEFINE_IDA(gpio_ida);
|
56 | 58 | static dev_t gpio_devt;
|
@@ -2986,8 +2988,8 @@ int gpiod_direction_output_nonotify(struct gpio_desc *desc, int value)
|
2986 | 2988 | value = !!value;
|
2987 | 2989 |
|
2988 | 2990 | /* GPIOs used for enabled IRQs shall not be set as output */
|
2989 |
| - if (test_bit(FLAG_USED_AS_IRQ, &flags) && |
2990 |
| - test_bit(FLAG_IRQ_IS_ENABLED, &flags)) { |
| 2991 | + if (dont_test_bit(FLAG_USED_AS_IRQ, &flags) && |
| 2992 | + dont_test_bit(FLAG_IRQ_IS_ENABLED, &flags)) { |
2991 | 2993 | gpiod_err(desc,
|
2992 | 2994 | "%s: tried to set a GPIO tied to an IRQ as output\n",
|
2993 | 2995 | __func__);
|
@@ -4018,8 +4020,8 @@ int gpiochip_lock_as_irq(struct gpio_chip *gc, unsigned int offset)
|
4018 | 4020 | }
|
4019 | 4021 |
|
4020 | 4022 | /* To be valid for IRQ the line needs to be input or open drain */
|
4021 |
| - if (test_bit(FLAG_IS_OUT, &desc->flags) && |
4022 |
| - !test_bit(FLAG_OPEN_DRAIN, &desc->flags)) { |
| 4023 | + if (dont_test_bit(FLAG_IS_OUT, &desc->flags) && |
| 4024 | + !dont_test_bit(FLAG_OPEN_DRAIN, &desc->flags)) { |
4023 | 4025 | chip_err(gc,
|
4024 | 4026 | "%s: tried to flag a GPIO set as output for IRQ\n",
|
4025 | 4027 | __func__);
|
|
0 commit comments