diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-05-05 04:04:06 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-05-05 04:04:06 -0400 |
commit | c17f888f8fc2e47e2b4a51424f8ccf564ae87576 (patch) | |
tree | 9246153b5ee5718d6ceaaeea4571f63f55605f19 /drivers/net | |
parent | fa1b1cff3d06550d23ef540c4f97ca83c021b473 (diff) |
irda: fix !PNP support in drivers/net/irda/nsc-ircc.c
x86.git testing found the following build failure in latest -git:
drivers/built-in.o: In function `nsc_ircc_pnp_probe':
nsc-ircc.c:(.text+0xdf1b6): undefined reference to `pnp_get_resource'
nsc-ircc.c:(.text+0xdf1d4): undefined reference to `pnp_get_resource'
nsc-ircc.c:(.text+0xdf1ee): undefined reference to `pnp_get_resource'
nsc-ircc.c:(.text+0xdf237): undefined reference to `pnp_get_resource'
nsc-ircc.c:(.text+0xdf24c): undefined reference to `pnp_get_resource'
drivers/built-in.o:nsc-ircc.c:(.text+0xdf266): more undefined references to `pnp_get_resource' follow
make: *** [.tmp_vmlinux1] Error 1
triggered via this config:
http://redhat.com/~mingo/misc/config-Sat_May__3_20_53_13_CEST_2008.bad
while generally most users will have PNP enabled, drivers can support
non-PNP build mode too - and most drivers implement it. That is typically
done by providing a dummy pnp_driver structure that will not probe anything.
The fallback routines in the driver will handle this dumber mode of
operation too.
This patch implements that. I have not tested whether this actually
works on real hardware so take care. It does resolve the build bug.
[ Another solution that is used by a few drivers is to exclude the driver
in the Kconfig if PNP is disabled, via "depends on PNP", but this would
limit the availability of the driver needlessly. ]
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/irda/nsc-ircc.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/irda/nsc-ircc.c b/drivers/net/irda/nsc-ircc.c index a873d2b315ca..a7714da7c283 100644 --- a/drivers/net/irda/nsc-ircc.c +++ b/drivers/net/irda/nsc-ircc.c | |||
@@ -100,7 +100,9 @@ static int nsc_ircc_probe_39x(nsc_chip_t *chip, chipio_t *info); | |||
100 | static int nsc_ircc_init_108(nsc_chip_t *chip, chipio_t *info); | 100 | static int nsc_ircc_init_108(nsc_chip_t *chip, chipio_t *info); |
101 | static int nsc_ircc_init_338(nsc_chip_t *chip, chipio_t *info); | 101 | static int nsc_ircc_init_338(nsc_chip_t *chip, chipio_t *info); |
102 | static int nsc_ircc_init_39x(nsc_chip_t *chip, chipio_t *info); | 102 | static int nsc_ircc_init_39x(nsc_chip_t *chip, chipio_t *info); |
103 | #ifdef CONFIG_PNP | ||
103 | static int nsc_ircc_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *id); | 104 | static int nsc_ircc_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *id); |
105 | #endif | ||
104 | 106 | ||
105 | /* These are the known NSC chips */ | 107 | /* These are the known NSC chips */ |
106 | static nsc_chip_t chips[] = { | 108 | static nsc_chip_t chips[] = { |
@@ -156,9 +158,11 @@ static const struct pnp_device_id nsc_ircc_pnp_table[] = { | |||
156 | MODULE_DEVICE_TABLE(pnp, nsc_ircc_pnp_table); | 158 | MODULE_DEVICE_TABLE(pnp, nsc_ircc_pnp_table); |
157 | 159 | ||
158 | static struct pnp_driver nsc_ircc_pnp_driver = { | 160 | static struct pnp_driver nsc_ircc_pnp_driver = { |
161 | #ifdef CONFIG_PNP | ||
159 | .name = "nsc-ircc", | 162 | .name = "nsc-ircc", |
160 | .id_table = nsc_ircc_pnp_table, | 163 | .id_table = nsc_ircc_pnp_table, |
161 | .probe = nsc_ircc_pnp_probe, | 164 | .probe = nsc_ircc_pnp_probe, |
165 | #endif | ||
162 | }; | 166 | }; |
163 | 167 | ||
164 | /* Some prototypes */ | 168 | /* Some prototypes */ |
@@ -916,6 +920,7 @@ static int nsc_ircc_probe_39x(nsc_chip_t *chip, chipio_t *info) | |||
916 | return 0; | 920 | return 0; |
917 | } | 921 | } |
918 | 922 | ||
923 | #ifdef CONFIG_PNP | ||
919 | /* PNP probing */ | 924 | /* PNP probing */ |
920 | static int nsc_ircc_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *id) | 925 | static int nsc_ircc_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *id) |
921 | { | 926 | { |
@@ -952,6 +957,7 @@ static int nsc_ircc_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *i | |||
952 | 957 | ||
953 | return 0; | 958 | return 0; |
954 | } | 959 | } |
960 | #endif | ||
955 | 961 | ||
956 | /* | 962 | /* |
957 | * Function nsc_ircc_setup (info) | 963 | * Function nsc_ircc_setup (info) |