1217a6ce5e517cf9afbb3b8c44e6bfb5f527c91d
[openwrt/staging/nbd.git] /
1 From f91eafcb18e096108cd19d24ab71a0db5bc12416 Mon Sep 17 00:00:00 2001
2 From: Andy Shevchenko <andy.shevchenko@gmail.com>
3 Date: Fri, 29 Mar 2024 12:55:16 +0200
4 Subject: [PATCH] pinctrl: aw9523: Use correct error code for not supported
5 functionality
6
7 The pin control subsystem internally uses ENOTSUPP for the not supported
8 functionality. The checkpatch is false positive about this error code.
9
10 Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
11 Message-ID: <20240329105634.712457-3-andy.shevchenko@gmail.com>
12 Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
13 ---
14 drivers/pinctrl/pinctrl-aw9523.c | 9 +++++----
15 1 file changed, 5 insertions(+), 4 deletions(-)
16
17 --- a/drivers/pinctrl/pinctrl-aw9523.c
18 +++ b/drivers/pinctrl/pinctrl-aw9523.c
19 @@ -6,6 +6,7 @@
20 */
21
22 #include <linux/bitfield.h>
23 +#include <linux/errno.h>
24 #include <linux/gpio/consumer.h>
25 #include <linux/gpio/driver.h>
26 #include <linux/i2c.h>
27 @@ -239,7 +240,7 @@ static int aw9523_pcfg_param_to_reg(enum
28 reg = AW9523_REG_OUT_STATE(pin);
29 break;
30 default:
31 - return -EOPNOTSUPP;
32 + return -ENOTSUPP;
33 }
34 *r = reg;
35
36 @@ -290,7 +291,7 @@ static int aw9523_pconf_get(struct pinct
37 val = FIELD_GET(AW9523_GCR_GPOMD_MASK, val);
38 break;
39 default:
40 - return -EOPNOTSUPP;
41 + return -ENOTSUPP;
42 }
43 if (val < 1)
44 return -EINVAL;
45 @@ -344,7 +345,7 @@ static int aw9523_pconf_set(struct pinct
46 case PIN_CONFIG_DRIVE_OPEN_DRAIN:
47 /* Open-Drain is supported only on port 0 */
48 if (pin >= AW9523_PINS_PER_PORT) {
49 - rc = -EOPNOTSUPP;
50 + rc = -ENOTSUPP;
51 goto end;
52 }
53 mask = AW9523_GCR_GPOMD_MASK;
54 @@ -361,7 +362,7 @@ static int aw9523_pconf_set(struct pinct
55 val = AW9523_GCR_GPOMD_MASK;
56 break;
57 default:
58 - rc = -EOPNOTSUPP;
59 + rc = -ENOTSUPP;
60 goto end;
61 }
62