From: Anton Vorontsov <cbouatmailru@gmail.com>
To: Grant Likely <grant.likely@secretlab.ca>
Cc: linuxppc-dev@ozlabs.org, Anatolij Gustschin <agust@denx.de>,
Wolfgang Denk <wd@denx.de>, Detlev Zundel <dzu@denx.de>
Subject: Re: [PATCH v2] powerpc/mpc8xxx_gpio.c: extend the driver to support mpc512x gpios
Date: Sun, 8 Aug 2010 11:40:35 +0400 [thread overview]
Message-ID: <20100808074035.GA26199@oksana.dev.rtsoft.ru> (raw)
In-Reply-To: <AANLkTim7uCTYLTwj0Gqen3dAi9iNO7te8NCs6wWj7nSi@mail.gmail.com>
On Sat, Aug 07, 2010 at 06:40:22PM -0600, Grant Likely wrote:
[...]
> > static int __init mpc8xxx_add_gpiochips(void)
> > {
> >+ const struct of_device_id *id;
> > struct device_node *np;
> >
> >- for_each_compatible_node(np, NULL, "fsl,mpc8349-gpio")
> >- mpc8xxx_add_controller(np);
> >-
> >- for_each_compatible_node(np, NULL, "fsl,mpc8572-gpio")
> >- mpc8xxx_add_controller(np);
> >-
> >- for_each_compatible_node(np, NULL, "fsl,mpc8610-gpio")
> >+ for_each_matching_node(np, mpc8xxx_gpio_ids) {
> >+ id = of_match_node(mpc8xxx_gpio_ids, np);
> >+ if (id)
> >+ np->data = id->data;
> > mpc8xxx_add_controller(np);
> >+ }
[...]
> Actually, there is absolutely no reason to keep mpc8xxx_add_gpiochip()
> as a separate function with the simplification of
> mpc8xxx_add_gpiochips(). I'd simplify the whole thing by merging the
> two functions together.
You mean mpc8xxx_add_controller()? Putting 65-line function
on a second indentation level, inside the for loop... sounds
like a bad idea.
--
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2
next prev parent reply other threads:[~2010-08-08 7:40 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-10 16:05 [PATCH V3] powerpc/mpc512x: Add gpio driver Anatolij Gustschin
2010-06-10 16:21 ` [PATCH V4] " Anatolij Gustschin
2010-06-10 21:48 ` Grant Likely
2010-06-10 22:01 ` Anatolij Gustschin
2010-06-11 8:35 ` [PATCH V5] " Anatolij Gustschin
2010-07-07 11:28 ` Peter Korsgaard
2010-07-29 7:19 ` Grant Likely
2010-07-29 7:39 ` Anatolij Gustschin
2010-08-07 13:28 ` [PATCH] powerpc/mpc8xxx_gpio.c: extend the driver to support mpc512x gpios Anatolij Gustschin
2010-08-07 15:12 ` Grant Likely
2010-08-07 16:39 ` Anatolij Gustschin
2010-08-07 16:58 ` Grant Likely
2010-08-07 19:03 ` [PATCH v2] " Anatolij Gustschin
2010-08-08 0:40 ` Grant Likely
2010-08-08 7:40 ` Anton Vorontsov [this message]
2010-08-09 5:31 ` Grant Likely
2010-08-09 5:20 ` [PATCH v3] " Anatolij Gustschin
2010-08-09 5:58 ` [PATCH v4] " Anatolij Gustschin
2010-08-09 6:20 ` Grant Likely
2010-08-20 7:00 ` Peter Korsgaard
2010-09-10 19:31 ` Grant Likely
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=20100808074035.GA26199@oksana.dev.rtsoft.ru \
--to=cbouatmailru@gmail.com \
--cc=agust@denx.de \
--cc=dzu@denx.de \
--cc=grant.likely@secretlab.ca \
--cc=linuxppc-dev@ozlabs.org \
--cc=wd@denx.de \
/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).