hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/gpio/gpio-reg.c
....@@ -1,11 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * gpio-reg: single register individually fixed-direction GPIOs
34 *
45 * Copyright (C) 2016 Russell King
5
- *
6
- * This software is licensed under the terms of the GNU General Public
7
- * License version 2, as published by the Free Software Foundation, and
8
- * may be copied, distributed, and modified under those terms.
96 */
107 #include <linux/gpio/driver.h>
118 #include <linux/gpio/gpio-reg.h>
....@@ -29,7 +26,8 @@
2926 {
3027 struct gpio_reg *r = to_gpio_reg(gc);
3128
32
- return r->direction & BIT(offset) ? 1 : 0;
29
+ return r->direction & BIT(offset) ? GPIO_LINE_DIRECTION_IN :
30
+ GPIO_LINE_DIRECTION_OUT;
3331 }
3432
3533 static int gpio_reg_direction_output(struct gpio_chip *gc, unsigned offset,