Commit d385e6f3 authored by Federico Vaga's avatar Federico Vaga

kernel: get carrier module to prevent rmmod

Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent 30de8355
......@@ -288,8 +288,14 @@ int fd_probe(struct fmc_device *fmc)
for (ch = 1; ch <= FD_CH_NUMBER; ch++)
fd_gpio_set(fd, FD_GPIO_OUTPUT_EN(ch));
/* Pin the carrier */
if (!try_module_get(fmc->owner))
goto out_mod;
return 0;
out_mod:
fd_irq_exit(fd);
err:
while (--m, --i >= 0)
if (m->exit)
......@@ -312,6 +318,10 @@ int fd_remove(struct fmc_device *fmc)
if (m->exit)
m->exit(fd);
}
/* Release the carrier */
module_put(fmc->owner);
return 0;
}
......
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