Re: [PATCH] Suspend2 Merge: Driver model patches 2/2

From: Greg KH
Date: Thu Sep 16 2004 - 17:42:15 EST


On Fri, Sep 17, 2004 at 08:18:47AM +1000, Nigel Cunningham wrote:
> On Fri, 2004-09-17 at 00:28, Greg KH wrote:
> > On Thu, Sep 16, 2004 at 08:58:51PM +1000, Nigel Cunningham wrote:
> > >
> > > This simple helper adds support for finding a class given its name. I
> > > use this to locate the frame buffer drivers and move them to the
> > > keep-alive tree while suspending other drivers.
> > >
> > > +struct class * class_find(char * name)
> > > +{
> > > + struct class * this_class;
> > > +
> > > + if (!name)
> > > + return NULL;
> > > +
> > > + list_for_each_entry(this_class, &class_subsys.kset.list, subsys.kset.kobj.entry) {
> > > + if (!(strcmp(this_class->name, name)))
> > > + return this_class;
> > > + }
> > > +
> > > + return NULL;
> > > +}
> >
> > Ick, no. I've been over this before with the fb people, and am not going
> > to accept this patch (nevermind that it's broken...) See the lkml
> > archives for more info on why I don't like this.
>
> Please excuse my ignorance but I don't see how it's broken

This function, as written is very broken. I will not accept it. Not to
mention the fact that the functionality this function proposes to offer
is not needed either.

> (their patch just fills in a field that was left blank previously),

What patch?

> and this patch just makes use of that change. What's the point to
> device_class if we don't use it?

I don't see a use of device_class in this function. I'm confused.

thanks,

greg k-h
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/