lkml.org 
[lkml]   [2018]   [Dec]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] mfd: tqmx86: IO controller with i2c, wachdog and gpio
> > +static int tqmx86_create_platform_device(const struct dmi_system_id *id)
>
> This blows my mind.
>
> - The normal module_init() calls are initiated calling for a DMI scan
> - Then the DMI device init()s
> - You use the DMI init() to register this device as a platform device
> - Then this platform device then probes
>
> That seems very incestuous.
>
> What is the reason for all the hoop jumping?

Hi Lee

It does seem like a lot of hoops to jump through. But i don't see a
way to avoid it. When you are matching on DMI tables, all you appear
to be able to do is register a callback to be called. This callback
cannot be used as a driver probe, you cannot return -EPROBE_DEFER and
expect it to be called again, etc. So if you do want to create a
device, you need to go via a platform_device.

If you know of a better way, i would be happy to implement it.

Thanks
Andrew

\
 
 \ /
  Last update: 2018-12-21 22:29    [W:0.047 / U:2.704 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site