Commit 0e0fad8f authored by Dominik Brodowski's avatar Dominik Brodowski

[PATCH] pcmcia: size reduction if ioctl isn't compiled

If the kernel is configured to not include the deprecated PCMCIA ioctl,
some code doesn't need to be built.
Signed-off-by: default avatarDominik Brodowski <linux@dominikbrodowski.net>
parent 1540eec5
...@@ -835,9 +835,11 @@ static int pcmcia_bus_match(struct device * dev, struct device_driver * drv) { ...@@ -835,9 +835,11 @@ static int pcmcia_bus_match(struct device * dev, struct device_driver * drv) {
struct pcmcia_driver * p_drv = to_pcmcia_drv(drv); struct pcmcia_driver * p_drv = to_pcmcia_drv(drv);
struct pcmcia_device_id *did = p_drv->id_table; struct pcmcia_device_id *did = p_drv->id_table;
#ifdef CONFIG_PCMCIA_IOCTL
/* matching by cardmgr */ /* matching by cardmgr */
if (p_dev->cardmgr == p_drv) if (p_dev->cardmgr == p_drv)
return 1; return 1;
#endif
while (did && did->match_flags) { while (did && did->match_flags) {
if (pcmcia_devmatch(p_dev, did)) if (pcmcia_devmatch(p_dev, did))
......
...@@ -15,7 +15,7 @@ extern void handle_event(struct pcmcia_socket *s, event_t event); ...@@ -15,7 +15,7 @@ extern void handle_event(struct pcmcia_socket *s, event_t event);
extern int handle_request(struct pcmcia_socket *s, event_t event); extern int handle_request(struct pcmcia_socket *s, event_t event);
#else #else
static inline void __init pcmcia_setup_ioctl(void) { return; } 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 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; } static inline int handle_request(struct pcmcia_socket *s, event_t event) { return CS_SUCCESS; }
#endif #endif
...@@ -21,6 +21,8 @@ ...@@ -21,6 +21,8 @@
#include "cs_internal.h" #include "cs_internal.h"
#ifdef CONFIG_PCMCIA_IOCTL
#ifdef CONFIG_PCMCIA_PROBE #ifdef CONFIG_PCMCIA_PROBE
static int adjust_irq(struct pcmcia_socket *s, adjust_t *adj) static int adjust_irq(struct pcmcia_socket *s, adjust_t *adj)
...@@ -97,6 +99,8 @@ int pcmcia_adjust_resource_info(adjust_t *adj) ...@@ -97,6 +99,8 @@ int pcmcia_adjust_resource_info(adjust_t *adj)
} }
EXPORT_SYMBOL(pcmcia_adjust_resource_info); EXPORT_SYMBOL(pcmcia_adjust_resource_info);
#endif
int pcmcia_validate_mem(struct pcmcia_socket *s) int pcmcia_validate_mem(struct pcmcia_socket *s)
{ {
if (s->resource_ops->validate_mem) if (s->resource_ops->validate_mem)
......
...@@ -183,10 +183,12 @@ struct pcmcia_device { ...@@ -183,10 +183,12 @@ struct pcmcia_device {
char * prod_id[4]; char * prod_id[4];
struct device dev;
#ifdef CONFIG_PCMCIA_IOCTL
/* device driver wanted by cardmgr */ /* device driver wanted by cardmgr */
struct pcmcia_driver * cardmgr; struct pcmcia_driver * cardmgr;
#endif
struct device dev;
}; };
#define to_pcmcia_dev(n) container_of(n, struct pcmcia_device, dev) #define to_pcmcia_dev(n) container_of(n, struct pcmcia_device, dev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment