All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Jonas Jensen <jonas.jensen@gmail.com>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	Grant Likely <grant.likely@linaro.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"arm@kernel.org" <arm@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>
Subject: Re: [PATCH v6] gpio: Add MOXA ART GPIO driver
Date: Fri, 29 Nov 2013 22:45:16 +0100	[thread overview]
Message-ID: <201311292245.16573.arnd@arndb.de> (raw)
In-Reply-To: <CACRpkda3bEmL+WRX1ct9SoUQOPXOT2mru0uz3-04nZB8G3DsvA@mail.gmail.com>

On Friday 29 November 2013, Linus Walleij wrote:
> On Thu, Nov 28, 2013 at 5:37 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> > On Thursday 28 November 2013, Jonas Jensen wrote:
> >> +static void __iomem *moxart_gpio_base;
> >
> > Just one comment: the usual way to do such a driver is to have
> > a derived data structure like
> >
> > struct moxart_gpio_chip {
> >         struct gpio_chip chip;
> >         void __iomem *moxart_gpio_base;
> > };
> >
> > and dynamically allocate that from probe(), using container_of() to
> > get from the gpio_chip pointer to your own structure.
> 
> I see we make this comment a lot.
> 
> On my TODO there is an item to create
> Documentation/driver-model/design-patterns.txt
> 
> And document things like this. And other fun stuff like
> container_of().
> 
> What do you think about this idea?

Great idea!

	Arnd

WARNING: multiple messages have this Message-ID (diff)
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v6] gpio: Add MOXA ART GPIO driver
Date: Fri, 29 Nov 2013 22:45:16 +0100	[thread overview]
Message-ID: <201311292245.16573.arnd@arndb.de> (raw)
In-Reply-To: <CACRpkda3bEmL+WRX1ct9SoUQOPXOT2mru0uz3-04nZB8G3DsvA@mail.gmail.com>

On Friday 29 November 2013, Linus Walleij wrote:
> On Thu, Nov 28, 2013 at 5:37 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> > On Thursday 28 November 2013, Jonas Jensen wrote:
> >> +static void __iomem *moxart_gpio_base;
> >
> > Just one comment: the usual way to do such a driver is to have
> > a derived data structure like
> >
> > struct moxart_gpio_chip {
> >         struct gpio_chip chip;
> >         void __iomem *moxart_gpio_base;
> > };
> >
> > and dynamically allocate that from probe(), using container_of() to
> > get from the gpio_chip pointer to your own structure.
> 
> I see we make this comment a lot.
> 
> On my TODO there is an item to create
> Documentation/driver-model/design-patterns.txt
> 
> And document things like this. And other fun stuff like
> container_of().
> 
> What do you think about this idea?

Great idea!

	Arnd

  reply	other threads:[~2013-11-29 21:45 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-10 13:49 [PATCH] gpio: Add MOXA ART GPIO driver Jonas Jensen
2013-07-10 13:49 ` Jonas Jensen
2013-07-16 12:00 ` [PATCH v2] " Jonas Jensen
2013-07-16 12:00   ` Jonas Jensen
2013-07-17  9:34   ` [PATCH v3] " Jonas Jensen
2013-07-17  9:34     ` Jonas Jensen
2013-07-29 13:06     ` [PATCH v4] " Jonas Jensen
2013-07-29 13:06       ` Jonas Jensen
2013-08-02 11:34       ` Mark Rutland
2013-08-02 11:34         ` Mark Rutland
2013-08-16 14:05       ` Linus Walleij
2013-08-16 14:05         ` Linus Walleij
2013-10-11 14:53       ` [PATCH v5] " Jonas Jensen
2013-10-11 14:53         ` Jonas Jensen
2013-10-11 15:44         ` Linus Walleij
2013-10-11 15:44           ` Linus Walleij
2013-10-14 11:15           ` Jonas Jensen
2013-10-14 11:15             ` Jonas Jensen
2013-10-17  9:24             ` Linus Walleij
2013-10-17  9:24               ` Linus Walleij
2013-11-28 15:19         ` [PATCH v6] " Jonas Jensen
2013-11-28 15:19           ` Jonas Jensen
2013-11-28 16:37           ` Arnd Bergmann
2013-11-28 16:37             ` Arnd Bergmann
2013-11-29 20:21             ` Linus Walleij
2013-11-29 20:21               ` Linus Walleij
2013-11-29 21:45               ` Arnd Bergmann [this message]
2013-11-29 21:45                 ` Arnd Bergmann
2013-11-29 11:11           ` [PATCH v7] " Jonas Jensen
2013-11-29 11:11             ` Jonas Jensen
     [not found]             ` <1385723494-8033-1-git-send-email-jonas.jensen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-11-29 19:06               ` Arnd Bergmann
2013-11-29 19:06                 ` Arnd Bergmann
2013-11-29 19:06                 ` Arnd Bergmann
2013-11-29 20:29             ` Linus Walleij
2013-11-29 20:29               ` Linus Walleij
2013-12-02 10:27             ` [PATCH] gpio: MOXA ART: rename moxart_gpio_base to base Jonas Jensen
2013-12-02 10:27               ` Jonas Jensen
     [not found]               ` <1385980079-20175-1-git-send-email-jonas.jensen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-12-04 12:28                 ` Linus Walleij
2013-12-04 12:28                   ` Linus Walleij
2013-12-04 12:28                   ` 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=201311292245.16573.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=arm@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=grant.likely@linaro.org \
    --cc=jonas.jensen@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.