linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paul Bolle <pebolle@tiscali.nl>
To: Andrew Bresticker <abrestic@chromium.org>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	Alexandre Courbot <gnurou@gmail.com>,
	Ralf Baechle <ralf@linux-mips.org>,
	devicetree@vger.kernel.org, linux-gpio@vger.kernel.org,
	linux-mips@linux-mips.org, linux-kernel@vger.kernel.org,
	Ezequiel Garcia <ezequiel.garcia@imgtec.com>,
	James Hartley <james.hartley@imgtec.com>,
	James Hogan <james.hogan@imgtec.com>,
	Damien Horsley <Damien.Horsley@imgtec.com>,
	Govindraj Raja <govindraj.raja@imgtec.com>,
	Kevin Cernekee <cernekee@chromium.org>
Subject: Re: [PATCH V2 3/3] pinctrl: Add Pistachio SoC pin control driver
Date: Tue, 31 Mar 2015 10:10:15 +0200	[thread overview]
Message-ID: <1427789415.2408.45.camel@x220> (raw)
In-Reply-To: <1427757416-14491-4-git-send-email-abrestic@chromium.org>

The patch adds a mismatch between the Kconfig symbol (a bool) and the
code (which suggests that a modular build is also possible).

On Mon, 2015-03-30 at 16:16 -0700, Andrew Bresticker wrote:
> --- a/drivers/pinctrl/Kconfig
> +++ b/drivers/pinctrl/Kconfig

> +config PINCTRL_PISTACHIO
> +	def_bool y if MACH_PISTACHIO

This adds a bool symbol.

> +	select PINMUX
> +	select GENERIC_PINCONF
> +	select GPIOLIB_IRQCHIP

> --- a/drivers/pinctrl/Makefile
> +++ b/drivers/pinctrl/Makefile

> +obj-$(CONFIG_PINCTRL_PISTACHIO)	+= pinctrl-pistachio.o

So pinctrl-pistachio.o will never be part of a module.

> --- /dev/null
> +++ b/drivers/pinctrl/pinctrl-pistachio.c

> +#include <linux/module.h>

Chances are this include is not needed.

> +static struct pinctrl_desc pistachio_pinctrl_desc = {
> +	.name = "pistachio-pinctrl",
> +	.pctlops = &pistachio_pinctrl_ops,
> +	.pmxops = &pistachio_pinmux_ops,
> +	.confops = &pistachio_pinconf_ops,
> +	.owner = THIS_MODULE,

According to include/linux/export.h THIS_MODULE is equivalent to NULL,
so this can probably be dropped.

> +};

> +#define GPIO_BANK(_bank, _pin_base, _npins)				\
> +	{								\
> +		.gpio_chip = {						\
> +			.label = "GPIO" #_bank,				\
> +			.request = pistachio_gpio_request,		\
> +			.free = pistachio_gpio_free,			\
> +			.get_direction = pistachio_gpio_get_direction,	\
> +			.direction_input = pistachio_gpio_direction_input, \
> +			.direction_output = pistachio_gpio_direction_output, \
> +			.get = pistachio_gpio_get,			\
> +			.set = pistachio_gpio_set,			\
> +			.base = _pin_base,				\
> +			.ngpio = _npins,				\
> +			.owner = THIS_MODULE,				\

Ditto.

> +		},							\
> +		.irq_chip = {						\
> +			.name = "GPIO" #_bank,				\
> +			.irq_startup = pistachio_gpio_irq_startup,	\
> +			.irq_ack = pistachio_gpio_irq_ack,		\
> +			.irq_mask = pistachio_gpio_irq_mask,		\
> +			.irq_unmask = pistachio_gpio_irq_unmask,	\
> +			.irq_set_type = pistachio_gpio_irq_set_type,	\
> +		},							\
> +		.gpio_range = {						\
> +			.name = "GPIO" #_bank,				\
> +			.id = _bank,					\
> +			.base = _pin_base,				\
> +			.pin_base = _pin_base,				\
> +			.npins = _npins,				\
> +		},							\
> +	}

> +MODULE_DEVICE_TABLE(of, pistachio_pinctrl_of_match);

According to include/linux/module.h this will be preprocessed away.

> +module_platform_driver(pistachio_pinctrl_driver);

This seems to be equivalent to adding a wrapper that does
    platform_driver_register(&pistachio_pinctrl_driver);

and marking that wrapper with device_initcall(). I don't think there's
one line macro to do that.

> +MODULE_AUTHOR("Andrew Bresticker <abrestic@chromium.org>");
> +MODULE_AUTHOR("Damien Horsley <Damien.Horsley@imgtec.com>");
> +MODULE_DESCRIPTION("Pistachio pinctrl driver");
> +MODULE_LICENSE("GPL v2");

These macros will (basically) be preprocessed away.


Paul Bolle

  reply	other threads:[~2015-03-31  8:10 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-30 23:16 [PATCH V2 0/3] pinctrl: Support for IMG Pistachio Andrew Bresticker
2015-03-30 23:16 ` [PATCH V2 1/3] pinctrl: Document "function" + "pins" pinmux binding Andrew Bresticker
2015-04-07 13:20   ` Linus Walleij
2015-03-30 23:16 ` [PATCH V2 2/3] pinctrl: Add Pistachio SoC pin control binding document Andrew Bresticker
2015-03-30 23:16 ` [PATCH V2 3/3] pinctrl: Add Pistachio SoC pin control driver Andrew Bresticker
2015-03-31  8:10   ` Paul Bolle [this message]
2015-03-31 16:56     ` Andrew Bresticker
2015-03-31 18:20       ` Paul Bolle
2015-03-31 18:37         ` Andrew Bresticker
2015-03-31 18:55           ` Paul Bolle
2015-04-07 14:13       ` Linus Walleij
2015-03-31 14:00 ` [PATCH V2 0/3] pinctrl: Support for IMG Pistachio Ralf Baechle
2015-03-31 17:20   ` Andrew Bresticker
2015-04-07 13:24     ` Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1427789415.2408.45.camel@x220 \
    --to=pebolle@tiscali.nl \
    --cc=Damien.Horsley@imgtec.com \
    --cc=abrestic@chromium.org \
    --cc=cernekee@chromium.org \
    --cc=devicetree@vger.kernel.org \
    --cc=ezequiel.garcia@imgtec.com \
    --cc=gnurou@gmail.com \
    --cc=govindraj.raja@imgtec.com \
    --cc=james.hartley@imgtec.com \
    --cc=james.hogan@imgtec.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).