PnP Rewrite Fixes - 2.5.44
Subsystems (2)
PATCH 1/1 PnP Rewrite Fixes - 2.5.44
This patch addresses a few minor issues for the Linux Plug and Play Rewrite. It is against 2.5.44.
They are as follows.
1.) fix Config.in file - from Adrian Bunk and Roman Zippel
2.) if unable to activate a device the match should fail. This can be done now that the driver model matching bug has been corrected.
3.) move compat.c to isapnp directory and fix everything accordingly - suggested by Stelian Pop. This fixes a compile error if ISAPNP is disabled. 4.) fix a typo in pnp.h - patch from Skip Ford
Please Apply,
Adam
drivers/pnp/Config.in +9 -7
@@ -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
drivers/pnp/Makefile +2 -2
@@ -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
drivers/pnp/base.h +0 -3
@@ -4,8 +4,5 @@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); - -
drivers/pnp/compat.c +0 -94
94 lines not on this page · raw message
drivers/pnp/driver.c +1 -1
@@ -93,7 +93,7 @@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);
drivers/pnp/isapnp/Makefile +2 -2
@@ -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
drivers/pnp/isapnp/compat.c +93 -0
93 lines not on this page · raw message
include/linux/pnp.h +19 -12
@@ -227,25 +227,16 @@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_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 @@ unsigned short function, struct pnp_dev *from) { return NULL; } -#endif /* CONFIG_PNP */ +#endif /* CONFIG_ISAPNP */ #ifdef DEBUG
Quoted 5 lines · Adam Belay
This patch addresses a few minor issues for the Linux Plug and Play Rewrite. It is against 2.5.44.
They are as follows.
Quoted 8 lines
1.) fix Config.in file - from Adrian Bunk and Roman Zippel
2.) if unable to activate a device the match should fail. This can be done now that the driver model matching bug has been corrected.
3.) movecompat.cto isapnp directory and fix everything accordingly - suggested by Stelian Pop. This fixes a compile error if ISAPNP is disabled. 4.) fix a typo inpnp.h- patch from Skip FordPlease Apply,
Thanks, I've added this to a bk tree, and will send to Linus when he gets back from vacation.
greg k-h