[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <a8e1da0801110053j70a1b117n46983d8c0b073fde@mail.gmail.com>
Date: Fri, 11 Jan 2008 16:53:36 +0800
From: "Dave Young" <hidave.darkstar@...il.com>
To: "Cornelia Huck" <cornelia.huck@...ibm.com>
Cc: "Greg KH" <gregkh@...e.de>,
"Stefan Richter" <stefanr@...6.in-berlin.de>,
James.Bottomley@...senpartnership.com, linux-scsi@...r.kernel.org,
a.zummo@...ertech.it, peterz@...radead.org, cbou@...l.ru,
linux-kernel@...r.kernel.org,
"David Brownell" <david-b@...bell.net>, krh@...hat.com,
stern@...land.harvard.edu, rtc-linux@...glegroups.com,
spi-devel-general@...ts.sourceforge.net,
linux1394-devel@...ts.sourceforge.net, dwmw2@...radead.org,
davem@...emloft.net, jarkao2@...il.com
Subject: Re: [PATCH 0/7] convert semaphore to mutex in struct class
On Jan 11, 2008 4:23 PM, Cornelia Huck <cornelia.huck@...ibm.com> wrote:
> On Fri, 11 Jan 2008 10:33:16 +0800,
> "Dave Young" <hidave.darkstar@...il.com> wrote:
>
>
> > > > +struct device *class_find_device(struct class *class, void *data,
> > > > + int (*match)(struct device *, void *))
> > > > +{
> > > > + struct device *dev;
> > > > +
> > > > + if (!class)
> > > > + return NULL;
> > > > +
> > > > + mutex_lock(&class->mutex);
> > > > + list_for_each_entry(dev, &class->devices, node)
> > > > + if (match(dev, data) && get_device(dev))
> > >
> > > First get the reference and then drop it if the match function returns
> > > 0 to make this analogous to the other _find_device() functions?
> >
> > It's just like other _find_device() functions. Are these more get/put
> > really needed?
>
> The other _find_device() functions operate on klists, which means that
> there is an implicit get while the element is handled. This function
> operates on a normal list, which means that getting/putting the
> reference looks a bit different if we want the same effect.
>
Hi, you are right. Will be fixed.
Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists