Re: [PATCH]: SMBIOS: Add initial code and export version via sysfs

From: Greg KH
Date: Thu Mar 17 2011 - 15:30:40 EST


On Thu, Mar 17, 2011 at 03:12:50PM -0400, Prarit Bhargava wrote:
>
>
> On 03/17/2011 03:09 PM, Alan Cox wrote:
> >> +static struct class smbios_class = {
> >> + .name = "smbios",
> >> + .dev_release = (void(*)(struct device *)) kfree,

Wait, what? Heh, nice try, you can't do this. If you can, your code is
doing something really wrong. Or hacky like trying to put the device
structure as the first thing in your structure. If that gets moved,
this will break badly. Don't.

> >> +};
> >>
> > I thought the policy was no new classes- Greg ?
> >
>
> Greg, eventually the SMBIOS code could replace the mixed DMI/SMBIOS code
> we have right now. If there is a "no new classes" policy, could you
> give me an idea of what I should do/use instead? The DMI stuff is
> currently in its own class ...

Ideally you should use a bus instead. Let me go look at your original
patch and get back to you on this...

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/