Make SC100 driver the loadable module.

Google-Bug-Id: 19432272
Change-Id: I9b3b9901de28dec318d0a5b54e74e0334b631502
diff --git a/arch/arm/configs/gfsc100_defconfig b/arch/arm/configs/gfsc100_defconfig
index 19ad024..b885e1c 100644
--- a/arch/arm/configs/gfsc100_defconfig
+++ b/arch/arm/configs/gfsc100_defconfig
@@ -230,7 +230,7 @@
 CONFIG_MEDIA_SUPPORT=y
 CONFIG_DVB_CORE=y
 CONFIG_DVB_USB=y
-CONFIG_DVB_USB_SC100=y
+CONFIG_DVB_USB_SC100=m
 # CONFIG_HID_SUPPORT is not set
 CONFIG_USB=y
 CONFIG_USB_DEBUG=y
diff --git a/arch/arm/mach-comcerto/comcerto-2000.c b/arch/arm/mach-comcerto/comcerto-2000.c
index 020336f..7951cd5 100644
--- a/arch/arm/mach-comcerto/comcerto-2000.c
+++ b/arch/arm/mach-comcerto/comcerto-2000.c
@@ -61,6 +61,8 @@
 #include <mach/comcerto-2000/pm.h>
 #include <mach/gpio.h>
 
+#include <linux/module.h>
+
 struct c2k_gpio_pin_stat_info c2k_gpio_pin_stat =
 {
 	.c2k_gpio_pins_0_31 = 0x0,
@@ -847,8 +849,16 @@
 	return str_incr_cnt;
 }
 
-u8 c2k_mac_addr[3][14];
-EXPORT_SYMBOL(c2k_mac_addr);
+static u8 c2k_mac_addr[3][14];
+
+int comcerto_mac_addr_get(uint8_t mac[6], uint8_t index)
+{
+	if(index>=3)
+		return -EINVAL;
+	memcpy(mac, c2k_mac_addr[index], 6);
+	return 0;
+}
+EXPORT_SYMBOL(comcerto_mac_addr_get);
 
 static void __init mac_addr_setup(char *str)
 {
diff --git a/arch/arm/mach-comcerto/include/mach/comcerto-2000.h b/arch/arm/mach-comcerto/include/mach/comcerto-2000.h
index 4a27d04..19e6e14 100644
--- a/arch/arm/mach-comcerto/include/mach/comcerto-2000.h
+++ b/arch/arm/mach-comcerto/include/mach/comcerto-2000.h
@@ -231,6 +231,10 @@
 #include <mach/comcerto-2000/memory.h>
 #include <mach/c2k_dma.h>
 
+#ifndef __ASSEMBLY__
+extern int comcerto_mac_addr_get(uint8_t mac[6], uint8_t index);
+#endif
+
 #define comcerto_timer4_set(hbound)	__raw_writel((hbound), COMCERTO_TIMER4_HIGH_BOUND)
 
 #define comcerto_timer4_get()		__raw_readl(COMCERTO_TIMER4_CURRENT_COUNT)
diff --git a/drivers/media/dvb/dvb-usb/sc100.c b/drivers/media/dvb/dvb-usb/sc100.c
index 390fa98..7b93c2b 100644
--- a/drivers/media/dvb/dvb-usb/sc100.c
+++ b/drivers/media/dvb/dvb-usb/sc100.c
@@ -11,6 +11,7 @@
  */
 #include "sc100.h"
 #include "dvbsky_m88rs6000.h"
+#include "mach/comcerto-2000.h"
 
 #define SC100_VOLTAGE_CTRL (0x60)
 #define SC100_READ_MSG 0
@@ -29,12 +30,9 @@
 
 DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
 
-extern u8 c2k_mac_addr[3][14];
-
 static int sc100_read_mac_address(struct dvb_usb_device *d, u8 mac[6])
 {
-	memcpy(mac, c2k_mac_addr[SC100_MAC_ADDR_INDEX], 6);
-	return 0;
+	return comcerto_mac_addr_get(mac, SC100_MAC_ADDR_INDEX);
 };
 
 static int sc100_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage)