hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/gpio/gpio-altera-a10sr.c
....@@ -1,17 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright Intel Corporation (C) 2014-2016. All Rights Reserved
3
- *
4
- * This program is free software; you can redistribute it and/or modify it
5
- * under the terms and conditions of the GNU General Public License,
6
- * version 2, as published by the Free Software Foundation.
7
- *
8
- * This program is distributed in the hope it will be useful, but WITHOUT
9
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11
- * more details.
12
- *
13
- * You should have received a copy of the GNU General Public License along with
14
- * this program. If not, see <http://www.gnu.org/licenses/>.
154 *
165 * GPIO driver for Altera Arria10 MAX5 System Resource Chip
176 *
....@@ -58,19 +47,20 @@
5847 static int altr_a10sr_gpio_direction_input(struct gpio_chip *gc,
5948 unsigned int nr)
6049 {
61
- if (nr >= (ALTR_A10SR_IN_VALID_RANGE_LO - ALTR_A10SR_LED_VALID_SHIFT))
62
- return 0;
63
- return -EINVAL;
50
+ if (nr < (ALTR_A10SR_IN_VALID_RANGE_LO - ALTR_A10SR_LED_VALID_SHIFT))
51
+ return -EINVAL;
52
+
53
+ return 0;
6454 }
6555
6656 static int altr_a10sr_gpio_direction_output(struct gpio_chip *gc,
6757 unsigned int nr, int value)
6858 {
69
- if (nr <= (ALTR_A10SR_OUT_VALID_RANGE_HI - ALTR_A10SR_LED_VALID_SHIFT)) {
70
- altr_a10sr_gpio_set(gc, nr, value);
71
- return 0;
72
- }
73
- return -EINVAL;
59
+ if (nr > (ALTR_A10SR_OUT_VALID_RANGE_HI - ALTR_A10SR_LED_VALID_SHIFT))
60
+ return -EINVAL;
61
+
62
+ altr_a10sr_gpio_set(gc, nr, value);
63
+ return 0;
7464 }
7565
7666 static const struct gpio_chip altr_a10sr_gc = {