Commit 56a47751 authored by Gerd Knorr's avatar Gerd Knorr Committed by Linus Torvalds

[PATCH] v4l: saa7134 module

- fix saa7134 module loading issues.
Signed-off-by: default avatarGerd Knorr <kraxel@bytesex.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 3f0fb28b
......@@ -222,6 +222,49 @@ static void dump_statusregs(struct saa7134_dev *dev)
}
#endif
/* ----------------------------------------------------------- */
/* delayed request_module */
static int need_empress;
static int need_dvb;
static int pending_call(struct notifier_block *self, unsigned long state,
void *module)
{
if (module != THIS_MODULE || state != MODULE_STATE_LIVE)
return NOTIFY_DONE;
if (need_empress)
request_module("saa7134-empress");
if (need_dvb)
request_module("saa7134-dvb");
return NOTIFY_DONE;
}
static int pending_registered;
static struct notifier_block pending_notifier = {
.notifier_call = pending_call,
};
static void request_module_depend(char *name, int *flag)
{
switch (THIS_MODULE->state) {
case MODULE_STATE_COMING:
if (!pending_registered) {
register_module_notifier(&pending_notifier);
pending_registered = 1;
}
*flag = 1;
break;
case MODULE_STATE_LIVE:
request_module(name);
break;
default:
/* nothing */;
break;
}
}
/* ------------------------------------------------------------------ */
/* nr of (saa7134-)pages for the given buffer size */
......@@ -941,11 +984,11 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
if (dev->tda9887_conf)
request_module("tda9887");
if (card_is_empress(dev)) {
request_module("saa7134-empress");
request_module("saa6752hs");
request_module_depend("saa7134-empress",&need_empress);
}
if (card_is_dvb(dev))
request_module("saa7134-dvb");
request_module_depend("saa7134-dvb",&need_dvb);
v4l2_prio_init(&dev->prio);
......
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