> -----Original Message-----
> From: Lukas Wunner [mailto:lu...@wunner.de]
> Sent: Friday, September 15, 2017 2:45 AM
> To: Mika Westerberg <mika.westerb...@linux.intel.com>
> Cc: Limonciello, Mario <mario_limoncie...@dell.com>; dvh...@infradead.org;
> linux-kernel@vger.kernel.org; platform-driver-...@vger.kernel.org;
> hughsi...@gmail.com; yehezkel...@gmail.com
> Subject: Re: [PATCH v3] Add driver to force WMI Thunderbolt controller power
> status
> 
> On Thu, Sep 14, 2017 at 05:59:19PM +0300, Mika Westerberg wrote:
> > On Thu, Sep 14, 2017 at 02:52:27PM +0000, mario.limoncie...@dell.com wrote:
> > > > Looking at drivers/platform/x86/wmi.c:wmi_dev_uevent() it seems that
> > > > a modalias consisting of "wmi:" followed by the GUID is sent to udevd.
> > > > For udevd to then load the module, I suspect you need to add a
> > > > MODULE_DEVICE_TABLE(wmi, ...) to your driver.
> > >
> > > Ah, you're looking for this code from the WMI bus driver:
> > >
> https://github.com/torvalds/linux/blob/master/drivers/platform/x86/wmi.c#L724
> > >
> > > That happens when the bus is initialized.
> >
> > That's right you get the uevent and whatnot but Lucas means that if you
> > don't have MODULE_DEVICE_TABLE(wmi, ...) in the driver, udev cannot load
> > the module automatically when the device appears.
> 
> Digging a bit deeper I notice the wmi drivers seem to solve this by
> directly declaring a MODULE_ALIAS(), which is also present in Mario's
> driver.  Mario, have you tested if auto-loading works if compiled as
> a module?  If so, sorry for the noise.
> 

Yes, I had tested that and that's why I was really baffled at needing to add
MODULE_DEVICE_TABLE.  I was going to dig further into this today, but I'm
glad you figured it out.

Reply via email to