Commit 11509b33 authored by Vaibhav Gupta's avatar Vaibhav Gupta

drivers: fmc: core: load at24 before probing fmc

In cases where driver modules are not built into the kernel itself, at24
module is not loaded at the desired time, and thus, can cause error when
trying to read the eeprom.

Also, listing at24 as a soft dependency doesn't solves our problem as it
does not guarantees the time at which the module will be loaded.

Hence, load the module using request_module(), and throw a kernel warning
in syslog if it fails.
Signed-off-by: 's avatarVaibhav Gupta <vaibhav.gupta@cern.ch>
parent 1ecf5cb1
Pipeline #4623 failed
......@@ -460,6 +460,11 @@ static struct class fmc_class = {
static int __init fmc_init(void)
{
int ret;
ret = request_module("at24");
if (ret)
pr_warn("fmc: Could not load module 'at24' required for eeprom.");
return class_register(&fmc_class);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment