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] [thread-next>] [day] [month] [year] [list]
Message-ID: <4071167.An8CoV6UJC@wuerfel>
Date:	Fri, 17 Apr 2015 16:53:31 +0200
From:	Arnd Bergmann <arnd@...db.de>
To:	Alban Bedel <albeu@...e.fr>
Cc:	linux-mips@...ux-mips.org, Rob Herring <robh+dt@...nel.org>,
	Pawel Moll <pawel.moll@....com>,
	Mark Rutland <mark.rutland@....com>,
	Ian Campbell <ijc+devicetree@...lion.org.uk>,
	Kumar Gala <galak@...eaurora.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	Jason Cooper <jason@...edaemon.net>,
	Ralf Baechle <ralf@...ux-mips.org>,
	Andrew Bresticker <abrestic@...omium.org>,
	Qais Yousef <qais.yousef@...tec.com>,
	devicetree@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 11/14] MIPS: ath79: Add OF support to the GPIO driver

On Friday 17 April 2015 16:24:26 Alban Bedel wrote:
> Replace the simple GPIO chip registration by a platform driver
> and make ath79_gpio_init() just register the device.
> 
> Signed-off-by: Alban Bedel <albeu@...e.fr>
> ---
>  arch/mips/ath79/dev-common.c | 13 ++++++++
>  arch/mips/ath79/gpio.c       | 73 +++++++++++++++++++++++++++++++++++++++++---
>  2 files changed, 81 insertions(+), 5 deletions(-)

Could you move the driver to drivers/gpio/ now?

> +void __init ath79_gpio_init(void)
> +{
> +	struct resource res;
> +
> +	memset(&res, 0, sizeof(res));
> +
> +	res.flags = IORESOURCE_MEM;
> +	res.start = AR71XX_GPIO_BASE;
> +	res.end = res.start + AR71XX_GPIO_SIZE - 1;
> +
> +	platform_device_register_simple("ath79-gpio", -1, &res, 1);
> +}

Your code looks correct, but could be shortened to 

	struct resource mem = DEFINE_RES_MEM(AR71XX_GPIO_BASE, AR71XX_GPIO_SIZE);

>  
> -void __init ath79_gpio_init(void)
> +static const struct of_device_id ath79_gpio_of_match[] = {
> +	{
> +		.compatible = "qca,ar7100-gpio",
> +		.data = (void *)AR71XX_GPIO_COUNT,
> +	},
> +	{
> +		.compatible = "qca,ar7240-gpio",
> +		.data = (void *)AR7240_GPIO_COUNT,
> +	},
> +	{
> +		.compatible = "qca,ar7241-gpio",
> +		.data = (void *)AR7241_GPIO_COUNT,
> +	},
> +	{
> +		.compatible = "qca,ar9130-gpio",
> +		.data = (void *)AR913X_GPIO_COUNT,
> +	},
> +	{
> +		.compatible = "qca,ar9330-gpio",
> +		.data = (void *)AR933X_GPIO_COUNT,
> +	},
> +	{
> +		.compatible = "qca,ar9340-gpio",
> +		.data = (void *)AR934X_GPIO_COUNT,
> +	},
> +	{
> +		.compatible = "qca,qca9550-gpio",
> +		.data = (void *)QCA955X_GPIO_COUNT,
> +	},
> +	{},
> +};

How about putting the number into an 'ngpios' property like some other
bindings do?

	Arnd
--
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