Skip to content

Commit

Permalink
[PATCH] pcmcia: size reduction if ioctl isn't compiled
Browse files Browse the repository at this point in the history
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@dominikbrodowski.net>
  • Loading branch information
Dominik Brodowski committed Mar 31, 2006
1 parent 1540eec commit 0e0fad8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 2 additions & 0 deletions drivers/pcmcia/ds.c
Original file line number Diff line number Diff line change
Expand Up @@ -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_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))
Expand Down
2 changes: 1 addition & 1 deletion drivers/pcmcia/ds_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
#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
4 changes: 4 additions & 0 deletions drivers/pcmcia/rsrc_mgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -97,6 +99,8 @@ int pcmcia_adjust_resource_info(adjust_t *adj)
}
EXPORT_SYMBOL(pcmcia_adjust_resource_info);

#endif

int pcmcia_validate_mem(struct pcmcia_socket *s)
{
if (s->resource_ops->validate_mem)
Expand Down
6 changes: 4 additions & 2 deletions include/pcmcia/ds.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0e0fad8

Please sign in to comment.