[openib-general] Re: [PATCH] Basic driver model/sysfs support

Greg KH greg at kroah.com
Sat Sep 4 01:07:48 PDT 2004


On Fri, Sep 03, 2004 at 07:32:01AM -0700, Roland Dreier wrote:
>     Greg> At first glance this looks good.
> 
>     Greg> What does 'tree /sys/class/infiniband/' look like with this
>     Greg> code?
> 
> pretty minimal:
> 
>     /sys/class/infiniband/
>     `-- mthca0
> 
> Is it better style to set class_dev.dev in the low-level driver or in
> our infiniband core layer when the low-level driver registers a
> device?

The way the other classes work is that the low-level driver sets the
struct device pointer up in the structure before registering with the
class.  This is because the low-level driver has access to the struct
device, and usually the class knows nothing about it (actually, the
class should not care about it at all.)

> With class_dev.dev set properly it's a little more
> interesting:
> 
>     /sys/class/infiniband/
>     `-- mthca0
>         |-- device -> ../../../devices/pci0000:00/0000:00:02.0/0000:01:1f.0/0000:03:01.0/0000:04:00.0
>         `-- driver -> ../../../bus/pci/drivers/ib_mthca

Yes, that's better :)

Looks good to me.

thanks,

greg k-h

p.s. Can someone please turn the "closed list" option off?  If you all
want to be a open mailing list, it's pretty rude to hold emails from
non-list members.  Almost all Linux development mailing lists accept
email from anyone, list-member or not.

p.s.s. And no, spam is not a valid reason for having such a policy, that
can be handled properly by filters on the mail server, or filters by the
users themselves.



More information about the general mailing list