]> err.no Git - linux-2.6/commitdiff
[PATCH] drivers/pnp/: cleanups
authorAdrian Bunk <bunk@stusta.de>
Mon, 7 Nov 2005 09:01:48 +0000 (01:01 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 7 Nov 2005 15:54:09 +0000 (07:54 -0800)
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>
drivers/pnp/card.c
drivers/pnp/core.c
drivers/pnp/driver.c
drivers/pnp/isapnp/core.c
drivers/pnp/manager.c
drivers/pnp/pnpacpi/core.c
drivers/pnp/resource.c
include/linux/pnp.h

index e95ed67d4f050afddf5918d34628e4586ba70951..bd7c966ea2d7f8ee7dfe250bd4e4a26343a6fd72 100644 (file)
@@ -12,7 +12,7 @@
 #include "base.h"
 
 LIST_HEAD(pnp_cards);
-LIST_HEAD(pnp_card_drivers);
+static LIST_HEAD(pnp_card_drivers);
 
 
 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)
        pnp_unregister_driver(&drv->link);
 }
 
+#if 0
 EXPORT_SYMBOL(pnp_add_card);
 EXPORT_SYMBOL(pnp_remove_card);
 EXPORT_SYMBOL(pnp_add_card_device);
 EXPORT_SYMBOL(pnp_remove_card_device);
 EXPORT_SYMBOL(pnp_add_card_id);
+#endif  /*  0  */
 EXPORT_SYMBOL(pnp_request_card_device);
 EXPORT_SYMBOL(pnp_release_card_device);
 EXPORT_SYMBOL(pnp_register_card_driver);
index deed92459bc5e34feddcb5a27ff3cc3f1163365e..aec83ec5ea23f2471c55fbbe3dafd073b296c42e 100644 (file)
@@ -158,13 +158,14 @@ void __pnp_remove_device(struct pnp_dev *dev)
  *
  * this function will free all mem used by dev
  */
-
+#if 0
 void pnp_remove_device(struct pnp_dev *dev)
 {
        if (!dev || dev->card)
                return;
        __pnp_remove_device(dev);
 }
+#endif  /*  0  */
 
 static int __init pnp_init(void)
 {
@@ -174,7 +175,9 @@ static int __init pnp_init(void)
 
 subsys_initcall(pnp_init);
 
+#if 0
 EXPORT_SYMBOL(pnp_register_protocol);
 EXPORT_SYMBOL(pnp_unregister_protocol);
 EXPORT_SYMBOL(pnp_add_device);
 EXPORT_SYMBOL(pnp_remove_device);
+#endif  /*  0  */
index 33da25f3213f4614a6dc338b9743034452dab3de..d3ccce706ab4ce9ee20bf45e46112249fcdcf4c3 100644 (file)
@@ -214,6 +214,8 @@ int pnp_add_id(struct pnp_id *id, struct pnp_dev *dev)
 
 EXPORT_SYMBOL(pnp_register_driver);
 EXPORT_SYMBOL(pnp_unregister_driver);
+#if 0
 EXPORT_SYMBOL(pnp_add_id);
+#endif
 EXPORT_SYMBOL(pnp_device_attach);
 EXPORT_SYMBOL(pnp_device_detach);
index beedd86800f4e26093643ec765961a2fbd6f0e25..57fd60314d591516e1a7a7c81ff030ac552978a9 100644 (file)
@@ -941,7 +941,9 @@ EXPORT_SYMBOL(isapnp_protocol);
 EXPORT_SYMBOL(isapnp_present);
 EXPORT_SYMBOL(isapnp_cfg_begin);
 EXPORT_SYMBOL(isapnp_cfg_end);
+#if 0
 EXPORT_SYMBOL(isapnp_read_byte);
+#endif
 EXPORT_SYMBOL(isapnp_write_byte);
 
 static int isapnp_read_resources(struct pnp_dev *dev, struct pnp_resource_table *res)
index cbb2749db178e1332be1c0693ce627ad29c502fa..261668618b2d481d8bd5074e8297e0f9374f145b 100644 (file)
@@ -555,7 +555,9 @@ void pnp_resource_change(struct resource *resource, unsigned long start, unsigne
 
 
 EXPORT_SYMBOL(pnp_manual_config_dev);
+#if 0
 EXPORT_SYMBOL(pnp_auto_config_dev);
+#endif
 EXPORT_SYMBOL(pnp_activate_dev);
 EXPORT_SYMBOL(pnp_disable_dev);
 EXPORT_SYMBOL(pnp_resource_change);
index 1a8915e74160bba5b0b4a94f2ecbe6322168b8e6..816479ad217b044dd3c9eb5cd27d3b6683616e6a 100644 (file)
@@ -117,7 +117,7 @@ static int pnpacpi_disable_resources(struct pnp_dev *dev)
        return ACPI_FAILURE(status) ? -ENODEV : 0;
 }
 
-struct pnp_protocol pnpacpi_protocol = {
+static struct pnp_protocol pnpacpi_protocol = {
        .name   = "Plug and Play ACPI",
        .get    = pnpacpi_get_resources,
        .set    = pnpacpi_set_resources,
@@ -234,7 +234,7 @@ static acpi_status __init pnpacpi_add_device_handler(acpi_handle handle,
 }
 
 int pnpacpi_disabled __initdata;
-int __init pnpacpi_init(void)
+static int __init pnpacpi_init(void)
 {
        if (acpi_disabled || pnpacpi_disabled) {
                pnp_info("PnP ACPI: disabled");
@@ -258,4 +258,6 @@ static int __init pnpacpi_setup(char *str)
 }
 __setup("pnpacpi=", pnpacpi_setup);
 
+#if 0
 EXPORT_SYMBOL(pnpacpi_protocol);
+#endif
index 887ad8939349e9f3eb37fc9bcc1ddb893b64fce4..6ded527169f4b805b43a77dba11a5c0b23d42af8 100644 (file)
@@ -477,12 +477,14 @@ int pnp_check_dma(struct pnp_dev * dev, int idx)
 }
 
 
+#if 0
 EXPORT_SYMBOL(pnp_register_dependent_option);
 EXPORT_SYMBOL(pnp_register_independent_option);
 EXPORT_SYMBOL(pnp_register_irq_resource);
 EXPORT_SYMBOL(pnp_register_dma_resource);
 EXPORT_SYMBOL(pnp_register_port_resource);
 EXPORT_SYMBOL(pnp_register_mem_resource);
+#endif  /*  0  */
 
 
 /* format is: pnp_reserve_irq=irq1[,irq2] .... */
index aadbac29103cfc7601291e8fc0415f46d6cafc85..584d57cb393a1e1cc7339e11b7d747882016b85c 100644 (file)
@@ -353,7 +353,6 @@ struct pnp_protocol {
 int pnp_register_protocol(struct pnp_protocol *protocol);
 void pnp_unregister_protocol(struct pnp_protocol *protocol);
 int pnp_add_device(struct pnp_dev *dev);
-void pnp_remove_device(struct pnp_dev *dev);
 int pnp_device_attach(struct pnp_dev *pnp_dev);
 void pnp_device_detach(struct pnp_dev *pnp_dev);
 extern struct list_head pnp_global;
@@ -399,7 +398,6 @@ static inline int pnp_register_protocol(struct pnp_protocol *protocol) { return
 static inline void pnp_unregister_protocol(struct pnp_protocol *protocol) { }
 static inline int pnp_init_device(struct pnp_dev *dev) { return -ENODEV; }
 static inline int pnp_add_device(struct pnp_dev *dev) { return -ENODEV; }
-static inline void pnp_remove_device(struct pnp_dev *dev) { }
 static inline int pnp_device_attach(struct pnp_dev *pnp_dev) { return -ENODEV; }
 static inline void pnp_device_detach(struct pnp_dev *pnp_dev) { ; }