lkml.org 
[lkml]   [2013]   [Jul]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [char-misc-next 2/3] mei: adding sysfs fw_status attribute
Date


> > int mei_register(struct mei_device *dev) {
> > + struct device *device = &dev->pdev->dev;
> > int ret;
> > - mei_misc_device.parent = &dev->pdev->dev;
> > +
> > + mei_misc_device.parent = device;
> > ret = misc_register(&mei_misc_device);
> > if (ret)
> > return ret;
> >
> > + ret = sysfs_create_group(&device->kobj, &mei_attr_group);
> > + if (ret)
> > + return ret;
>

> And you just lost the race with userspace (you told it you had a device, it
> went and scanned your attributes and saved them, then you registered
> more...)
>
> Please use the dev_groups field for your class to properly have the driver
> core register these before userspace is told about the device, that's the
> correct way to do this.

Just to make sure, is this what you're suggesting ?

device->groups = mei_attr_groups
mei_misc_device.parent = device;
ret = misc_register(&mei_misc_device);

Thanks
Tomas



\
 
 \ /
  Last update: 2013-07-24 19:01    [W:0.074 / U:4.988 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site