On Wednesday 07 October 2015 20:42:39 H. Nikolaus Schaller wrote: > Explicitly call request_module() in the wrapper so that the > bq27x00_battery driver is loded on demand, when compiled as module. > > Signed-off-by: H. Nikolaus Schaller > --- > drivers/w1/slaves/w1_bq27000.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/w1/slaves/w1_bq27000.c > b/drivers/w1/slaves/w1_bq27000.c index caafb17..745bd6e 100644 > --- a/drivers/w1/slaves/w1_bq27000.c > +++ b/drivers/w1/slaves/w1_bq27000.c > @@ -49,6 +49,8 @@ static int w1_bq27000_add_slave(struct w1_slave > *sl) int ret; > struct platform_device *pdev; > > + request_module("bq27x00_battery"); /* load as module if needed */ > + > pdev = platform_device_alloc("bq27000-battery", -1); > if (!pdev) { > ret = -ENOMEM; Hi! Function platform_device_alloc would allocate kernel device and it should also load appropriate kernel driver (via platform:bq27000-battery alias). If that does not work, problem is somewhere else. Maybe depmod is not properly generated? Or bq27x00_batter.ko modules does not contain needed alias? Adding request_module() here is not proper solution. Real problem is somewhere else... Anyway there is series of patches for bq27x00_battery which should cleanup some problems, so maybe they also fix your problem. -- Pali Rohár pali.rohar@gmail.com