lkml.org 
[lkml]   [2014]   [Jun]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v10] leds: USB: HID: Add support for MSI GT683R led panels
On Mon, Jun 23, 2014 at 09:31:34PM +0200, Johan Hovold wrote:
> On Mon, Jun 23, 2014 at 02:24:32PM -0400, Greg KH wrote:
> > On Mon, Jun 23, 2014 at 02:23:24PM -0400, Greg KH wrote:
> > > On Mon, Jun 23, 2014 at 08:16:48PM +0300, Janne Kanniainen wrote:
> > > > + ret = sysfs_create_group(&led->hdev->dev.kobj, &gt683r_attribute_group);
> > > > + if (ret) {
> > > > + hid_err(hdev, "failed to create sysfs attributes\n");
> > > > + goto fail;
> > > > + }
> > >
> > > No, you need to set the attribute group _before_ you call
> > > led_classdev_register, as that is where the device will be created in
> > > sysfs. Surely the other led drivers already do this? I'm almost afraid
> > > to go look...
> >
> > Yes, they do it already, set .dev_attr_group and you should be fine.
>
> But this isn't an attribute of the LEDs but rather of the parent HID
> device that is being probed (the led_mode is common to all three LEDs
> and thus belongs in the parent device, right?).

Then that's even worse :(

The sysfs attribute should be on the class device here for the LED, you
should not put an attribute on a device you are not the driver for.

greg k-h


\
 
 \ /
  Last update: 2014-06-23 22:41    [W:0.139 / U:0.288 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site