diff options
author | Sylwester Nawrocki <snjw23@gmail.com> | 2011-11-06 14:31:40 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-11-08 08:28:06 -0500 |
commit | 82aae98df488c15c212059b23460fe9a9dd97412 (patch) | |
tree | 1642ddcbfa26e82b59fc5ebb11f3292854613bb4 /drivers/staging | |
parent | c06271e052cd00217a26d5aadfa7cf937eaa97a6 (diff) |
[media] staging: as102: Remove leftovers of the SPI bus driver
SPI bus driver support is not included in this module, the SPI
driver files are missing. But some bits are still present so
clean up the unused code.
The SPI driver support can be properly added later if needed.
Then CONFIG_AS102_SPI and CONFIG_AS102_USB is now not needed
and the pre-processor statements using these config options
can now be removed from *.c files.
Cc: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Sylwester Nawrocki <snjw23@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/media/as102/Makefile | 2 | ||||
-rw-r--r-- | drivers/staging/media/as102/as102_drv.c | 33 | ||||
-rw-r--r-- | drivers/staging/media/as102/as102_drv.h | 46 | ||||
-rw-r--r-- | drivers/staging/media/as102/as102_fw.c | 7 |
4 files changed, 11 insertions, 77 deletions
diff --git a/drivers/staging/media/as102/Makefile b/drivers/staging/media/as102/Makefile index e7dbb6f814d5..1bca43e847c7 100644 --- a/drivers/staging/media/as102/Makefile +++ b/drivers/staging/media/as102/Makefile | |||
@@ -3,4 +3,4 @@ dvb-as102-objs := as102_drv.o as102_fw.o as10x_cmd.o as10x_cmd_stream.o \ | |||
3 | 3 | ||
4 | obj-$(CONFIG_DVB_AS102) += dvb-as102.o | 4 | obj-$(CONFIG_DVB_AS102) += dvb-as102.o |
5 | 5 | ||
6 | EXTRA_CFLAGS += -DCONFIG_AS102_USB -Idrivers/media/dvb/dvb-core | 6 | EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core |
diff --git a/drivers/staging/media/as102/as102_drv.c b/drivers/staging/media/as102/as102_drv.c index 771d550fd6c4..0bcc55ca1a5b 100644 --- a/drivers/staging/media/as102/as102_drv.c +++ b/drivers/staging/media/as102/as102_drv.c | |||
@@ -56,9 +56,7 @@ int elna_enable = 1; | |||
56 | module_param_named(elna_enable, elna_enable, int, 0644); | 56 | module_param_named(elna_enable, elna_enable, int, 0644); |
57 | MODULE_PARM_DESC(elna_enable, "Activate eLNA (default: on)"); | 57 | MODULE_PARM_DESC(elna_enable, "Activate eLNA (default: on)"); |
58 | 58 | ||
59 | #ifdef DVB_DEFINE_MOD_OPT_ADAPTER_NR | ||
60 | DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); | 59 | DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); |
61 | #endif | ||
62 | 60 | ||
63 | static void as102_stop_stream(struct as102_dev_t *dev) | 61 | static void as102_stop_stream(struct as102_dev_t *dev) |
64 | { | 62 | { |
@@ -203,16 +201,8 @@ int as102_dvb_register(struct as102_dev_t *as102_dev) | |||
203 | ret = dvb_register_adapter(&as102_dev->dvb_adap, | 201 | ret = dvb_register_adapter(&as102_dev->dvb_adap, |
204 | as102_dev->name, | 202 | as102_dev->name, |
205 | THIS_MODULE, | 203 | THIS_MODULE, |
206 | #if defined(CONFIG_AS102_USB) | 204 | &as102_dev->bus_adap.usb_dev->dev, |
207 | &as102_dev->bus_adap.usb_dev->dev | 205 | adapter_nr |
208 | #elif defined(CONFIG_AS102_SPI) | ||
209 | &as102_dev->bus_adap.spi_dev->dev | ||
210 | #else | ||
211 | #error >>> dvb_register_adapter <<< | ||
212 | #endif | ||
213 | #ifdef DVB_DEFINE_MOD_OPT_ADAPTER_NR | ||
214 | , adapter_nr | ||
215 | #endif | ||
216 | ); | 206 | ); |
217 | if (ret < 0) { | 207 | if (ret < 0) { |
218 | err("%s: dvb_register_adapter() failed (errno = %d)", | 208 | err("%s: dvb_register_adapter() failed (errno = %d)", |
@@ -294,23 +284,13 @@ void as102_dvb_unregister(struct as102_dev_t *as102_dev) | |||
294 | 284 | ||
295 | static int __init as102_driver_init(void) | 285 | static int __init as102_driver_init(void) |
296 | { | 286 | { |
297 | int ret = 0; | 287 | int ret; |
298 | |||
299 | ENTER(); | ||
300 | 288 | ||
301 | /* register this driver with the low level subsystem */ | 289 | /* register this driver with the low level subsystem */ |
302 | #if defined(CONFIG_AS102_USB) | ||
303 | ret = usb_register(&as102_usb_driver); | 290 | ret = usb_register(&as102_usb_driver); |
304 | if (ret) | 291 | if (ret) |
305 | err("usb_register failed (ret = %d)", ret); | 292 | err("usb_register failed (ret = %d)", ret); |
306 | #endif | ||
307 | #if defined(CONFIG_AS102_SPI) | ||
308 | ret = spi_register_driver(&as102_spi_driver); | ||
309 | if (ret) | ||
310 | printk(KERN_ERR "spi_register failed (ret = %d)", ret); | ||
311 | #endif | ||
312 | 293 | ||
313 | LEAVE(); | ||
314 | return ret; | 294 | return ret; |
315 | } | 295 | } |
316 | 296 | ||
@@ -327,15 +307,8 @@ module_init(as102_driver_init); | |||
327 | */ | 307 | */ |
328 | static void __exit as102_driver_exit(void) | 308 | static void __exit as102_driver_exit(void) |
329 | { | 309 | { |
330 | ENTER(); | ||
331 | /* deregister this driver with the low level bus subsystem */ | 310 | /* deregister this driver with the low level bus subsystem */ |
332 | #if defined(CONFIG_AS102_USB) | ||
333 | usb_deregister(&as102_usb_driver); | 311 | usb_deregister(&as102_usb_driver); |
334 | #endif | ||
335 | #if defined(CONFIG_AS102_SPI) | ||
336 | spi_unregister_driver(&as102_spi_driver); | ||
337 | #endif | ||
338 | LEAVE(); | ||
339 | } | 312 | } |
340 | 313 | ||
341 | /* | 314 | /* |
diff --git a/drivers/staging/media/as102/as102_drv.h b/drivers/staging/media/as102/as102_drv.h index 7f56f6471583..af2bf1e082ee 100644 --- a/drivers/staging/media/as102/as102_drv.h +++ b/drivers/staging/media/as102/as102_drv.h | |||
@@ -17,27 +17,18 @@ | |||
17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
18 | */ | 18 | */ |
19 | 19 | ||
20 | #if defined(CONFIG_AS102_USB) | ||
21 | #include <linux/usb.h> | 20 | #include <linux/usb.h> |
22 | extern struct usb_driver as102_usb_driver; | 21 | #include <dvb_demux.h> |
23 | #endif | 22 | #include <dvb_frontend.h> |
24 | 23 | #include <dmxdev.h> | |
25 | #if defined(CONFIG_AS102_SPI) | 24 | #include "as10x_cmd.h" |
26 | #include <linux/platform_device.h> | 25 | #include "as102_usb_drv.h" |
27 | #include <linux/spi/spi.h> | ||
28 | #include <linux/cdev.h> | ||
29 | |||
30 | extern struct spi_driver as102_spi_driver; | ||
31 | #endif | ||
32 | |||
33 | #include "dvb_demux.h" | ||
34 | #include "dvb_frontend.h" | ||
35 | #include "dmxdev.h" | ||
36 | 26 | ||
37 | #define DRIVER_FULL_NAME "Abilis Systems as10x usb driver" | 27 | #define DRIVER_FULL_NAME "Abilis Systems as10x usb driver" |
38 | #define DRIVER_NAME "as10x_usb" | 28 | #define DRIVER_NAME "as10x_usb" |
39 | 29 | ||
40 | extern int debug; | 30 | extern int debug; |
31 | extern struct usb_driver as102_usb_driver; | ||
41 | 32 | ||
42 | #define dprintk(debug, args...) \ | 33 | #define dprintk(debug, args...) \ |
43 | do { if (debug) { \ | 34 | do { if (debug) { \ |
@@ -58,39 +49,14 @@ extern int debug; | |||
58 | #define AS102_USB_BUF_SIZE 512 | 49 | #define AS102_USB_BUF_SIZE 512 |
59 | #define MAX_STREAM_URB 32 | 50 | #define MAX_STREAM_URB 32 |
60 | 51 | ||
61 | #include "as10x_cmd.h" | ||
62 | |||
63 | #if defined(CONFIG_AS102_USB) | ||
64 | #include "as102_usb_drv.h" | ||
65 | #endif | ||
66 | |||
67 | #if defined(CONFIG_AS102_SPI) | ||
68 | #include "as10x_spi_drv.h" | ||
69 | #endif | ||
70 | |||
71 | |||
72 | struct as102_bus_adapter_t { | 52 | struct as102_bus_adapter_t { |
73 | #if defined(CONFIG_AS102_USB) | ||
74 | struct usb_device *usb_dev; | 53 | struct usb_device *usb_dev; |
75 | #elif defined(CONFIG_AS102_SPI) | ||
76 | struct spi_device *spi_dev; | ||
77 | struct cdev cdev; /* spidev raw device */ | ||
78 | |||
79 | struct timer_list timer; | ||
80 | struct completion xfer_done; | ||
81 | #endif | ||
82 | /* bus token lock */ | 54 | /* bus token lock */ |
83 | struct mutex lock; | 55 | struct mutex lock; |
84 | /* low level interface for bus adapter */ | 56 | /* low level interface for bus adapter */ |
85 | union as10x_bus_token_t { | 57 | union as10x_bus_token_t { |
86 | #if defined(CONFIG_AS102_USB) | ||
87 | /* usb token */ | 58 | /* usb token */ |
88 | struct as10x_usb_token_cmd_t usb; | 59 | struct as10x_usb_token_cmd_t usb; |
89 | #endif | ||
90 | #if defined(CONFIG_AS102_SPI) | ||
91 | /* spi token */ | ||
92 | struct as10x_spi_token_cmd_t spi; | ||
93 | #endif | ||
94 | } token; | 60 | } token; |
95 | 61 | ||
96 | /* token cmd xfer id */ | 62 | /* token cmd xfer id */ |
diff --git a/drivers/staging/media/as102/as102_fw.c b/drivers/staging/media/as102/as102_fw.c index 4fb2987506b5..3aa4aad5a464 100644 --- a/drivers/staging/media/as102/as102_fw.c +++ b/drivers/staging/media/as102/as102_fw.c | |||
@@ -169,13 +169,8 @@ int as102_fw_upload(struct as102_bus_adapter_t *bus_adap) | |||
169 | const struct firmware *firmware; | 169 | const struct firmware *firmware; |
170 | unsigned char *cmd_buf = NULL; | 170 | unsigned char *cmd_buf = NULL; |
171 | char *fw1, *fw2; | 171 | char *fw1, *fw2; |
172 | |||
173 | #if defined(CONFIG_AS102_USB) | ||
174 | struct usb_device *dev = bus_adap->usb_dev; | 172 | struct usb_device *dev = bus_adap->usb_dev; |
175 | #endif | 173 | |
176 | #if defined(CONFIG_AS102_SPI) | ||
177 | struct spi_device *dev = bus_adap->spi_dev; | ||
178 | #endif | ||
179 | ENTER(); | 174 | ENTER(); |
180 | 175 | ||
181 | /* select fw file to upload */ | 176 | /* select fw file to upload */ |