From: Sascha Wildner Date: Fri, 6 Jul 2012 17:43:50 +0000 (+0200) Subject: kernel/gpio: Return EINVAL for GPIOPINUNSET and simplify a bit. X-Git-Tag: v3.2.0~661 X-Git-Url: https://gitweb.dragonflybsd.org/~tuxillo/dragonfly.git/commitdiff_plain/06cdb70d3c2d4585f58c8f08e050a5d105d1bbb6 kernel/gpio: Return EINVAL for GPIOPINUNSET and simplify a bit. --- diff --git a/sys/dev/misc/gpio/gpio.c b/sys/dev/misc/gpio/gpio.c index a317a7b02f..c91301dd30 100644 --- a/sys/dev/misc/gpio/gpio.c +++ b/sys/dev/misc/gpio/gpio.c @@ -392,15 +392,14 @@ gpio_ioctl(struct dev_ioctl_args *ap) struct gpio *gp; gpio_pin_t *pin; cdev_t dev; - int error = 0; dev = ap->a_head.a_dev; + gpsa = (struct gpio_pin_set_args *)ap->a_data; gp = dev->si_drv1; pin = dev->si_drv2; switch(ap->a_cmd) { case GPIOPINSET: - gpsa = (struct gpio_pin_set_args *)ap->a_data; if (pin->pin_opened || pin->pin_mapped) return EBUSY; @@ -417,8 +416,7 @@ gpio_ioctl(struct dev_ioctl_args *ap) break; case GPIOPINUNSET: - gpsa = (struct gpio_pin_set_args *)ap->a_data; - error = EINVAL; + return EINVAL; break; default: