From: Arnd Bergmann <arnd@arndb.de>
To: Jonas Jensen <jonas.jensen@gmail.com>
Cc: linux-gpio@vger.kernel.org, grant.likely@linaro.org,
linus.walleij@linaro.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, arm@kernel.org,
mark.rutland@arm.com, devicetree@vger.kernel.org
Subject: Re: [PATCH v6] gpio: Add MOXA ART GPIO driver
Date: Thu, 28 Nov 2013 17:37:32 +0100 [thread overview]
Message-ID: <201311281737.32696.arnd@arndb.de> (raw)
In-Reply-To: <1385651945-22355-1-git-send-email-jonas.jensen@gmail.com>
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.
You obviously rely on the fact that there is only one gpio_chip
in a moxart soc, which is a safe assumption, the only real disadvantage
of your approach is that it makes your driver less suitable as an
example for others to look at when they are not dealing with
just a single instance, so decide for yourself whether you want
to change it or not.
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: Thu, 28 Nov 2013 17:37:32 +0100 [thread overview]
Message-ID: <201311281737.32696.arnd@arndb.de> (raw)
In-Reply-To: <1385651945-22355-1-git-send-email-jonas.jensen@gmail.com>
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.
You obviously rely on the fact that there is only one gpio_chip
in a moxart soc, which is a safe assumption, the only real disadvantage
of your approach is that it makes your driver less suitable as an
example for others to look at when they are not dealing with
just a single instance, so decide for yourself whether you want
to change it or not.
Arnd
next prev parent reply other threads:[~2013-11-28 16:37 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 [this message]
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
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=201311281737.32696.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.