From: greg@kroah.com (Greg KH)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/6] drivers/base: add bus for System-on-Chip devices
Date: Fri, 20 Jan 2012 13:20:22 -0500 [thread overview]
Message-ID: <20120120182022.GB9999@kroah.com> (raw)
In-Reply-To: <CANmRt2gZe7dfRe5T8fS-1LGkeQXOBzcrbzL8xU+J9M7X4ZuDrA@mail.gmail.com>
On Fri, Jan 20, 2012 at 05:13:33PM +0000, Lee Jones wrote:
[hint, turn off html in gmail, your messages are not getting through to
the mailing lists...]
> On Fri, Jan 20, 2012 at 4:36 PM, Greg KH <greg@kroah.com> wrote:
>
> > On Fri, Jan 20, 2012 at 04:10:25PM +0000, Lee Jones wrote:
> > > +struct soc_device *soc_device_register(struct soc_device_attribute
> > *soc_dev_attr)
> > > +{
> > > + struct soc_device *soc_dev;
> > > + int ret;
> > > + int i, j = 0;
> > > +
> > > + soc_dev = kzalloc(sizeof(*soc_dev), GFP_KERNEL);
> > > + if (!soc_dev) {
> > > + ret = -ENOMEM;
> > > + goto out1;
> > > + }
> > > +
> > > + /* Ensure no empty attributes are created. */
> > > + for (i = 0; i < sizeof(*soc_attr); i++) {
> > > + if ( soc_attr[i] != NULL ) {
> > > + soc_attr[j++] = soc_attr[i];
> > > + }
> > > + }
> > > + for (i = j; i < sizeof(*soc_attr); i++) {
> > > + soc_attr[i] = NULL;
> > > + }
> >
> > Huh?
> >
> > Ick, no, don't do this, that's just looney. Use the api WE ALREADY HAVE
> > for this type of thing.
> >
> > Sometimes I wonder why we even write core code, if people just ignore it
> > and try to do it on their own...
> >
>
> Sorry. Just another splash of ignorance on my part.
>
> If I would have known about an API to use, I would have used it (as it
> would have saved me time).
>
> I'll go mindlessly grepping for things that my be of use and replace it.
>
> (Of course a hint wouldn't go a miss if you're feeling charitable - every
> day's a school day and all that.) :)
Hey, I offered to write this whole chunk of code myself in the past, and
that was rejected, so I'm not feeling all that generous myself...
But I'll be nice, just this once.
Look at the is_visible() callback in the attribute group structure, that
is what you want to set.
You owe me a beer.
greg k-h
next prev parent reply other threads:[~2012-01-20 18:20 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-20 16:10 [PATCH 0/6] ux500: Export SoC information and some platform clean-up Lee Jones
2012-01-20 16:10 ` [PATCH 1/6] mach-ux500: pass parent pointer to each platform device Lee Jones
2012-01-20 16:10 ` [PATCH 2/6] drivers/base: add bus for System-on-Chip devices Lee Jones
2012-01-20 16:36 ` Greg KH
[not found] ` <CANmRt2gZe7dfRe5T8fS-1LGkeQXOBzcrbzL8xU+J9M7X4ZuDrA@mail.gmail.com>
2012-01-20 18:20 ` Greg KH [this message]
2012-01-20 16:39 ` Greg KH
[not found] ` <CANmRt2j4woAAg3dEtyQG4rjxRQ5Sx+4OW84Mathk4_YrFTjChQ@mail.gmail.com>
2012-01-20 18:10 ` Greg KH
2012-01-20 16:10 ` [PATCH 3/6] Documentation: add information for new sysfs soc bus functionality Lee Jones
2012-01-20 16:10 ` [PATCH 4/6] mach-ux500: export System-on-Chip information ux500 via sysfs Lee Jones
2012-01-20 16:10 ` [PATCH 5/6] mach-ux500: move top level platform devices in sysfs to /sys/devices/socX Lee Jones
2012-01-20 16:10 ` [PATCH 6/6] mach-ux500: remove intermediary add_platform_device* functions Lee Jones
-- strict thread matches above, loose matches on Subject: below --
2012-02-06 19:22 [PATCH 0/6] ux500: Export SoC information and some platform clean-up Lee Jones
2012-02-06 19:22 ` [PATCH 2/6] drivers/base: add bus for System-on-Chip devices Lee Jones
2012-02-01 9:23 [PATCH 0/6] ux500: Export SoC information and some platform clean-up Lee Jones
2012-02-01 9:23 ` [PATCH 2/6] drivers/base: add bus for System-on-Chip devices Lee Jones
2012-02-01 15:52 ` Jamie Iles
2012-02-01 16:55 ` Arnd Bergmann
2012-01-21 17:08 [PATCH 0/6] ux500: Export SoC information and some platform clean-up Lee Jones
2012-01-21 17:08 ` [PATCH 2/6] drivers/base: add bus for System-on-Chip devices Lee Jones
2012-01-28 1:05 ` Greg KH
2012-01-30 17:58 ` Arnd Bergmann
2012-01-30 18:34 ` Greg KH
2011-10-17 11:52 [PATCH 0/6] ux500: Export SoC information and some platform clean-up Lee Jones
2011-10-17 11:52 ` [PATCH 2/6] drivers/base: add bus for System-on-Chip devices Lee Jones
2011-10-17 11:52 ` Lee Jones
2011-10-17 12:13 ` Jamie Iles
2011-10-17 12:13 ` Jamie Iles
2011-10-17 16:16 ` Greg KH
2011-10-17 16:16 ` Greg KH
2011-10-17 18:03 ` Arnd Bergmann
2011-10-17 18:03 ` Arnd Bergmann
2011-10-17 18:25 ` Greg KH
2011-10-17 18:25 ` Greg KH
2011-10-18 14:00 ` Arnd Bergmann
2011-10-18 14:00 ` Arnd Bergmann
2011-10-18 14:44 ` Greg KH
2011-10-18 14:44 ` Greg KH
2011-10-18 11:12 ` Lee Jones
2011-10-18 11:12 ` Lee Jones
2011-10-18 14:14 ` Arnd Bergmann
2011-10-18 14:14 ` Arnd Bergmann
2011-10-18 14:41 ` Greg KH
2011-10-18 14:41 ` Greg KH
2011-10-18 14:43 ` Greg KH
2011-10-18 14:43 ` Greg KH
2011-10-17 16:18 ` Greg KH
2011-10-17 16:18 ` Greg KH
2011-10-18 11:14 ` Lee Jones
2011-10-18 11:14 ` Lee Jones
2011-10-18 14:05 ` Arnd Bergmann
2011-10-18 14:05 ` Arnd Bergmann
2011-10-18 14:15 ` Jamie Iles
2011-10-18 14:15 ` Jamie Iles
2011-10-18 14:38 ` Greg KH
2011-10-18 14:38 ` Greg KH
2011-10-18 14:53 ` Arnd Bergmann
2011-10-18 14:53 ` Arnd Bergmann
2011-10-18 14:56 ` Jamie Iles
2011-10-18 14:56 ` Jamie Iles
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=20120120182022.GB9999@kroah.com \
--to=greg@kroah.com \
--cc=linux-arm-kernel@lists.infradead.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.