[RFC][1/5] include cs_internal.h in ds.c
Dominik Brodowski
linux at brodo.de
Sat Nov 22 11:34:20 GMT 2003
In order to move PCMCIA-related code from cs.c to ds.c, it is necessary
to include cs_internal.h in ds.c.
This causes two problems:
a) SOCKET_PRESENT would be redefined. So rename all uses of SOCKET_PRESENT
in ds.c to DS_SOCKET_PRESENT
b) pc_debug would be defined as "external int" instead of "static int". So,
rename this optional debugging parameter to ds_debug.
drivers/pcmcia/ds.c | 18 ++++++++----------
1 files changed, 8 insertions(+), 10 deletions(-)
diff -ruN linux-original/drivers/pcmcia/ds.c linux/drivers/pcmcia/ds.c
--- linux-original/drivers/pcmcia/ds.c 2003-11-22 09:35:35.723823744 +0100
+++ linux/drivers/pcmcia/ds.c 2003-11-22 09:39:59.200769160 +0100
@@ -59,6 +59,8 @@
#include <pcmcia/ds.h>
#include <pcmcia/ss.h>
+#include "cs_internal.h"
+
/*====================================================================*/
/* Module parameters */
@@ -67,13 +69,9 @@
MODULE_DESCRIPTION("PCMCIA Driver Services");
MODULE_LICENSE("Dual MPL/GPL");
-#define INT_MODULE_PARM(n, v) static int n = v; MODULE_PARM(n, "i")
-
#ifdef PCMCIA_DEBUG
-INT_MODULE_PARM(pc_debug, PCMCIA_DEBUG);
-#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
-#else
-#define DEBUG(n, args...)
+static int ds_debug = PCMCIA_DEBUG;
+MODULE_PARM(ds_debug, "i")
#endif
/*====================================================================*/
@@ -110,7 +108,7 @@
struct pcmcia_socket *parent;
};
-#define SOCKET_PRESENT 0x01
+#define DS_SOCKET_PRESENT 0x01
#define SOCKET_BUSY 0x02
#define SOCKET_REMOVAL_PENDING 0x10
@@ -265,7 +263,7 @@
switch (event) {
case CS_EVENT_CARD_REMOVAL:
- s->state &= ~SOCKET_PRESENT;
+ s->state &= ~DS_SOCKET_PRESENT;
if (!(s->state & SOCKET_REMOVAL_PENDING)) {
s->state |= SOCKET_REMOVAL_PENDING;
schedule_delayed_work(&s->removal, HZ/10);
@@ -273,7 +271,7 @@
break;
case CS_EVENT_CARD_INSERTION:
- s->state |= SOCKET_PRESENT;
+ s->state |= DS_SOCKET_PRESENT;
handle_event(s, event);
break;
@@ -520,7 +518,7 @@
s->user = user;
file->private_data = user;
- if (s->state & SOCKET_PRESENT)
+ if (s->state & DS_SOCKET_PRESENT)
queue_event(user, CS_EVENT_CARD_INSERTION);
return 0;
} /* ds_open */
More information about the linux-pcmcia
mailing list