From: Artem Bityutskiy <dedekind1@gmail.com>
To: Shawn Guo <shawn.guo@freescale.com>
Cc: patches@linaro.org,
Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>,
devicetree-discuss@lists.ozlabs.org,
Grant Likely <grant.likely@secretlab.ca>,
linux-mtd@lists.infradead.org, Shawn Guo <shawn.guo@linaro.org>,
David Woodhouse <dwmw2@infradead.org>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2] mtd: dataflash: add device tree probe support
Date: Wed, 20 Jul 2011 08:32:45 +0300 [thread overview]
Message-ID: <1311139971.20738.154.camel@sauron> (raw)
In-Reply-To: <20110720052824.GB5766@S2100-06.ap.freescale.net>
On Wed, 2011-07-20 at 13:28 +0800, Shawn Guo wrote:
> On Wed, Jul 20, 2011 at 08:17:45AM +0300, Artem Bityutskiy wrote:
> > On Wed, 2011-07-20 at 12:55 +0800, Shawn Guo wrote:
> > > On Wed, Jul 20, 2011 at 07:40:38AM +0300, Artem Bityutskiy wrote:
> > > > On Fri, 2011-07-15 at 12:49 +0800, Shawn Guo wrote:
> > > > > > > +static const struct of_device_id dataflash_dt_ids[] = {
> > > > > > > + { .compatible = "atmel,at45xxx", },
> > > > > > > + { .compatible = "atmel,dataflash", },
> > > > > > > + { /* sentinel */ }
> > > > > > > +};
> > > > > > > +
> > > > > >
> > > > > > This should be protected with a #ifdef CONFIG_OF/#else/#endif, and
> > > > > > there should be a MODULE_DEVICE_TABLE().
> > > > > >
> > > > > I personally hate #ifdef stuff. But okay, I can do it since there
> > > > > are people being concerned by this little waste of space.
> > > >
> > > > I guess the question is - will it compile and work if CONFIG_OF is
> > > > unset?
> > > >
> > > Yes, it will compile, as 'struct of_device_id' is defined in
> > > include/linux/mod_devicetable.h unconditionally.
> >
> > And it will work correctly even though dataflash_dt_ids is not NULL, it
> > will not confuse MTD layer?
> >
> I think for non-dt case, dataflash_dt_ids is not used anyway. So yes,
> it will not confuse MTD layer, at least from my testing.
And it is not error-prone? I mean, it is not very likely that someone
changing MTD could make wrong assumptions and break dataflash driver? If
so, then we probably do not need ifdefs indeed.
--
Best Regards,
Artem Bityutskiy
WARNING: multiple messages have this Message-ID (diff)
From: dedekind1@gmail.com (Artem Bityutskiy)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] mtd: dataflash: add device tree probe support
Date: Wed, 20 Jul 2011 08:32:45 +0300 [thread overview]
Message-ID: <1311139971.20738.154.camel@sauron> (raw)
In-Reply-To: <20110720052824.GB5766@S2100-06.ap.freescale.net>
On Wed, 2011-07-20 at 13:28 +0800, Shawn Guo wrote:
> On Wed, Jul 20, 2011 at 08:17:45AM +0300, Artem Bityutskiy wrote:
> > On Wed, 2011-07-20 at 12:55 +0800, Shawn Guo wrote:
> > > On Wed, Jul 20, 2011 at 07:40:38AM +0300, Artem Bityutskiy wrote:
> > > > On Fri, 2011-07-15 at 12:49 +0800, Shawn Guo wrote:
> > > > > > > +static const struct of_device_id dataflash_dt_ids[] = {
> > > > > > > + { .compatible = "atmel,at45xxx", },
> > > > > > > + { .compatible = "atmel,dataflash", },
> > > > > > > + { /* sentinel */ }
> > > > > > > +};
> > > > > > > +
> > > > > >
> > > > > > This should be protected with a #ifdef CONFIG_OF/#else/#endif, and
> > > > > > there should be a MODULE_DEVICE_TABLE().
> > > > > >
> > > > > I personally hate #ifdef stuff. But okay, I can do it since there
> > > > > are people being concerned by this little waste of space.
> > > >
> > > > I guess the question is - will it compile and work if CONFIG_OF is
> > > > unset?
> > > >
> > > Yes, it will compile, as 'struct of_device_id' is defined in
> > > include/linux/mod_devicetable.h unconditionally.
> >
> > And it will work correctly even though dataflash_dt_ids is not NULL, it
> > will not confuse MTD layer?
> >
> I think for non-dt case, dataflash_dt_ids is not used anyway. So yes,
> it will not confuse MTD layer, at least from my testing.
And it is not error-prone? I mean, it is not very likely that someone
changing MTD could make wrong assumptions and break dataflash driver? If
so, then we probably do not need ifdefs indeed.
--
Best Regards,
Artem Bityutskiy
WARNING: multiple messages have this Message-ID (diff)
From: Artem Bityutskiy <dedekind1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Shawn Guo <shawn.guo-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
Cc: patches-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
Dmitry Eremin-Solenikov
<dbaryshkov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
David Woodhouse <dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH v2] mtd: dataflash: add device tree probe support
Date: Wed, 20 Jul 2011 08:32:45 +0300 [thread overview]
Message-ID: <1311139971.20738.154.camel@sauron> (raw)
In-Reply-To: <20110720052824.GB5766-+NayF8gZjK2ctlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
On Wed, 2011-07-20 at 13:28 +0800, Shawn Guo wrote:
> On Wed, Jul 20, 2011 at 08:17:45AM +0300, Artem Bityutskiy wrote:
> > On Wed, 2011-07-20 at 12:55 +0800, Shawn Guo wrote:
> > > On Wed, Jul 20, 2011 at 07:40:38AM +0300, Artem Bityutskiy wrote:
> > > > On Fri, 2011-07-15 at 12:49 +0800, Shawn Guo wrote:
> > > > > > > +static const struct of_device_id dataflash_dt_ids[] = {
> > > > > > > + { .compatible = "atmel,at45xxx", },
> > > > > > > + { .compatible = "atmel,dataflash", },
> > > > > > > + { /* sentinel */ }
> > > > > > > +};
> > > > > > > +
> > > > > >
> > > > > > This should be protected with a #ifdef CONFIG_OF/#else/#endif, and
> > > > > > there should be a MODULE_DEVICE_TABLE().
> > > > > >
> > > > > I personally hate #ifdef stuff. But okay, I can do it since there
> > > > > are people being concerned by this little waste of space.
> > > >
> > > > I guess the question is - will it compile and work if CONFIG_OF is
> > > > unset?
> > > >
> > > Yes, it will compile, as 'struct of_device_id' is defined in
> > > include/linux/mod_devicetable.h unconditionally.
> >
> > And it will work correctly even though dataflash_dt_ids is not NULL, it
> > will not confuse MTD layer?
> >
> I think for non-dt case, dataflash_dt_ids is not used anyway. So yes,
> it will not confuse MTD layer, at least from my testing.
And it is not error-prone? I mean, it is not very likely that someone
changing MTD could make wrong assumptions and break dataflash driver? If
so, then we probably do not need ifdefs indeed.
--
Best Regards,
Artem Bityutskiy
next prev parent reply other threads:[~2011-07-20 5:32 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-10 7:35 [PATCH] mtd: dataflash: add device tree probe support Shawn Guo
2011-07-10 7:35 ` Shawn Guo
2011-07-10 7:35 ` Shawn Guo
2011-07-10 8:14 ` Dmitry Eremin-Solenikov
2011-07-14 15:52 ` [PATCH v2] " Shawn Guo
2011-07-14 15:52 ` Shawn Guo
2011-07-14 15:52 ` Shawn Guo
2011-07-14 17:10 ` Mike Frysinger
2011-07-14 17:10 ` Mike Frysinger
2011-07-14 17:10 ` Mike Frysinger
2011-07-14 17:52 ` Dmitry Eremin-Solenikov
2011-07-14 17:52 ` Dmitry Eremin-Solenikov
2011-07-14 17:52 ` Dmitry Eremin-Solenikov
2011-07-15 2:54 ` Grant Likely
2011-07-15 2:54 ` Grant Likely
2011-07-15 2:54 ` Grant Likely
2011-07-15 4:42 ` Shawn Guo
2011-07-15 4:42 ` Shawn Guo
2011-07-15 4:42 ` Shawn Guo
2011-07-15 2:54 ` Grant Likely
2011-07-15 2:54 ` Grant Likely
2011-07-15 2:54 ` Grant Likely
2011-07-15 4:49 ` Shawn Guo
2011-07-15 4:49 ` Shawn Guo
2011-07-15 4:49 ` Shawn Guo
2011-07-20 4:40 ` Artem Bityutskiy
2011-07-20 4:40 ` Artem Bityutskiy
2011-07-20 4:40 ` Artem Bityutskiy
2011-07-20 4:55 ` Shawn Guo
2011-07-20 4:55 ` Shawn Guo
2011-07-20 4:55 ` Shawn Guo
2011-07-20 5:17 ` Artem Bityutskiy
2011-07-20 5:17 ` Artem Bityutskiy
2011-07-20 5:17 ` Artem Bityutskiy
2011-07-20 5:28 ` Shawn Guo
2011-07-20 5:28 ` Shawn Guo
2011-07-20 5:28 ` Shawn Guo
2011-07-20 5:32 ` Artem Bityutskiy [this message]
2011-07-20 5:32 ` Artem Bityutskiy
2011-07-20 5:32 ` Artem Bityutskiy
2011-07-20 5:38 ` Mike Frysinger
2011-07-20 5:38 ` Mike Frysinger
2011-07-20 5:38 ` Mike Frysinger
2011-07-20 5:52 ` Shawn Guo
2011-07-20 5:52 ` Shawn Guo
2011-07-20 5:52 ` Shawn Guo
2011-07-20 5:52 ` Artem Bityutskiy
2011-07-20 5:52 ` Artem Bityutskiy
2011-07-20 5:52 ` Artem Bityutskiy
2011-07-15 8:38 ` [PATCH v3] " Shawn Guo
2011-07-15 8:38 ` Shawn Guo
2011-07-15 8:38 ` Shawn Guo
2011-07-20 4:51 ` Artem Bityutskiy
2011-07-20 4:51 ` Artem Bityutskiy
2011-07-20 4:51 ` Artem Bityutskiy
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=1311139971.20738.154.camel@sauron \
--to=dedekind1@gmail.com \
--cc=dbaryshkov@gmail.com \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=dwmw2@infradead.org \
--cc=grant.likely@secretlab.ca \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mtd@lists.infradead.org \
--cc=patches@linaro.org \
--cc=shawn.guo@freescale.com \
--cc=shawn.guo@linaro.org \
/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.