diff options
author | Adrian Bunk <bunk@stusta.de> | 2005-11-07 04:01:48 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-07 10:54:09 -0500 |
commit | b449f63c8ce4a517cb91f237cc3d68d083ec2dd3 (patch) | |
tree | 3d00143e3114f5f044c174df519378bc47dcd4ea /drivers | |
parent | 5fed0578be842dd7d24e5240a75b02bbc748501f (diff) |
[PATCH] drivers/pnp/: cleanups
This patch contains the following possible cleanups:
- make needlessly global code static
- #if 0 the following unused global function:
- core.c: pnp_remove_device
- #if 0 the following unneeded EXPORT_SYMBOL's:
- card.c: pnp_add_card
- card.c: pnp_remove_card
- card.c: pnp_add_card_device
- card.c: pnp_remove_card_device
- card.c: pnp_add_card_id
- core.c: pnp_register_protocol
- core.c: pnp_unregister_protocol
- core.c: pnp_add_device
- core.c: pnp_remove_device
- pnpacpi/core.c: pnpacpi_protocol
- driver.c: pnp_add_id
- isapnp/core.c: isapnp_read_byte
- manager.c: pnp_auto_config_dev
- resource.c: pnp_register_dependent_option
- resource.c: pnp_register_independent_option
- resource.c: pnp_register_irq_resource
- resource.c: pnp_register_dma_resource
- resource.c: pnp_register_port_resource
- resource.c: pnp_register_mem_resource
Note that this patch #if 0's exactly one functions and removes no
functions. Most it does is the #if 0 of EXPORT_SYMBOL's, so if any modular
code will use any of them, re-adding will be trivial.
Modular ISAPnP might be interesting in some cases, but this is more legacy
code. If someone would work on it to sort all the issues out (starting
with the point that most users of __ISAPNP__ will have to be fixed)
re-enabling the required EXPORT_SYMBOL's won't be hard for him.
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Cc: Adam Belay <ambx1@neo.rr.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/pnp/card.c | 4 | ||||
-rw-r--r-- | drivers/pnp/core.c | 5 | ||||
-rw-r--r-- | drivers/pnp/driver.c | 2 | ||||
-rw-r--r-- | drivers/pnp/isapnp/core.c | 2 | ||||
-rw-r--r-- | drivers/pnp/manager.c | 2 | ||||
-rw-r--r-- | drivers/pnp/pnpacpi/core.c | 6 | ||||
-rw-r--r-- | drivers/pnp/resource.c | 2 |
7 files changed, 19 insertions, 4 deletions
diff --git a/drivers/pnp/card.c b/drivers/pnp/card.c index e95ed67d4f05..bd7c966ea2d7 100644 --- a/drivers/pnp/card.c +++ b/drivers/pnp/card.c | |||
@@ -12,7 +12,7 @@ | |||
12 | #include "base.h" | 12 | #include "base.h" |
13 | 13 | ||
14 | LIST_HEAD(pnp_cards); | 14 | LIST_HEAD(pnp_cards); |
15 | LIST_HEAD(pnp_card_drivers); | 15 | static LIST_HEAD(pnp_card_drivers); |
16 | 16 | ||
17 | 17 | ||
18 | static const struct pnp_card_device_id * match_card(struct pnp_card_driver * drv, struct pnp_card * card) | 18 | static const struct pnp_card_device_id * match_card(struct pnp_card_driver * drv, struct pnp_card * card) |
@@ -374,11 +374,13 @@ void pnp_unregister_card_driver(struct pnp_card_driver * drv) | |||
374 | pnp_unregister_driver(&drv->link); | 374 | pnp_unregister_driver(&drv->link); |
375 | } | 375 | } |
376 | 376 | ||
377 | #if 0 | ||
377 | EXPORT_SYMBOL(pnp_add_card); | 378 | EXPORT_SYMBOL(pnp_add_card); |
378 | EXPORT_SYMBOL(pnp_remove_card); | 379 | EXPORT_SYMBOL(pnp_remove_card); |
379 | EXPORT_SYMBOL(pnp_add_card_device); | 380 | EXPORT_SYMBOL(pnp_add_card_device); |
380 | EXPORT_SYMBOL(pnp_remove_card_device); | 381 | EXPORT_SYMBOL(pnp_remove_card_device); |
381 | EXPORT_SYMBOL(pnp_add_card_id); | 382 | EXPORT_SYMBOL(pnp_add_card_id); |
383 | #endif /* 0 */ | ||
382 | EXPORT_SYMBOL(pnp_request_card_device); | 384 | EXPORT_SYMBOL(pnp_request_card_device); |
383 | EXPORT_SYMBOL(pnp_release_card_device); | 385 | EXPORT_SYMBOL(pnp_release_card_device); |
384 | EXPORT_SYMBOL(pnp_register_card_driver); | 386 | EXPORT_SYMBOL(pnp_register_card_driver); |
diff --git a/drivers/pnp/core.c b/drivers/pnp/core.c index deed92459bc5..aec83ec5ea23 100644 --- a/drivers/pnp/core.c +++ b/drivers/pnp/core.c | |||
@@ -158,13 +158,14 @@ void __pnp_remove_device(struct pnp_dev *dev) | |||
158 | * | 158 | * |
159 | * this function will free all mem used by dev | 159 | * this function will free all mem used by dev |
160 | */ | 160 | */ |
161 | 161 | #if 0 | |
162 | void pnp_remove_device(struct pnp_dev *dev) | 162 | void pnp_remove_device(struct pnp_dev *dev) |
163 | { | 163 | { |
164 | if (!dev || dev->card) | 164 | if (!dev || dev->card) |
165 | return; | 165 | return; |
166 | __pnp_remove_device(dev); | 166 | __pnp_remove_device(dev); |
167 | } | 167 | } |
168 | #endif /* 0 */ | ||
168 | 169 | ||
169 | static int __init pnp_init(void) | 170 | static int __init pnp_init(void) |
170 | { | 171 | { |
@@ -174,7 +175,9 @@ static int __init pnp_init(void) | |||
174 | 175 | ||
175 | subsys_initcall(pnp_init); | 176 | subsys_initcall(pnp_init); |
176 | 177 | ||
178 | #if 0 | ||
177 | EXPORT_SYMBOL(pnp_register_protocol); | 179 | EXPORT_SYMBOL(pnp_register_protocol); |
178 | EXPORT_SYMBOL(pnp_unregister_protocol); | 180 | EXPORT_SYMBOL(pnp_unregister_protocol); |
179 | EXPORT_SYMBOL(pnp_add_device); | 181 | EXPORT_SYMBOL(pnp_add_device); |
180 | EXPORT_SYMBOL(pnp_remove_device); | 182 | EXPORT_SYMBOL(pnp_remove_device); |
183 | #endif /* 0 */ | ||
diff --git a/drivers/pnp/driver.c b/drivers/pnp/driver.c index 33da25f3213f..d3ccce706ab4 100644 --- a/drivers/pnp/driver.c +++ b/drivers/pnp/driver.c | |||
@@ -214,6 +214,8 @@ int pnp_add_id(struct pnp_id *id, struct pnp_dev *dev) | |||
214 | 214 | ||
215 | EXPORT_SYMBOL(pnp_register_driver); | 215 | EXPORT_SYMBOL(pnp_register_driver); |
216 | EXPORT_SYMBOL(pnp_unregister_driver); | 216 | EXPORT_SYMBOL(pnp_unregister_driver); |
217 | #if 0 | ||
217 | EXPORT_SYMBOL(pnp_add_id); | 218 | EXPORT_SYMBOL(pnp_add_id); |
219 | #endif | ||
218 | EXPORT_SYMBOL(pnp_device_attach); | 220 | EXPORT_SYMBOL(pnp_device_attach); |
219 | EXPORT_SYMBOL(pnp_device_detach); | 221 | EXPORT_SYMBOL(pnp_device_detach); |
diff --git a/drivers/pnp/isapnp/core.c b/drivers/pnp/isapnp/core.c index beedd86800f4..57fd60314d59 100644 --- a/drivers/pnp/isapnp/core.c +++ b/drivers/pnp/isapnp/core.c | |||
@@ -941,7 +941,9 @@ EXPORT_SYMBOL(isapnp_protocol); | |||
941 | EXPORT_SYMBOL(isapnp_present); | 941 | EXPORT_SYMBOL(isapnp_present); |
942 | EXPORT_SYMBOL(isapnp_cfg_begin); | 942 | EXPORT_SYMBOL(isapnp_cfg_begin); |
943 | EXPORT_SYMBOL(isapnp_cfg_end); | 943 | EXPORT_SYMBOL(isapnp_cfg_end); |
944 | #if 0 | ||
944 | EXPORT_SYMBOL(isapnp_read_byte); | 945 | EXPORT_SYMBOL(isapnp_read_byte); |
946 | #endif | ||
945 | EXPORT_SYMBOL(isapnp_write_byte); | 947 | EXPORT_SYMBOL(isapnp_write_byte); |
946 | 948 | ||
947 | static int isapnp_read_resources(struct pnp_dev *dev, struct pnp_resource_table *res) | 949 | static int isapnp_read_resources(struct pnp_dev *dev, struct pnp_resource_table *res) |
diff --git a/drivers/pnp/manager.c b/drivers/pnp/manager.c index cbb2749db178..261668618b2d 100644 --- a/drivers/pnp/manager.c +++ b/drivers/pnp/manager.c | |||
@@ -555,7 +555,9 @@ void pnp_resource_change(struct resource *resource, unsigned long start, unsigne | |||
555 | 555 | ||
556 | 556 | ||
557 | EXPORT_SYMBOL(pnp_manual_config_dev); | 557 | EXPORT_SYMBOL(pnp_manual_config_dev); |
558 | #if 0 | ||
558 | EXPORT_SYMBOL(pnp_auto_config_dev); | 559 | EXPORT_SYMBOL(pnp_auto_config_dev); |
560 | #endif | ||
559 | EXPORT_SYMBOL(pnp_activate_dev); | 561 | EXPORT_SYMBOL(pnp_activate_dev); |
560 | EXPORT_SYMBOL(pnp_disable_dev); | 562 | EXPORT_SYMBOL(pnp_disable_dev); |
561 | EXPORT_SYMBOL(pnp_resource_change); | 563 | EXPORT_SYMBOL(pnp_resource_change); |
diff --git a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c index 1a8915e74160..816479ad217b 100644 --- a/drivers/pnp/pnpacpi/core.c +++ b/drivers/pnp/pnpacpi/core.c | |||
@@ -117,7 +117,7 @@ static int pnpacpi_disable_resources(struct pnp_dev *dev) | |||
117 | return ACPI_FAILURE(status) ? -ENODEV : 0; | 117 | return ACPI_FAILURE(status) ? -ENODEV : 0; |
118 | } | 118 | } |
119 | 119 | ||
120 | struct pnp_protocol pnpacpi_protocol = { | 120 | static struct pnp_protocol pnpacpi_protocol = { |
121 | .name = "Plug and Play ACPI", | 121 | .name = "Plug and Play ACPI", |
122 | .get = pnpacpi_get_resources, | 122 | .get = pnpacpi_get_resources, |
123 | .set = pnpacpi_set_resources, | 123 | .set = pnpacpi_set_resources, |
@@ -234,7 +234,7 @@ static acpi_status __init pnpacpi_add_device_handler(acpi_handle handle, | |||
234 | } | 234 | } |
235 | 235 | ||
236 | int pnpacpi_disabled __initdata; | 236 | int pnpacpi_disabled __initdata; |
237 | int __init pnpacpi_init(void) | 237 | static int __init pnpacpi_init(void) |
238 | { | 238 | { |
239 | if (acpi_disabled || pnpacpi_disabled) { | 239 | if (acpi_disabled || pnpacpi_disabled) { |
240 | pnp_info("PnP ACPI: disabled"); | 240 | pnp_info("PnP ACPI: disabled"); |
@@ -258,4 +258,6 @@ static int __init pnpacpi_setup(char *str) | |||
258 | } | 258 | } |
259 | __setup("pnpacpi=", pnpacpi_setup); | 259 | __setup("pnpacpi=", pnpacpi_setup); |
260 | 260 | ||
261 | #if 0 | ||
261 | EXPORT_SYMBOL(pnpacpi_protocol); | 262 | EXPORT_SYMBOL(pnpacpi_protocol); |
263 | #endif | ||
diff --git a/drivers/pnp/resource.c b/drivers/pnp/resource.c index 887ad8939349..6ded527169f4 100644 --- a/drivers/pnp/resource.c +++ b/drivers/pnp/resource.c | |||
@@ -477,12 +477,14 @@ int pnp_check_dma(struct pnp_dev * dev, int idx) | |||
477 | } | 477 | } |
478 | 478 | ||
479 | 479 | ||
480 | #if 0 | ||
480 | EXPORT_SYMBOL(pnp_register_dependent_option); | 481 | EXPORT_SYMBOL(pnp_register_dependent_option); |
481 | EXPORT_SYMBOL(pnp_register_independent_option); | 482 | EXPORT_SYMBOL(pnp_register_independent_option); |
482 | EXPORT_SYMBOL(pnp_register_irq_resource); | 483 | EXPORT_SYMBOL(pnp_register_irq_resource); |
483 | EXPORT_SYMBOL(pnp_register_dma_resource); | 484 | EXPORT_SYMBOL(pnp_register_dma_resource); |
484 | EXPORT_SYMBOL(pnp_register_port_resource); | 485 | EXPORT_SYMBOL(pnp_register_port_resource); |
485 | EXPORT_SYMBOL(pnp_register_mem_resource); | 486 | EXPORT_SYMBOL(pnp_register_mem_resource); |
487 | #endif /* 0 */ | ||
486 | 488 | ||
487 | 489 | ||
488 | /* format is: pnp_reserve_irq=irq1[,irq2] .... */ | 490 | /* format is: pnp_reserve_irq=irq1[,irq2] .... */ |