lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Wed, 23 Jul 2014 16:59:22 +0200
From:	Linus Walleij <linus.walleij@...aro.org>
To:	Wang YanQing <udknight@...il.com>,
	Greg KH <gregkh@...uxfoundation.org>,
	Linus Walleij <linus.walleij@...aro.org>,
	Johan Hovold <jhovold@...il.com>,
	"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	andi@...as.de, dforsi@...il.com
Subject: Re: [PATCH v3] usb:serial:pl2303: add GPIOs interface on PL2303

On Mon, Jul 21, 2014 at 4:46 AM, Wang YanQing <udknight@...il.com> wrote:

> PL2303HX has two GPIOs, this patch add interface for it.
>
> Signed-off-by: Wang YanQing <udknight@...il.com>
> ---
>  Changes v2-v3:
>  1: fix errors and warnings reported by Daniele Forsi checked with checkpatch.pl
>  2: fix missing GPIOLIB dependence in Kconfig
>  3: fix pl2303_gpio_get can't work
>
>  Known issue:
>  If gpios are in use(export to userspace through sysfs interface, etc),
>  then call pl2303_release(unplug usb-serial convertor, modprobe -r, etc),
>  will cause trouble, so we need to make sure there is no gpio user before
>  call pl2303_release.

The sysfs ABI is not sound, using it is a recipe for trouble.
IIRC it was merged at a time when drivers/gpio was unmaintained :-(

(...)
> +static struct gpio_chip template_chip = {
> +       .label                  = "pl2303-gpio",
> +       .owner                  = THIS_MODULE,
> +       .direction_input        = pl2303_gpio_direction_in,
> +       .get                    = pl2303_gpio_get,
> +       .direction_output       = pl2303_gpio_direction_out,
> +       .set                    = pl2303_gpio_set,
> +       .can_sleep              = 1,

This is a bool so use = true,

> +#ifdef CONFIG_USB_SERIAL_PL2303_GPIO
> +       if (spriv && spriv->gpio) {
> +               if (gpiochip_remove(&spriv->gpio->gpio_chip))
> +                       dev_err(&serial->interface->dev,
> +                               "unable to remove gpio_chip?\n");

I'm getting rid of the return code from gpiochip_remove() and have removed
the __must_check tag in the gpio tree, so just call gpiochip_remove()
unconditionally and ignore any compile error messages for now.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ