Commit da1a76f3 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 045a9bf6
...@@ -252,8 +252,15 @@ int ft_probe(struct fmc_device *fmc) ...@@ -252,8 +252,15 @@ int ft_probe(struct fmc_device *fmc)
ft->initialized = 1; ft->initialized = 1;
ft->sequence = 0; ft->sequence = 0;
/* Pin the carrier */
if (!try_module_get(fmc->owner))
goto out_mod;
return 0; return 0;
err:
out_mod:
ft_irq_exit(ft);
err:
while (--m, --i >= 0) while (--m, --i >= 0)
if (m->exit) if (m->exit)
m->exit(ft); m->exit(ft);
...@@ -278,6 +285,10 @@ int ft_remove(struct fmc_device *fmc) ...@@ -278,6 +285,10 @@ int ft_remove(struct fmc_device *fmc)
if (m->exit) if (m->exit)
m->exit(ft); m->exit(ft);
} }
/* Release the carrier */
module_put(fmc->owner);
return 0; 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