V4L/DVB (10752): sms1xxx: load smsdvb module automatically based on device id
authorMichael Krufky <mkrufky@linuxtv.org>
Sun, 31 Aug 2008 20:39:58 +0000 (17:39 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 30 Mar 2009 15:43:01 +0000 (12:43 -0300)
The smsdvb module was separated from the core and usb code. This change loads
smsdvb automatically for driver configurations that depend on it.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb/siano/sms-cards.c
drivers/media/dvb/siano/sms-cards.h
drivers/media/dvb/siano/smsusb.c

index 4fa86f5b7fc54c336ffc54e67f663ae1f0397271..44df81a815066ad8cf491a6e5a83890057c13e98 100644 (file)
@@ -204,3 +204,20 @@ int sms_board_lna_control(struct smscore_device_t *coredev, int onoff)
        return -EINVAL;
 }
 EXPORT_SYMBOL(sms_board_lna_control);
+
+int sms_board_load_modules(int id)
+{
+       switch (id) {
+       case SMS1XXX_BOARD_HAUPPAUGE_CATAMOUNT:
+       case SMS1XXX_BOARD_HAUPPAUGE_OKEMO_A:
+       case SMS1XXX_BOARD_HAUPPAUGE_OKEMO_B:
+       case SMS1XXX_BOARD_HAUPPAUGE_WINDHAM:
+               request_module("smsdvb");
+               break;
+       default:
+               /* do nothing */
+               break;
+       }
+       return 0;
+}
+EXPORT_SYMBOL(sms_board_load_modules);
index 8f539a2e5b9a6bbd63ac4d3f0b8ca6fc474daeaa..64d74c59c33f9503760207f9dcf1f1a775f1ac1d 100644 (file)
@@ -54,4 +54,6 @@ int sms_board_led_feedback(struct smscore_device_t *coredev, int led);
 int sms_board_power(struct smscore_device_t *coredev, int onoff);
 int sms_board_lna_control(struct smscore_device_t *coredev, int onoff);
 
+extern int sms_board_load_modules(int id);
+
 #endif /* __SMS_CARDS_H__ */
index 5866b6028dec71b52617decd24168abb41829825..5bb8261721b12fe6edc29040bbf1a2809fe3d515 100644 (file)
@@ -424,6 +424,7 @@ static int smsusb_probe(struct usb_interface *intf,
 
        rc = smsusb_init_device(intf, id->driver_info);
        sms_info("rc %d", rc);
+       sms_board_load_modules(id->driver_info);
        return rc;
 }