|
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;
|
@@ -2880,8 +2882,8 @@ int gpiod_direction_output_nonotify(struct gpio_desc *desc, int value)
|
2880 | 2882 | value = !!value;
|
2881 | 2883 |
|
2882 | 2884 | /* GPIOs used for enabled IRQs shall not be set as output */
|
2883 |
| - if (test_bit(FLAG_USED_AS_IRQ, &flags) && |
2884 |
| - test_bit(FLAG_IRQ_IS_ENABLED, &flags)) { |
| 2885 | + if (dont_test_bit(FLAG_USED_AS_IRQ, &flags) && |
| 2886 | + dont_test_bit(FLAG_IRQ_IS_ENABLED, &flags)) { |
2885 | 2887 | gpiod_err(desc,
|
2886 | 2888 | "%s: tried to set a GPIO tied to an IRQ as output\n",
|
2887 | 2889 | __func__);
|
@@ -3855,8 +3857,8 @@ int gpiochip_lock_as_irq(struct gpio_chip *gc, unsigned int offset)
|
3855 | 3857 | }
|
3856 | 3858 |
|
3857 | 3859 | /* To be valid for IRQ the line needs to be input or open drain */
|
3858 |
| - if (test_bit(FLAG_IS_OUT, &desc->flags) && |
3859 |
| - !test_bit(FLAG_OPEN_DRAIN, &desc->flags)) { |
| 3860 | + if (dont_test_bit(FLAG_IS_OUT, &desc->flags) && |
| 3861 | + !dont_test_bit(FLAG_OPEN_DRAIN, &desc->flags)) { |
3860 | 3862 | chip_err(gc,
|
3861 | 3863 | "%s: tried to flag a GPIO set as output for IRQ\n",
|
3862 | 3864 | __func__);
|
|
0 commit comments