[RFC PATCH 2/11] pcmcia updates (post 2.6.16): size reduction if
ioctl isn't compiled
Dominik Brodowski
linux at dominikbrodowski.net
Sun Jan 15 14:07:23 EST 2006
Subject: [PATCH] pcmcia: size reduction if ioctl isn't compiled
From: Dominik Brodowski <linux at dominikbrodowski.net>
Date: 1137284071 +0100
If the kernel is configured to not include the deprecated PCMCIA ioctl,
some code doesn't need to be built.
Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>
---
drivers/pcmcia/ds.c | 2 ++
drivers/pcmcia/ds_internal.h | 2 +-
drivers/pcmcia/rsrc_mgr.c | 4 ++++
include/pcmcia/ds.h | 6 ++++--
4 files changed, 11 insertions(+), 3 deletions(-)
cac8b02275735bae93a00f1cf4f889a564e8ae68
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index 667d972..31739d3 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -830,9 +830,11 @@ static int pcmcia_bus_match(struct devic
struct pcmcia_driver * p_drv = to_pcmcia_drv(drv);
struct pcmcia_device_id *did = p_drv->id_table;
+#ifdef CONFIG_PCMCIA_IOCTL
/* matching by cardmgr */
if (p_dev->cardmgr == p_drv)
return 1;
+#endif
while (did && did->match_flags) {
if (pcmcia_devmatch(p_dev, did))
diff --git a/drivers/pcmcia/ds_internal.h b/drivers/pcmcia/ds_internal.h
index d359bd2..783d861 100644
--- a/drivers/pcmcia/ds_internal.h
+++ b/drivers/pcmcia/ds_internal.h
@@ -15,7 +15,7 @@ extern void handle_event(struct pcmcia_s
extern int handle_request(struct pcmcia_socket *s, event_t event);
#else
static inline void __init pcmcia_setup_ioctl(void) { return; }
-static inline void __init pcmcia_cleanup_ioctl(void) { return; }
+static inline void __exit pcmcia_cleanup_ioctl(void) { return; }
static inline void handle_event(struct pcmcia_socket *s, event_t event) { return; }
static inline int handle_request(struct pcmcia_socket *s, event_t event) { return CS_SUCCESS; }
#endif
diff --git a/drivers/pcmcia/rsrc_mgr.c b/drivers/pcmcia/rsrc_mgr.c
index e5a3312..81dfc2c 100644
--- a/drivers/pcmcia/rsrc_mgr.c
+++ b/drivers/pcmcia/rsrc_mgr.c
@@ -21,6 +21,8 @@
#include "cs_internal.h"
+#ifdef CONFIG_PCMCIA_IOCTL
+
#ifdef CONFIG_PCMCIA_PROBE
static int adjust_irq(struct pcmcia_socket *s, adjust_t *adj)
@@ -97,6 +99,8 @@ int pcmcia_adjust_resource_info(adjust_t
}
EXPORT_SYMBOL(pcmcia_adjust_resource_info);
+#endif
+
int pcmcia_validate_mem(struct pcmcia_socket *s)
{
if (s->resource_ops->validate_mem)
diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h
index 8512cf9..ce76ab5 100644
--- a/include/pcmcia/ds.h
+++ b/include/pcmcia/ds.h
@@ -183,10 +183,12 @@ struct pcmcia_device {
char * prod_id[4];
+ struct device dev;
+
+#ifdef CONFIG_PCMCIA_IOCTL
/* device driver wanted by cardmgr */
struct pcmcia_driver * cardmgr;
-
- struct device dev;
+#endif
};
#define to_pcmcia_dev(n) container_of(n, struct pcmcia_device, dev)
--
1.1.2
More information about the linux-pcmcia
mailing list