From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752628AbbCaIK0 (ORCPT ); Tue, 31 Mar 2015 04:10:26 -0400 Received: from lb2-smtp-cloud3.xs4all.net ([194.109.24.26]:50376 "EHLO lb2-smtp-cloud3.xs4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751095AbbCaIKW (ORCPT ); Tue, 31 Mar 2015 04:10:22 -0400 Message-ID: <1427789415.2408.45.camel@x220> Subject: Re: [PATCH V2 3/3] pinctrl: Add Pistachio SoC pin control driver From: Paul Bolle To: Andrew Bresticker Cc: Linus Walleij , Alexandre Courbot , Ralf Baechle , devicetree@vger.kernel.org, linux-gpio@vger.kernel.org, linux-mips@linux-mips.org, linux-kernel@vger.kernel.org, Ezequiel Garcia , James Hartley , James Hogan , Damien Horsley , Govindraj Raja , Kevin Cernekee Date: Tue, 31 Mar 2015 10:10:15 +0200 In-Reply-To: <1427757416-14491-4-git-send-email-abrestic@chromium.org> References: <1427757416-14491-1-git-send-email-abrestic@chromium.org> <1427757416-14491-4-git-send-email-abrestic@chromium.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4 (3.10.4-4.fc20) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 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 "); > +MODULE_AUTHOR("Damien Horsley "); > +MODULE_DESCRIPTION("Pistachio pinctrl driver"); > +MODULE_LICENSE("GPL v2"); These macros will (basically) be preprocessed away. Paul Bolle