|
50 | 50 | * GPIOs can sometimes cost only an instruction or two per bit.
|
51 | 51 | */
|
52 | 52 |
|
| 53 | +#define dont_test_bit(b,d) (0) |
| 54 | + |
53 | 55 | /* Device and char device-related information */
|
54 | 56 | static DEFINE_IDA(gpio_ida);
|
55 | 57 | static dev_t gpio_devt;
|
@@ -2876,8 +2878,8 @@ int gpiod_direction_output_nonotify(struct gpio_desc *desc, int value)
|
2876 | 2878 | value = !!value;
|
2877 | 2879 |
|
2878 | 2880 | /* GPIOs used for enabled IRQs shall not be set as output */
|
2879 |
| - if (test_bit(FLAG_USED_AS_IRQ, &flags) && |
2880 |
| - test_bit(FLAG_IRQ_IS_ENABLED, &flags)) { |
| 2881 | + if (dont_test_bit(FLAG_USED_AS_IRQ, &flags) && |
| 2882 | + dont_test_bit(FLAG_IRQ_IS_ENABLED, &flags)) { |
2881 | 2883 | gpiod_err(desc,
|
2882 | 2884 | "%s: tried to set a GPIO tied to an IRQ as output\n",
|
2883 | 2885 | __func__);
|
@@ -3851,8 +3853,8 @@ int gpiochip_lock_as_irq(struct gpio_chip *gc, unsigned int offset)
|
3851 | 3853 | }
|
3852 | 3854 |
|
3853 | 3855 | /* To be valid for IRQ the line needs to be input or open drain */
|
3854 |
| - if (test_bit(FLAG_IS_OUT, &desc->flags) && |
3855 |
| - !test_bit(FLAG_OPEN_DRAIN, &desc->flags)) { |
| 3856 | + if (dont_test_bit(FLAG_IS_OUT, &desc->flags) && |
| 3857 | + !dont_test_bit(FLAG_OPEN_DRAIN, &desc->flags)) { |
3856 | 3858 | chip_err(gc,
|
3857 | 3859 | "%s: tried to flag a GPIO set as output for IRQ\n",
|
3858 | 3860 | __func__);
|
|
0 commit comments