From: Peter Hung <hpeter@gmail.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: "Alexandre Courbot" <gnurou@gmail.com>,
"Greg KH" <gregkh@linuxfoundation.org>,
"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
"Paul Gortmaker" <paul.gortmaker@windriver.com>,
"Lee Jones" <lee.jones@linaro.org>,
"Jiri Slaby" <jslaby@suse.com>,
"Peter H" <peter_hong@fintek.com.tw>,
"Heikki Krogerus" <heikki.krogerus@linux.intel.com>,
"Peter Hurley" <peter@hurleysoftware.com>,
soeren.grunewald@desy.de, "Wang YanQing" <udknight@gmail.com>,
"Adam Lee" <adam.lee@canonical.com>,
"Arnd Bergmann" <arnd@arndb.de>,
"Joachim Eastwood" <manabian@gmail.com>,
"Scott Wood" <scottwood@freescale.com>,
"Masahiro Yamada" <yamada.masahiro@socionext.com>,
"Paul Burton" <paul.burton@imgtec.com>,
"Måns Rullgård" <mans@mansr.com>,
"Matthias Brugger" <matthias.bgg@gmail.com>,
"Ralf Baechle" <ralf@linux-mips.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
linux-gpio@vger.kernel.o
Subject: Re: [PATCH V2 2/4] gpio: gpio-f81504: Add Fintek F81504/508/512 PCIE-to-UART/GPIO GPIOLIB support
Date: Tue, 16 Feb 2016 15:03:55 +0800 [thread overview]
Message-ID: <56C2C9DB.8020302@gmail.com> (raw)
In-Reply-To: <CACRpkdZ7DAP6a8scUSGxNBdAMHjtRUOcOYbEB15PK1QHBdQdUA@mail.gmail.com>
Hi Linus,
Linus Walleij 於 2016/2/10 下午 05:08 寫道:
> On Thu, Jan 28, 2016 at 10:20 AM, Peter Hung <hpeter@gmail.com> wrote:
>> +#include <linux/platform_device.h>
>> +#include <linux/gpio.h>
>
> Drivers should just
> #include <linux/gpio/driver.h>
ok.
>> +static struct f81504_gpio_chip *gpio_to_f81504_chip(struct gpio_chip *chip)
>> +{
>> + return container_of(chip, struct f81504_gpio_chip, chip);
>> +}
>
> Avoid this construction in new code.
>
> Use gpiochip_get_data(chip) everywhere that gpio_to_f81504_chip()
> is used and register the gpiochip with gpiochip_add_data()
> and the code will be simpler.
>
> See any other driver in drivers/gpio for examples, I converted them
> all.
ok. I'll re-write this section.
>> +
>> + if (tmp & BIT(offset))
>> + return GPIOF_DIR_OUT;
>> +
>> + return GPIOF_DIR_IN;
>> +}
>
> Do not use GPIOF* flags in driver code, these are for the consumer
> API. Just return 0/1.
ok
>> + status = gpiochip_add(&gc->chip);
>
> As mentioned, use gpiochip_add_data(&gc->chip, gc);
>
ok.
>> +static struct platform_driver f81504_gpio_driver = {
>> + .driver = {
>> + .name = F81504_GPIO_NAME,
>> + .owner = THIS_MODULE,
>
> I saw coccinelle was already complaining about this.
>
> Looking forward to v3!
I had sent V3 today to resolve the issue above.
Thanks for your advices.
--
With Best Regards,
Peter Hung
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2016-02-16 7:03 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-28 9:20 [PATCH V2 0/4] Transform Fintek PCIE driver from 8250 to MFD Peter Hung
2016-01-28 9:20 ` [PATCH V2 1/4] mfd: f81504-core: Add Fintek F81504/508/512 PCIE-to-UART/GPIO core support Peter Hung
2016-01-28 10:04 ` One Thousand Gnomes
2016-01-29 2:22 ` Peter Hung
2016-01-28 11:55 ` Andy Shevchenko
2016-01-29 5:50 ` Peter Hung
2016-01-29 8:21 ` Lee Jones
2016-01-29 13:41 ` Andy Shevchenko
2016-02-01 2:51 ` Peter Hung
2016-01-28 9:20 ` [PATCH V2 2/4] gpio: gpio-f81504: Add Fintek F81504/508/512 PCIE-to-UART/GPIO GPIOLIB support Peter Hung
2016-01-28 9:54 ` [PATCH] gpio: gpio-f81504: fix platform_no_drv_owner.cocci warnings kbuild test robot
2016-01-28 9:54 ` [PATCH V2 2/4] gpio: gpio-f81504: Add Fintek F81504/508/512 PCIE-to-UART/GPIO GPIOLIB support kbuild test robot
2016-01-28 12:03 ` Andy Shevchenko
2016-01-29 8:15 ` Peter Hung
2016-02-10 9:08 ` Linus Walleij
2016-02-16 7:03 ` Peter Hung [this message]
2016-01-28 9:20 ` [PATCH V2 3/4] 8250: 8250_f81504: Add Fintek F81504/508/512 PCIE-to-UART/GPIO UART support Peter Hung
2016-01-28 10:17 ` One Thousand Gnomes
2016-01-28 11:06 ` [PATCH] 8250: 8250_f81504: fix platform_no_drv_owner.cocci warnings kbuild test robot
2016-01-28 11:06 ` [PATCH V2 3/4] 8250: 8250_f81504: Add Fintek F81504/508/512 PCIE-to-UART/GPIO UART support kbuild test robot
2016-01-28 9:20 ` [PATCH V2 4/4] serial: 8250_pci: Remove Fintek F81504/508/512 UART driver Peter Hung
2016-01-28 12:04 ` Andy Shevchenko
2016-01-29 8:20 ` Peter Hung
2016-01-29 12:40 ` Andy Shevchenko
2016-02-01 3:33 ` Peter Hung
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=56C2C9DB.8020302@gmail.com \
--to=hpeter@gmail.com \
--cc=adam.lee@canonical.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=arnd@arndb.de \
--cc=gnurou@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=jslaby@suse.com \
--cc=lee.jones@linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.o \
--cc=linux-kernel@vger.kernel.org \
--cc=manabian@gmail.com \
--cc=mans@mansr.com \
--cc=matthias.bgg@gmail.com \
--cc=paul.burton@imgtec.com \
--cc=paul.gortmaker@windriver.com \
--cc=peter@hurleysoftware.com \
--cc=peter_hong@fintek.com.tw \
--cc=ralf@linux-mips.org \
--cc=scottwood@freescale.com \
--cc=soeren.grunewald@desy.de \
--cc=udknight@gmail.com \
--cc=yamada.masahiro@socionext.com \
/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).