diff options
Diffstat (limited to 'drivers/pnp/isapnp')
-rw-r--r-- | drivers/pnp/isapnp/core.c | 24 | ||||
-rw-r--r-- | drivers/pnp/isapnp/proc.c | 45 |
2 files changed, 7 insertions, 62 deletions
diff --git a/drivers/pnp/isapnp/core.c b/drivers/pnp/isapnp/core.c index b4e2aa995b53..b035d60a1dcc 100644 --- a/drivers/pnp/isapnp/core.c +++ b/drivers/pnp/isapnp/core.c | |||
@@ -47,9 +47,6 @@ | |||
47 | #if 0 | 47 | #if 0 |
48 | #define ISAPNP_REGION_OK | 48 | #define ISAPNP_REGION_OK |
49 | #endif | 49 | #endif |
50 | #if 0 | ||
51 | #define ISAPNP_DEBUG | ||
52 | #endif | ||
53 | 50 | ||
54 | int isapnp_disable; /* Disable ISA PnP */ | 51 | int isapnp_disable; /* Disable ISA PnP */ |
55 | static int isapnp_rdp; /* Read Data Port */ | 52 | static int isapnp_rdp; /* Read Data Port */ |
@@ -93,7 +90,6 @@ MODULE_LICENSE("GPL"); | |||
93 | 90 | ||
94 | static unsigned char isapnp_checksum_value; | 91 | static unsigned char isapnp_checksum_value; |
95 | static DEFINE_MUTEX(isapnp_cfg_mutex); | 92 | static DEFINE_MUTEX(isapnp_cfg_mutex); |
96 | static int isapnp_detected; | ||
97 | static int isapnp_csn_count; | 93 | static int isapnp_csn_count; |
98 | 94 | ||
99 | /* some prototypes */ | 95 | /* some prototypes */ |
@@ -335,7 +331,7 @@ static int __init isapnp_isolate(void) | |||
335 | } else if (iteration > 1) { | 331 | } else if (iteration > 1) { |
336 | break; | 332 | break; |
337 | } | 333 | } |
338 | __next: | 334 | __next: |
339 | if (csn == 255) | 335 | if (csn == 255) |
340 | break; | 336 | break; |
341 | checksum = 0x6a; | 337 | checksum = 0x6a; |
@@ -733,7 +729,7 @@ static int __init isapnp_create_device(struct pnp_card *card, | |||
733 | "isapnp: unexpected or unknown tag type 0x%x for logical device %i (device %i), ignored\n", | 729 | "isapnp: unexpected or unknown tag type 0x%x for logical device %i (device %i), ignored\n", |
734 | type, dev->number, card->number); | 730 | type, dev->number, card->number); |
735 | } | 731 | } |
736 | __skip: | 732 | __skip: |
737 | if (size > 0) | 733 | if (size > 0) |
738 | isapnp_skip_bytes(size); | 734 | isapnp_skip_bytes(size); |
739 | } | 735 | } |
@@ -788,7 +784,7 @@ static void __init isapnp_parse_resource_map(struct pnp_card *card) | |||
788 | "isapnp: unexpected or unknown tag type 0x%x for device %i, ignored\n", | 784 | "isapnp: unexpected or unknown tag type 0x%x for device %i, ignored\n", |
789 | type, card->number); | 785 | type, card->number); |
790 | } | 786 | } |
791 | __skip: | 787 | __skip: |
792 | if (size > 0) | 788 | if (size > 0) |
793 | isapnp_skip_bytes(size); | 789 | isapnp_skip_bytes(size); |
794 | } | 790 | } |
@@ -940,9 +936,6 @@ EXPORT_SYMBOL(isapnp_protocol); | |||
940 | EXPORT_SYMBOL(isapnp_present); | 936 | EXPORT_SYMBOL(isapnp_present); |
941 | EXPORT_SYMBOL(isapnp_cfg_begin); | 937 | EXPORT_SYMBOL(isapnp_cfg_begin); |
942 | EXPORT_SYMBOL(isapnp_cfg_end); | 938 | EXPORT_SYMBOL(isapnp_cfg_end); |
943 | #if 0 | ||
944 | EXPORT_SYMBOL(isapnp_read_byte); | ||
945 | #endif | ||
946 | EXPORT_SYMBOL(isapnp_write_byte); | 939 | EXPORT_SYMBOL(isapnp_write_byte); |
947 | 940 | ||
948 | static int isapnp_read_resources(struct pnp_dev *dev, | 941 | static int isapnp_read_resources(struct pnp_dev *dev, |
@@ -993,6 +986,7 @@ static int isapnp_get_resources(struct pnp_dev *dev, | |||
993 | struct pnp_resource_table *res) | 986 | struct pnp_resource_table *res) |
994 | { | 987 | { |
995 | int ret; | 988 | int ret; |
989 | |||
996 | pnp_init_resource_table(res); | 990 | pnp_init_resource_table(res); |
997 | isapnp_cfg_begin(dev->card->number, dev->number); | 991 | isapnp_cfg_begin(dev->card->number, dev->number); |
998 | ret = isapnp_read_resources(dev, res); | 992 | ret = isapnp_read_resources(dev, res); |
@@ -1046,7 +1040,7 @@ static int isapnp_set_resources(struct pnp_dev *dev, | |||
1046 | 1040 | ||
1047 | static int isapnp_disable_resources(struct pnp_dev *dev) | 1041 | static int isapnp_disable_resources(struct pnp_dev *dev) |
1048 | { | 1042 | { |
1049 | if (!dev || !dev->active) | 1043 | if (!dev->active) |
1050 | return -EINVAL; | 1044 | return -EINVAL; |
1051 | isapnp_cfg_begin(dev->card->number, dev->number); | 1045 | isapnp_cfg_begin(dev->card->number, dev->number); |
1052 | isapnp_deactivate(dev->number); | 1046 | isapnp_deactivate(dev->number); |
@@ -1069,7 +1063,6 @@ static int __init isapnp_init(void) | |||
1069 | struct pnp_dev *dev; | 1063 | struct pnp_dev *dev; |
1070 | 1064 | ||
1071 | if (isapnp_disable) { | 1065 | if (isapnp_disable) { |
1072 | isapnp_detected = 0; | ||
1073 | printk(KERN_INFO "isapnp: ISA Plug & Play support disabled\n"); | 1066 | printk(KERN_INFO "isapnp: ISA Plug & Play support disabled\n"); |
1074 | return 0; | 1067 | return 0; |
1075 | } | 1068 | } |
@@ -1117,7 +1110,6 @@ static int __init isapnp_init(void) | |||
1117 | } | 1110 | } |
1118 | isapnp_set_rdp(); | 1111 | isapnp_set_rdp(); |
1119 | } | 1112 | } |
1120 | isapnp_detected = 1; | ||
1121 | if (isapnp_rdp < 0x203 || isapnp_rdp > 0x3ff) { | 1113 | if (isapnp_rdp < 0x203 || isapnp_rdp > 0x3ff) { |
1122 | cards = isapnp_isolate(); | 1114 | cards = isapnp_isolate(); |
1123 | if (cards < 0 || (isapnp_rdp < 0x203 || isapnp_rdp > 0x3ff)) { | 1115 | if (cards < 0 || (isapnp_rdp < 0x203 || isapnp_rdp > 0x3ff)) { |
@@ -1125,7 +1117,6 @@ static int __init isapnp_init(void) | |||
1125 | release_region(_PIDXR, 1); | 1117 | release_region(_PIDXR, 1); |
1126 | #endif | 1118 | #endif |
1127 | release_region(_PNPWRP, 1); | 1119 | release_region(_PNPWRP, 1); |
1128 | isapnp_detected = 0; | ||
1129 | printk(KERN_INFO | 1120 | printk(KERN_INFO |
1130 | "isapnp: No Plug & Play device found\n"); | 1121 | "isapnp: No Plug & Play device found\n"); |
1131 | return 0; | 1122 | return 0; |
@@ -1148,13 +1139,12 @@ static int __init isapnp_init(void) | |||
1148 | } | 1139 | } |
1149 | } | 1140 | } |
1150 | } | 1141 | } |
1151 | if (cards) { | 1142 | if (cards) |
1152 | printk(KERN_INFO | 1143 | printk(KERN_INFO |
1153 | "isapnp: %i Plug & Play card%s detected total\n", cards, | 1144 | "isapnp: %i Plug & Play card%s detected total\n", cards, |
1154 | cards > 1 ? "s" : ""); | 1145 | cards > 1 ? "s" : ""); |
1155 | } else { | 1146 | else |
1156 | printk(KERN_INFO "isapnp: No Plug & Play card found\n"); | 1147 | printk(KERN_INFO "isapnp: No Plug & Play card found\n"); |
1157 | } | ||
1158 | 1148 | ||
1159 | isapnp_proc_init(); | 1149 | isapnp_proc_init(); |
1160 | return 0; | 1150 | return 0; |
diff --git a/drivers/pnp/isapnp/proc.c b/drivers/pnp/isapnp/proc.c index 3fbc0f9ffc26..560ccb640816 100644 --- a/drivers/pnp/isapnp/proc.c +++ b/drivers/pnp/isapnp/proc.c | |||
@@ -112,33 +112,6 @@ static int isapnp_proc_attach_device(struct pnp_dev *dev) | |||
112 | return 0; | 112 | return 0; |
113 | } | 113 | } |
114 | 114 | ||
115 | #ifdef MODULE | ||
116 | static int __exit isapnp_proc_detach_device(struct pnp_dev *dev) | ||
117 | { | ||
118 | struct pnp_card *bus = dev->card; | ||
119 | struct proc_dir_entry *de; | ||
120 | char name[16]; | ||
121 | |||
122 | if (!(de = bus->procdir)) | ||
123 | return -EINVAL; | ||
124 | sprintf(name, "%02x", dev->number); | ||
125 | remove_proc_entry(name, de); | ||
126 | return 0; | ||
127 | } | ||
128 | |||
129 | static int __exit isapnp_proc_detach_bus(struct pnp_card *bus) | ||
130 | { | ||
131 | struct proc_dir_entry *de; | ||
132 | char name[16]; | ||
133 | |||
134 | if (!(de = bus->procdir)) | ||
135 | return -EINVAL; | ||
136 | sprintf(name, "%02x", bus->number); | ||
137 | remove_proc_entry(name, isapnp_proc_bus_dir); | ||
138 | return 0; | ||
139 | } | ||
140 | #endif /* MODULE */ | ||
141 | |||
142 | int __init isapnp_proc_init(void) | 115 | int __init isapnp_proc_init(void) |
143 | { | 116 | { |
144 | struct pnp_dev *dev; | 117 | struct pnp_dev *dev; |
@@ -149,21 +122,3 @@ int __init isapnp_proc_init(void) | |||
149 | } | 122 | } |
150 | return 0; | 123 | return 0; |
151 | } | 124 | } |
152 | |||
153 | #ifdef MODULE | ||
154 | int __exit isapnp_proc_done(void) | ||
155 | { | ||
156 | struct pnp_dev *dev; | ||
157 | struct pnp_bus *card; | ||
158 | |||
159 | isapnp_for_each_dev(dev) { | ||
160 | isapnp_proc_detach_device(dev); | ||
161 | } | ||
162 | isapnp_for_each_card(card) { | ||
163 | isapnp_proc_detach_bus(card); | ||
164 | } | ||
165 | if (isapnp_proc_bus_dir) | ||
166 | remove_proc_entry("isapnp", proc_bus); | ||
167 | return 0; | ||
168 | } | ||
169 | #endif /* MODULE */ | ||