diff --git a/drivers/pnp/Config.in b/drivers/pnp/Config.in index 437735cd7bfd5ca728f323b6208dd8e35fe8c966..9e9f25ebac8162a5358a7ec6dcf59dc42a8ef583 100644 --- a/drivers/pnp/Config.in +++ b/drivers/pnp/Config.in @@ -4,15 +4,17 @@ mainmenu_option next_comment comment 'Plug and Play configuration' -dep_bool 'Plug and Play support' CONFIG_PNP +bool 'Plug and Play support' CONFIG_PNP - dep_bool ' Plug and Play device name database' CONFIG_PNP_NAMES $CONFIG_PNP - dep_bool ' PnP Debug Messages' CONFIG_PNP_DEBUG $CONFIG_PNP +if [ "$CONFIG_PNP" = "y" ]; then + bool ' Plug and Play device name database' CONFIG_PNP_NAMES + bool ' PnP Debug Messages' CONFIG_PNP_DEBUG -comment 'Protocols' $CONFIG_PNP + comment 'Protocols' -if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then - dep_bool ' ISA Plug and Play support (EXPERIMENTAL)' CONFIG_ISAPNP $CONFIG_PNP - dep_bool ' Plug and Play BIOS support (EXPERIMENTAL)' CONFIG_PNPBIOS $CONFIG_PNP + if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then + bool ' ISA Plug and Play support (EXPERIMENTAL)' CONFIG_ISAPNP + bool ' Plug and Play BIOS support (EXPERIMENTAL)' CONFIG_PNPBIOS + fi fi endmenu diff --git a/drivers/pnp/Makefile b/drivers/pnp/Makefile index ed69ce43d70338ed84d4187a44eb31ef7329c4d4..f4c9e899ad83aff38fa79c5ea5f46fdea34c7084 100644 --- a/drivers/pnp/Makefile +++ b/drivers/pnp/Makefile @@ -2,11 +2,11 @@ # Makefile for the Linux Plug-and-Play Support. # -obj-y := core.o driver.o resource.o interface.o quirks.o names.o compat.o system.o +obj-y := core.o driver.o resource.o interface.o quirks.o names.o system.o obj-$(CONFIG_PNPBIOS) += pnpbios/ obj-$(CONFIG_ISAPNP) += isapnp/ -export-objs := core.o driver.o resource.o compat.o +export-objs := core.o driver.o resource.o include $(TOPDIR)/Rules.make diff --git a/drivers/pnp/base.h b/drivers/pnp/base.h index 69b090891ed7bcc79943e98db2869969ddc4c511..46fc3085016381c4ae7fd545b63154658fcf7194 100644 --- a/drivers/pnp/base.h +++ b/drivers/pnp/base.h @@ -4,8 +4,5 @@ extern void *pnp_alloc(long size); extern int pnp_interface_attach_device(struct pnp_dev *dev); extern void pnp_name_device(struct pnp_dev *dev); extern void pnp_fixup_device(struct pnp_dev *dev); -extern int compare_pnp_id(struct list_head * id_list, char * id); extern void pnp_free_ids(struct pnp_dev *dev); extern void pnp_free_resources(struct pnp_resources *resources); - - diff --git a/drivers/pnp/driver.c b/drivers/pnp/driver.c index 48ebd947c35a0505a508b7cfc4fa954ccf6d5686..92b55759f3e17774961c596324953adbba4e80c5 100644 --- a/drivers/pnp/driver.c +++ b/drivers/pnp/driver.c @@ -93,7 +93,7 @@ static int pnp_device_probe(struct device *dev) if (pnp_dev->active == 0) if(pnp_activate_dev(pnp_dev)<0) - return 0; + return -1; if (pnp_drv->probe && pnp_dev->active) { if (pnp_dev->card && pnp_drv->card_id_table){ card_id = match_card(pnp_drv, pnp_dev->card); diff --git a/drivers/pnp/isapnp/Makefile b/drivers/pnp/isapnp/Makefile index 826ad78cb3d1a3d9a897b814c335666df7735011..df5992e243567bf3b90fe43c3bdd666ae7aadd7b 100644 --- a/drivers/pnp/isapnp/Makefile +++ b/drivers/pnp/isapnp/Makefile @@ -2,10 +2,10 @@ # Makefile for the kernel ISAPNP driver. # -export-objs := core.o +export-objs := core.o compat.o isapnp-proc-$(CONFIG_PROC_FS) = proc.o -obj-y := core.o $(isapnp-proc-y) +obj-y := core.o compat.o $(isapnp-proc-y) include $(TOPDIR)/Rules.make diff --git a/drivers/pnp/compat.c b/drivers/pnp/isapnp/compat.c similarity index 99% rename from drivers/pnp/compat.c rename to drivers/pnp/isapnp/compat.c index 0ed7800e4df6681d74077b64bfa2a831c318a6be..da7462ebc20bf37806c27fcc11779f6a3c77b582 100644 --- a/drivers/pnp/compat.c +++ b/drivers/pnp/isapnp/compat.c @@ -12,7 +12,6 @@ #include <linux/isapnp.h> #include <linux/string.h> #include <linux/module.h> -#include "base.h" static void pnp_convert_id(char *buf, unsigned short vendor, unsigned short device) { diff --git a/include/linux/pnp.h b/include/linux/pnp.h index 5dc223b39724a0e9974f6dc14bc0d2be0a6f02d8..7088770373545f959fdd828aa63867c9d0f29ffd 100644 --- a/include/linux/pnp.h +++ b/include/linux/pnp.h @@ -227,25 +227,16 @@ int pnp_disable_dev(struct pnp_dev *dev); int pnp_raw_set_dev(struct pnp_dev *dev, int depnum, int mode); /* driver */ +int compare_pnp_id(struct list_head * id_list, const char * id); int pnp_add_id(struct pnp_id *id, struct pnp_dev *dev); int pnp_register_driver(struct pnp_driver *drv); void pnp_unregister_driver(struct pnp_driver *drv); -/* compat */ -struct pnp_card *pnp_find_card(unsigned short vendor, - unsigned short device, - struct pnp_card *from); -struct pnp_dev *pnp_find_dev(struct pnp_card *card, - unsigned short vendor, - unsigned short function, - struct pnp_dev *from); - - #else /* just in case anyone decides to call these without PnP Support Enabled */ static inline int pnp_protocol_register(struct pnp_protocol *protocol) { return -ENODEV; } -static inline void pnp_protocol_unregister(struct pnp_protocol *protocol) { ; ) +static inline void pnp_protocol_unregister(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) { ; } @@ -260,9 +251,25 @@ static inline int pnp_add_mem32_resource(struct pnp_dev *dev, int depnum, struct static inline int pnp_activate_dev(struct pnp_dev *dev) { return -ENODEV; } static inline int pnp_disable_dev(struct pnp_dev *dev) { return -ENODEV; } static inline int pnp_raw_set_dev(struct pnp_dev *dev, int depnum, int mode) { return -ENODEV; } +static inline int compare_pnp_id(struct list_head * id_list, char * id) { return -ENODEV; } static inline int pnp_add_id(struct pnp_id *id, struct pnp_dev *dev) { return -ENODEV; } static inline int pnp_register_driver(struct pnp_driver *drv) { return -ENODEV; } static inline void pnp_unregister_driver(struct pnp_driver *drv) { ; } + +#endif /* CONFIG_PNP */ + +#if defined(CONFIG_ISAPNP) +/* compat */ +struct pnp_card *pnp_find_card(unsigned short vendor, + unsigned short device, + struct pnp_card *from); +struct pnp_dev *pnp_find_dev(struct pnp_card *card, + unsigned short vendor, + unsigned short function, + struct pnp_dev *from); + +#else + static inline struct pnp_card *pnp_find_card(unsigned short vendor, unsigned short device, struct pnp_card *from) { return NULL; } @@ -271,7 +278,7 @@ static inline struct pnp_dev *pnp_find_dev(struct pnp_card *card, unsigned short function, struct pnp_dev *from) { return NULL; } -#endif /* CONFIG_PNP */ +#endif /* CONFIG_ISAPNP */ #ifdef DEBUG