Commit 4485c0d7 authored by Adam Belay's avatar Adam Belay

[PATCH] 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
parent ecf2c214
...@@ -4,15 +4,17 @@ ...@@ -4,15 +4,17 @@
mainmenu_option next_comment mainmenu_option next_comment
comment 'Plug and Play configuration' 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 if [ "$CONFIG_PNP" = "y" ]; then
dep_bool ' PnP Debug Messages' CONFIG_PNP_DEBUG $CONFIG_PNP 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 if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
dep_bool ' ISA Plug and Play support (EXPERIMENTAL)' CONFIG_ISAPNP $CONFIG_PNP bool ' ISA Plug and Play support (EXPERIMENTAL)' CONFIG_ISAPNP
dep_bool ' Plug and Play BIOS support (EXPERIMENTAL)' CONFIG_PNPBIOS $CONFIG_PNP bool ' Plug and Play BIOS support (EXPERIMENTAL)' CONFIG_PNPBIOS
fi
fi fi
endmenu endmenu
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
# Makefile for the Linux Plug-and-Play Support. # 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_PNPBIOS) += pnpbios/
obj-$(CONFIG_ISAPNP) += isapnp/ 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 include $(TOPDIR)/Rules.make
...@@ -4,8 +4,5 @@ extern void *pnp_alloc(long size); ...@@ -4,8 +4,5 @@ extern void *pnp_alloc(long size);
extern int pnp_interface_attach_device(struct pnp_dev *dev); extern int pnp_interface_attach_device(struct pnp_dev *dev);
extern void pnp_name_device(struct pnp_dev *dev); extern void pnp_name_device(struct pnp_dev *dev);
extern void pnp_fixup_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_ids(struct pnp_dev *dev);
extern void pnp_free_resources(struct pnp_resources *resources); extern void pnp_free_resources(struct pnp_resources *resources);
...@@ -93,7 +93,7 @@ static int pnp_device_probe(struct device *dev) ...@@ -93,7 +93,7 @@ static int pnp_device_probe(struct device *dev)
if (pnp_dev->active == 0) if (pnp_dev->active == 0)
if(pnp_activate_dev(pnp_dev)<0) if(pnp_activate_dev(pnp_dev)<0)
return 0; return -1;
if (pnp_drv->probe && pnp_dev->active) { if (pnp_drv->probe && pnp_dev->active) {
if (pnp_dev->card && pnp_drv->card_id_table){ if (pnp_dev->card && pnp_drv->card_id_table){
card_id = match_card(pnp_drv, pnp_dev->card); card_id = match_card(pnp_drv, pnp_dev->card);
......
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
# Makefile for the kernel ISAPNP driver. # Makefile for the kernel ISAPNP driver.
# #
export-objs := core.o export-objs := core.o compat.o
isapnp-proc-$(CONFIG_PROC_FS) = proc.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 include $(TOPDIR)/Rules.make
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#include <linux/isapnp.h> #include <linux/isapnp.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/module.h> #include <linux/module.h>
#include "base.h"
static void pnp_convert_id(char *buf, unsigned short vendor, unsigned short device) static void pnp_convert_id(char *buf, unsigned short vendor, unsigned short device)
{ {
......
...@@ -227,25 +227,16 @@ int pnp_disable_dev(struct pnp_dev *dev); ...@@ -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); int pnp_raw_set_dev(struct pnp_dev *dev, int depnum, int mode);
/* driver */ /* 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_add_id(struct pnp_id *id, struct pnp_dev *dev);
int pnp_register_driver(struct pnp_driver *drv); int pnp_register_driver(struct pnp_driver *drv);
void pnp_unregister_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 #else
/* just in case anyone decides to call these without PnP Support Enabled */ /* 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 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_init_device(struct pnp_dev *dev) { return -ENODEV; }
static inline int pnp_add_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 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 ...@@ -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_activate_dev(struct pnp_dev *dev) { return -ENODEV; }
static inline int pnp_disable_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 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_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 int pnp_register_driver(struct pnp_driver *drv) { return -ENODEV; }
static inline void pnp_unregister_driver(struct pnp_driver *drv) { ; } 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, static inline struct pnp_card *pnp_find_card(unsigned short vendor,
unsigned short device, unsigned short device,
struct pnp_card *from) { return NULL; } struct pnp_card *from) { return NULL; }
...@@ -271,7 +278,7 @@ static inline struct pnp_dev *pnp_find_dev(struct pnp_card *card, ...@@ -271,7 +278,7 @@ static inline struct pnp_dev *pnp_find_dev(struct pnp_card *card,
unsigned short function, unsigned short function,
struct pnp_dev *from) { return NULL; } struct pnp_dev *from) { return NULL; }
#endif /* CONFIG_PNP */ #endif /* CONFIG_ISAPNP */
#ifdef DEBUG #ifdef DEBUG
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment