|
24 | 24 | static const char cros_ec_gpio_prefix[] = "EC:";
|
25 | 25 |
|
26 | 26 | /* Setting gpios is only supported when the system is unlocked */
|
27 |
| -static void cros_ec_gpio_set(struct gpio_chip *gc, unsigned int gpio, int val) |
| 27 | +static int cros_ec_gpio_set(struct gpio_chip *gc, unsigned int gpio, int val) |
28 | 28 | {
|
29 | 29 | const char *name = gc->names[gpio] + strlen(cros_ec_gpio_prefix);
|
30 | 30 | struct cros_ec_device *cros_ec = gpiochip_get_data(gc);
|
31 | 31 | struct ec_params_gpio_set params = {
|
32 | 32 | .val = val,
|
33 | 33 | };
|
34 |
| - int ret; |
35 | 34 | ssize_t copied;
|
36 | 35 |
|
37 | 36 | copied = strscpy(params.name, name, sizeof(params.name));
|
38 | 37 | if (copied < 0)
|
39 |
| - return; |
| 38 | + return copied; |
40 | 39 |
|
41 |
| - ret = cros_ec_cmd(cros_ec, 0, EC_CMD_GPIO_SET, ¶ms, |
42 |
| - sizeof(params), NULL, 0); |
43 |
| - if (ret < 0) |
44 |
| - dev_err(gc->parent, "error setting gpio%d (%s) on EC: %d\n", gpio, name, ret); |
| 40 | + return cros_ec_cmd(cros_ec, 0, EC_CMD_GPIO_SET, ¶ms, |
| 41 | + sizeof(params), NULL, 0); |
45 | 42 | }
|
46 | 43 |
|
47 | 44 | static int cros_ec_gpio_get(struct gpio_chip *gc, unsigned int gpio)
|
@@ -191,7 +188,7 @@ static int cros_ec_gpio_probe(struct platform_device *pdev)
|
191 | 188 | gc->can_sleep = true;
|
192 | 189 | gc->label = dev_name(dev);
|
193 | 190 | gc->base = -1;
|
194 |
| - gc->set = cros_ec_gpio_set; |
| 191 | + gc->set_rv = cros_ec_gpio_set; |
195 | 192 | gc->get = cros_ec_gpio_get;
|
196 | 193 | gc->get_direction = cros_ec_gpio_get_direction;
|
197 | 194 |
|
|
0 commit comments