aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia/ds.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pcmcia/ds.c')
-rw-r--r--drivers/pcmcia/ds.c36
1 files changed, 33 insertions, 3 deletions
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index 2c3c3da5368e..0c7dc5b38757 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -116,8 +116,13 @@ static struct bus_type pcmcia_bus_type;
116#define DS_SOCKET_DEAD 0x80 116#define DS_SOCKET_DEAD 0x80
117 117
118/*====================================================================*/ 118/*====================================================================*/
119#ifdef CONFIG_PCMCIA_IOCTL
119 120
120static int major_dev = -1; 121static int major_dev = -1;
122static struct pcmcia_bus_socket * get_socket_info_by_nr(unsigned int nr);
123static struct pcmcia_driver * get_pcmcia_driver (dev_info_t *dev_info);
124
125#endif
121 126
122static int unbind_request(struct pcmcia_bus_socket *s); 127static int unbind_request(struct pcmcia_bus_socket *s);
123 128
@@ -356,8 +361,6 @@ static inline int pcmcia_load_firmware(struct pcmcia_device *dev, char * filenam
356 361
357/*======================================================================*/ 362/*======================================================================*/
358 363
359static struct pcmcia_driver * get_pcmcia_driver (dev_info_t *dev_info);
360static struct pcmcia_bus_socket * get_socket_info_by_nr(unsigned int nr);
361 364
362static void pcmcia_release_bus_socket(struct kref *refcount) 365static void pcmcia_release_bus_socket(struct kref *refcount)
363{ 366{
@@ -411,6 +414,7 @@ void pcmcia_unregister_driver(struct pcmcia_driver *driver)
411} 414}
412EXPORT_SYMBOL(pcmcia_unregister_driver); 415EXPORT_SYMBOL(pcmcia_unregister_driver);
413 416
417#ifdef CONFIG_PCMCIA_IOCTL
414#ifdef CONFIG_PROC_FS 418#ifdef CONFIG_PROC_FS
415static struct proc_dir_entry *proc_pccard = NULL; 419static struct proc_dir_entry *proc_pccard = NULL;
416 420
@@ -443,6 +447,7 @@ static int proc_read_drivers(char *buf, char **start, off_t pos,
443 return (p - buf); 447 return (p - buf);
444} 448}
445#endif 449#endif
450#endif
446 451
447/* pcmcia_device handling */ 452/* pcmcia_device handling */
448 453
@@ -998,6 +1003,8 @@ static struct device_attribute pcmcia_dev_attrs[] = {
998 1003
999======================================================================*/ 1004======================================================================*/
1000 1005
1006#ifdef CONFIG_PCMCIA_IOCTL
1007
1001static int queue_empty(user_info_t *user) 1008static int queue_empty(user_info_t *user)
1002{ 1009{
1003 return (user->event_head == user->event_tail); 1010 return (user->event_head == user->event_tail);
@@ -1024,6 +1031,11 @@ static void handle_event(struct pcmcia_bus_socket *s, event_t event)
1024 queue_event(user, event); 1031 queue_event(user, event);
1025 wake_up_interruptible(&s->queue); 1032 wake_up_interruptible(&s->queue);
1026} 1033}
1034#else
1035static inline void handle_event(struct pcmcia_bus_socket *s, event_t event) { return; }
1036static inline int handle_request(struct pcmcia_bus_socket *s, event_t event) { return CS_SUCCESS; }
1037#endif
1038
1027 1039
1028 1040
1029/*====================================================================== 1041/*======================================================================
@@ -1142,6 +1154,8 @@ static int ds_event(struct pcmcia_socket *skt, event_t event, int priority)
1142 1154
1143======================================================================*/ 1155======================================================================*/
1144 1156
1157#ifdef CONFIG_PCMCIA_IOCTL
1158
1145static int bind_request(struct pcmcia_bus_socket *s, bind_info_t *bind_info) 1159static int bind_request(struct pcmcia_bus_socket *s, bind_info_t *bind_info)
1146{ 1160{
1147 struct pcmcia_driver *p_drv; 1161 struct pcmcia_driver *p_drv;
@@ -1237,6 +1251,8 @@ rescan:
1237 return (ret); 1251 return (ret);
1238} /* bind_request */ 1252} /* bind_request */
1239 1253
1254#endif
1255
1240 1256
1241int pcmcia_register_client(client_handle_t *handle, client_reg_t *req) 1257int pcmcia_register_client(client_handle_t *handle, client_reg_t *req)
1242{ 1258{
@@ -1334,6 +1350,7 @@ EXPORT_SYMBOL(pcmcia_register_client);
1334 1350
1335 1351
1336/*====================================================================*/ 1352/*====================================================================*/
1353#ifdef CONFIG_PCMCIA_IOCTL
1337 1354
1338extern struct pci_bus *pcmcia_lookup_bus(struct pcmcia_socket *s); 1355extern struct pci_bus *pcmcia_lookup_bus(struct pcmcia_socket *s);
1339 1356
@@ -1422,6 +1439,8 @@ static int get_device_info(struct pcmcia_bus_socket *s, bind_info_t *bind_info,
1422 return (ret); 1439 return (ret);
1423} /* get_device_info */ 1440} /* get_device_info */
1424 1441
1442#endif
1443
1425/*====================================================================*/ 1444/*====================================================================*/
1426 1445
1427/* unbind _all_ devices attached to a given pcmcia_bus_socket. The 1446/* unbind _all_ devices attached to a given pcmcia_bus_socket. The
@@ -1495,6 +1514,8 @@ EXPORT_SYMBOL(pcmcia_deregister_client);
1495 1514
1496======================================================================*/ 1515======================================================================*/
1497 1516
1517#ifdef CONFIG_PCMCIA_IOCTL
1518
1498static int ds_open(struct inode *inode, struct file *file) 1519static int ds_open(struct inode *inode, struct file *file)
1499{ 1520{
1500 socket_t i = iminor(inode); 1521 socket_t i = iminor(inode);
@@ -1855,6 +1876,8 @@ static struct file_operations ds_fops = {
1855 .poll = ds_poll, 1876 .poll = ds_poll,
1856}; 1877};
1857 1878
1879#endif
1880
1858static int __devinit pcmcia_bus_add_socket(struct class_device *class_dev) 1881static int __devinit pcmcia_bus_add_socket(struct class_device *class_dev)
1859{ 1882{
1860 struct pcmcia_socket *socket = class_get_devdata(class_dev); 1883 struct pcmcia_socket *socket = class_get_devdata(class_dev);
@@ -1939,13 +1962,16 @@ static struct bus_type pcmcia_bus_type = {
1939 1962
1940static int __init init_pcmcia_bus(void) 1963static int __init init_pcmcia_bus(void)
1941{ 1964{
1965#ifdef CONFIG_PCMCIA_IOCTL
1942 int i; 1966 int i;
1967#endif
1943 1968
1944 spin_lock_init(&pcmcia_dev_list_lock); 1969 spin_lock_init(&pcmcia_dev_list_lock);
1945 1970
1946 bus_register(&pcmcia_bus_type); 1971 bus_register(&pcmcia_bus_type);
1947 class_interface_register(&pcmcia_bus_interface); 1972 class_interface_register(&pcmcia_bus_interface);
1948 1973
1974#ifdef CONFIG_PCMCIA_IOCTL
1949 /* Set up character device for user mode clients */ 1975 /* Set up character device for user mode clients */
1950 i = register_chrdev(0, "pcmcia", &ds_fops); 1976 i = register_chrdev(0, "pcmcia", &ds_fops);
1951 if (i < 0) 1977 if (i < 0)
@@ -1959,6 +1985,7 @@ static int __init init_pcmcia_bus(void)
1959 if (proc_pccard) 1985 if (proc_pccard)
1960 create_proc_read_entry("drivers",0,proc_pccard,proc_read_drivers,NULL); 1986 create_proc_read_entry("drivers",0,proc_pccard,proc_read_drivers,NULL);
1961#endif 1987#endif
1988#endif
1962 1989
1963 return 0; 1990 return 0;
1964} 1991}
@@ -1970,6 +1997,7 @@ static void __exit exit_pcmcia_bus(void)
1970{ 1997{
1971 class_interface_unregister(&pcmcia_bus_interface); 1998 class_interface_unregister(&pcmcia_bus_interface);
1972 1999
2000#ifdef CONFIG_PCMCIA_IOCTL
1973#ifdef CONFIG_PROC_FS 2001#ifdef CONFIG_PROC_FS
1974 if (proc_pccard) { 2002 if (proc_pccard) {
1975 remove_proc_entry("drivers", proc_pccard); 2003 remove_proc_entry("drivers", proc_pccard);
@@ -1978,6 +2006,7 @@ static void __exit exit_pcmcia_bus(void)
1978#endif 2006#endif
1979 if (major_dev != -1) 2007 if (major_dev != -1)
1980 unregister_chrdev(major_dev, "pcmcia"); 2008 unregister_chrdev(major_dev, "pcmcia");
2009#endif
1981 2010
1982 bus_unregister(&pcmcia_bus_type); 2011 bus_unregister(&pcmcia_bus_type);
1983} 2012}
@@ -1986,7 +2015,7 @@ module_exit(exit_pcmcia_bus);
1986 2015
1987 2016
1988/* helpers for backwards-compatible functions */ 2017/* helpers for backwards-compatible functions */
1989 2018#ifdef CONFIG_PCMCIA_IOCTL
1990static struct pcmcia_bus_socket * get_socket_info_by_nr(unsigned int nr) 2019static struct pcmcia_bus_socket * get_socket_info_by_nr(unsigned int nr)
1991{ 2020{
1992 struct pcmcia_socket * s = pcmcia_get_socket_by_nr(nr); 2021 struct pcmcia_socket * s = pcmcia_get_socket_by_nr(nr);
@@ -2011,5 +2040,6 @@ static struct pcmcia_driver * get_pcmcia_driver (dev_info_t *dev_info)
2011 2040
2012 return (p_drv); 2041 return (p_drv);
2013} 2042}
2043#endif
2014 2044
2015MODULE_ALIAS("ds"); 2045MODULE_ALIAS("ds");