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:	Fri, 12 Aug 2016 15:48:34 +0200
From:	Linus Walleij <linus.walleij@...aro.org>
To:	Lucile Quirion <lucile.quirion@...oirfairelinux.com>
Cc:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
	Alexandre Courbot <gnurou@...il.com>,
	kernel <kernel@...oirfairelinux.com>
Subject: Re: [PATCH v3 2/2] gpio: add Technologic I2C-FPGA gpio support

On Thu, Aug 11, 2016 at 10:32 PM, Lucile Quirion
<lucile.quirion@...oirfairelinux.com> wrote:

> This driver is generic and aims to support all Technologic Systems's
> boards embedding FPGA GPIOs with an I2C interface.
>
> This driver supports TS-4900, TS-7970, TS-7990 and TS-4100 series.
>
> Signed-off-by: Lucile Quirion <lucile.quirion@...oirfairelinux.com>

Much smaller and nicer now :)

> +config GPIO_TS4900
> +       tristate "Technologic Systems FPGA I2C GPIO"

select REGMAP_I2C

Here.

> +#include <linux/gpio.h>

Drop that. You should not use this header in drivers.

> +static int ts4900_gpio_get_direction(struct gpio_chip *chip,
> +                                    unsigned int offset)
> +{
> +       struct ts4900_gpio_priv *priv = gpiochip_get_data(chip);
> +       unsigned int reg;
> +
> +       regmap_read(priv->regmap, offset, &reg);
> +
> +       return (reg & TS4900_GPIO_OE) ? GPIOF_DIR_OUT : GPIOF_DIR_IN;

Do not use GPIOF_DIR_OUT/GPIOF_DIR_IN. These are for the
machine descriptions, not drivers. Just return 0/1.

You can even:

return !(reg & TS4900_GPIO_OE);

I think that returns 0 on output and 1 on input.

After these fixes I will be happy I think.

Yours,
Linus Walleij

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ