Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=77b7477467824098741351b6253a4ad292e28df9
Commit:     77b7477467824098741351b6253a4ad292e28df9
Parent:     acf2821282bdd912f9ca46780879a21679429f85
Author:     Markus Rechberger <[EMAIL PROTECTED]>
AuthorDate: Fri Apr 27 12:31:06 2007 -0300
Committer:  Mauro Carvalho Chehab <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 15:43:25 2007 -0300

    V4L/DVB (5298): Added support for deferred module requesting to cx88
    
    added support for deferred module requesting to cx88
    
    Signed-off-by: Markus Rechberger <[EMAIL PROTECTED]>
    Signed-off-by: Mauro Carvalho Chehab <[EMAIL PROTECTED]>
---
 drivers/media/video/cx88/cx88-mpeg.c |   32 ++++++++++++++++++++++++++++++++
 drivers/media/video/cx88/cx88.h      |    2 ++
 2 files changed, 34 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/cx88/cx88-mpeg.c 
b/drivers/media/video/cx88/cx88-mpeg.c
index 1fe1a83..cd01d23 100644
--- a/drivers/media/video/cx88/cx88-mpeg.c
+++ b/drivers/media/video/cx88/cx88-mpeg.c
@@ -49,6 +49,35 @@ MODULE_PARM_DESC(debug,"enable debug messages [mpeg]");
 #define mpeg_dbg(level,fmt, arg...)    if (debug >= level) \
        printk(KERN_DEBUG "%s/2-mpeg: " fmt, core->name, ## arg)
 
+#if defined(CONFIG_MODULES) && defined(MODULE)
+static void request_module_async(struct work_struct *work)
+{
+       struct cx8802_dev *dev=container_of(work, struct cx8802_dev, 
request_module_wk);
+       switch (cx88_boards[dev->core->board].mpeg) {
+       case CX88_MPEG_BLACKBIRD:
+               request_module("cx88-blackbird");
+               break;
+       case CX88_MPEG_DVB:
+               request_module("cx88-dvb");
+               break;
+       case CX88_BOARD_NONE:
+               /* reaching this one isn't possible */
+               break;
+       default:
+               printk("cx88-mpeg.c: WARNING extension [%d] is not supposed to 
be supported\n",cx88_boards[dev->core->board].mpeg);
+       }
+}
+
+static void request_modules(struct cx8802_dev *dev)
+{
+       INIT_WORK(&dev->request_module_wk, request_module_async);
+       schedule_work(&dev->request_module_wk);
+}
+#else
+#define request_modules(dev)
+#endif /* CONFIG_MODULES */
+
+
 static LIST_HEAD(cx8802_devlist);
 /* ------------------------------------------------------------------ */
 
@@ -778,6 +807,9 @@ static int __devinit cx8802_probe(struct pci_dev *pci_dev,
 
        /* Maintain a reference so cx88-video can query the 8802 device. */
        core->dvbdev = dev;
+
+       /* now autoload cx88-dvb or cx88-blackbird */
+       request_modules(dev);
        return 0;
 
  fail_free:
diff --git a/drivers/media/video/cx88/cx88.h b/drivers/media/video/cx88/cx88.h
index a4f7bef..d16ed93 100644
--- a/drivers/media/video/cx88/cx88.h
+++ b/drivers/media/video/cx88/cx88.h
@@ -481,6 +481,8 @@ struct cx8802_dev {
 
        /* List of attached drivers */
        struct cx8802_driver       drvlist;
+       struct work_struct request_module_wk;
+
 };
 
 /* ----------------------------------------------------------- */
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to