On Wed, Jun 21, 2017 at 11:15:11AM +0200, Florian Echtler wrote: > On 16.06.2017 18:41, Guenter Roeck wrote: > > On Fri, Jun 16, 2017 at 11:02:31AM +0200, Florian Echtler wrote: > >> This patch exports the SMC key access functions from applesmc.c to allow > >> access from other drivers, in particular, the yet-to-be-written ACPI > >> driver for Target Display Mode (TDM). > > > > It is structurally deficient to have the hwmon driver export those functions. > > If used by another driver, the functions should be moved to a common > > driver, possibly in mfd. This driver would then also be responsible to > > instantiate its child drivers. > > Hm, this sounds like a major rework? AFAICT, that would roughly mean to move all > code up to, but not including, applesmc_calibrate to mfd and leave the rest in > hwmon? > Sorry for the late reply. Yes, this is asking for a major rework. At some point we just have to stop adding more and more functionality to a single driver. > What's the mechanism to auto-load another kernel module? > Primarily MODULE_ALIAS and MODULE_DEVICE_TABLE. mfd drivers often use platform_device_add() to create child devices, or mfd_add_devices(). Guenter -- To unsubscribe from this list: send the line "unsubscribe linux-hwmon" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html