diff options
Diffstat (limited to 'drivers/pnp')
-rw-r--r-- | drivers/pnp/Kconfig | 20 | ||||
-rw-r--r-- | drivers/pnp/Makefile | 4 | ||||
-rw-r--r-- | drivers/pnp/base.h | 10 | ||||
-rw-r--r-- | drivers/pnp/core.c | 29 | ||||
-rw-r--r-- | drivers/pnp/driver.c | 4 | ||||
-rw-r--r-- | drivers/pnp/isapnp/Makefile | 4 | ||||
-rw-r--r-- | drivers/pnp/isapnp/core.c | 12 | ||||
-rw-r--r-- | drivers/pnp/manager.c | 34 | ||||
-rw-r--r-- | drivers/pnp/pnpacpi/Makefile | 4 | ||||
-rw-r--r-- | drivers/pnp/pnpacpi/core.c | 10 | ||||
-rw-r--r-- | drivers/pnp/pnpacpi/rsparser.c | 43 | ||||
-rw-r--r-- | drivers/pnp/pnpbios/Makefile | 4 | ||||
-rw-r--r-- | drivers/pnp/pnpbios/core.c | 4 | ||||
-rw-r--r-- | drivers/pnp/pnpbios/rsparser.c | 18 | ||||
-rw-r--r-- | drivers/pnp/quirks.c | 6 | ||||
-rw-r--r-- | drivers/pnp/resource.c | 12 | ||||
-rw-r--r-- | drivers/pnp/support.c | 14 |
17 files changed, 117 insertions, 115 deletions
diff --git a/drivers/pnp/Kconfig b/drivers/pnp/Kconfig index 821933f9aa57..2a37b3fedb8e 100644 --- a/drivers/pnp/Kconfig +++ b/drivers/pnp/Kconfig | |||
@@ -20,13 +20,21 @@ menuconfig PNP | |||
20 | 20 | ||
21 | If unsure, say Y. | 21 | If unsure, say Y. |
22 | 22 | ||
23 | if PNP | 23 | config PNP_DEBUG_MESSAGES |
24 | 24 | default y | |
25 | config PNP_DEBUG | 25 | bool "PNP debugging messages" |
26 | bool "PnP Debug Messages" | 26 | depends on PNP |
27 | help | 27 | help |
28 | Say Y if you want the Plug and Play Layer to print debug messages. | 28 | Say Y here if you want the PNP layer to be able to produce debugging |
29 | This is useful if you are developing a PnP driver or troubleshooting. | 29 | messages if needed. The messages can be enabled at boot-time with |
30 | the pnp.debug kernel parameter. | ||
31 | |||
32 | This option allows you to save a bit of space if you do not want | ||
33 | the messages to even be built into the kernel. | ||
34 | |||
35 | If you have any doubts about this, say Y here. | ||
36 | |||
37 | if PNP | ||
30 | 38 | ||
31 | comment "Protocols" | 39 | comment "Protocols" |
32 | 40 | ||
diff --git a/drivers/pnp/Makefile b/drivers/pnp/Makefile index 26f5abc9c3f7..a381a92fd1b6 100644 --- a/drivers/pnp/Makefile +++ b/drivers/pnp/Makefile | |||
@@ -7,7 +7,3 @@ obj-y := core.o card.o driver.o resource.o manager.o support.o interface.o quir | |||
7 | obj-$(CONFIG_PNPACPI) += pnpacpi/ | 7 | obj-$(CONFIG_PNPACPI) += pnpacpi/ |
8 | obj-$(CONFIG_PNPBIOS) += pnpbios/ | 8 | obj-$(CONFIG_PNPBIOS) += pnpbios/ |
9 | obj-$(CONFIG_ISAPNP) += isapnp/ | 9 | obj-$(CONFIG_ISAPNP) += isapnp/ |
10 | |||
11 | ifeq ($(CONFIG_PNP_DEBUG),y) | ||
12 | EXTRA_CFLAGS += -DDEBUG | ||
13 | endif | ||
diff --git a/drivers/pnp/base.h b/drivers/pnp/base.h index 9fd7bb9b7dce..5e4e82c82659 100644 --- a/drivers/pnp/base.h +++ b/drivers/pnp/base.h | |||
@@ -166,3 +166,13 @@ struct pnp_resource *pnp_add_io_resource(struct pnp_dev *dev, | |||
166 | struct pnp_resource *pnp_add_mem_resource(struct pnp_dev *dev, | 166 | struct pnp_resource *pnp_add_mem_resource(struct pnp_dev *dev, |
167 | resource_size_t start, | 167 | resource_size_t start, |
168 | resource_size_t end, int flags); | 168 | resource_size_t end, int flags); |
169 | |||
170 | extern int pnp_debug; | ||
171 | |||
172 | #if defined(CONFIG_PNP_DEBUG_MESSAGES) | ||
173 | #define pnp_dbg(dev, format, arg...) \ | ||
174 | ({ if (pnp_debug) dev_printk(KERN_DEBUG, dev, format, ## arg); 0; }) | ||
175 | #else | ||
176 | #define pnp_dbg(dev, format, arg...) \ | ||
177 | ({ if (0) dev_printk(KERN_DEBUG, dev, format, ## arg); 0; }) | ||
178 | #endif | ||
diff --git a/drivers/pnp/core.c b/drivers/pnp/core.c index a411582bcd72..521561509a75 100644 --- a/drivers/pnp/core.c +++ b/drivers/pnp/core.c | |||
@@ -185,6 +185,9 @@ int __pnp_add_device(struct pnp_dev *dev) | |||
185 | int pnp_add_device(struct pnp_dev *dev) | 185 | int pnp_add_device(struct pnp_dev *dev) |
186 | { | 186 | { |
187 | int ret; | 187 | int ret; |
188 | char buf[128]; | ||
189 | int len = 0; | ||
190 | struct pnp_id *id; | ||
188 | 191 | ||
189 | if (dev->card) | 192 | if (dev->card) |
190 | return -EINVAL; | 193 | return -EINVAL; |
@@ -193,17 +196,12 @@ int pnp_add_device(struct pnp_dev *dev) | |||
193 | if (ret) | 196 | if (ret) |
194 | return ret; | 197 | return ret; |
195 | 198 | ||
196 | #ifdef CONFIG_PNP_DEBUG | 199 | buf[0] = '\0'; |
197 | { | 200 | for (id = dev->id; id; id = id->next) |
198 | struct pnp_id *id; | 201 | len += scnprintf(buf + len, sizeof(buf) - len, " %s", id->id); |
199 | 202 | ||
200 | dev_printk(KERN_DEBUG, &dev->dev, "%s device, IDs", | 203 | pnp_dbg(&dev->dev, "%s device, IDs%s (%s)\n", |
201 | dev->protocol->name); | 204 | dev->protocol->name, buf, dev->active ? "active" : "disabled"); |
202 | for (id = dev->id; id; id = id->next) | ||
203 | printk(" %s", id->id); | ||
204 | printk(" (%s)\n", dev->active ? "active" : "disabled"); | ||
205 | } | ||
206 | #endif | ||
207 | return 0; | 205 | return 0; |
208 | } | 206 | } |
209 | 207 | ||
@@ -223,3 +221,14 @@ static int __init pnp_init(void) | |||
223 | } | 221 | } |
224 | 222 | ||
225 | subsys_initcall(pnp_init); | 223 | subsys_initcall(pnp_init); |
224 | |||
225 | int pnp_debug; | ||
226 | |||
227 | #if defined(CONFIG_PNP_DEBUG_MESSAGES) | ||
228 | static int __init pnp_debug_setup(char *__unused) | ||
229 | { | ||
230 | pnp_debug = 1; | ||
231 | return 1; | ||
232 | } | ||
233 | __setup("pnp.debug", pnp_debug_setup); | ||
234 | #endif | ||
diff --git a/drivers/pnp/driver.c b/drivers/pnp/driver.c index d3f869ee1d92..54673a4f5901 100644 --- a/drivers/pnp/driver.c +++ b/drivers/pnp/driver.c | |||
@@ -114,7 +114,6 @@ static int pnp_device_probe(struct device *dev) | |||
114 | } else | 114 | } else |
115 | goto fail; | 115 | goto fail; |
116 | 116 | ||
117 | dev_dbg(dev, "driver attached\n"); | ||
118 | return error; | 117 | return error; |
119 | 118 | ||
120 | fail: | 119 | fail: |
@@ -210,8 +209,6 @@ struct bus_type pnp_bus_type = { | |||
210 | 209 | ||
211 | int pnp_register_driver(struct pnp_driver *drv) | 210 | int pnp_register_driver(struct pnp_driver *drv) |
212 | { | 211 | { |
213 | pnp_dbg("the driver '%s' has been registered", drv->name); | ||
214 | |||
215 | drv->driver.name = drv->name; | 212 | drv->driver.name = drv->name; |
216 | drv->driver.bus = &pnp_bus_type; | 213 | drv->driver.bus = &pnp_bus_type; |
217 | 214 | ||
@@ -221,7 +218,6 @@ int pnp_register_driver(struct pnp_driver *drv) | |||
221 | void pnp_unregister_driver(struct pnp_driver *drv) | 218 | void pnp_unregister_driver(struct pnp_driver *drv) |
222 | { | 219 | { |
223 | driver_unregister(&drv->driver); | 220 | driver_unregister(&drv->driver); |
224 | pnp_dbg("the driver '%s' has been unregistered", drv->name); | ||
225 | } | 221 | } |
226 | 222 | ||
227 | /** | 223 | /** |
diff --git a/drivers/pnp/isapnp/Makefile b/drivers/pnp/isapnp/Makefile index 3e38f06f8d78..cac18bbfb817 100644 --- a/drivers/pnp/isapnp/Makefile +++ b/drivers/pnp/isapnp/Makefile | |||
@@ -5,7 +5,3 @@ | |||
5 | isapnp-proc-$(CONFIG_PROC_FS) = proc.o | 5 | isapnp-proc-$(CONFIG_PROC_FS) = proc.o |
6 | 6 | ||
7 | obj-y := core.o compat.o $(isapnp-proc-y) | 7 | obj-y := core.o compat.o $(isapnp-proc-y) |
8 | |||
9 | ifeq ($(CONFIG_PNP_DEBUG),y) | ||
10 | EXTRA_CFLAGS += -DDEBUG | ||
11 | endif | ||
diff --git a/drivers/pnp/isapnp/core.c b/drivers/pnp/isapnp/core.c index 101a835e8759..bd213ffbcd9e 100644 --- a/drivers/pnp/isapnp/core.c +++ b/drivers/pnp/isapnp/core.c | |||
@@ -901,7 +901,7 @@ static int isapnp_get_resources(struct pnp_dev *dev) | |||
901 | { | 901 | { |
902 | int i, ret; | 902 | int i, ret; |
903 | 903 | ||
904 | dev_dbg(&dev->dev, "get resources\n"); | 904 | pnp_dbg(&dev->dev, "get resources\n"); |
905 | pnp_init_resources(dev); | 905 | pnp_init_resources(dev); |
906 | isapnp_cfg_begin(dev->card->number, dev->number); | 906 | isapnp_cfg_begin(dev->card->number, dev->number); |
907 | dev->active = isapnp_read_byte(ISAPNP_CFG_ACTIVATE); | 907 | dev->active = isapnp_read_byte(ISAPNP_CFG_ACTIVATE); |
@@ -939,13 +939,13 @@ static int isapnp_set_resources(struct pnp_dev *dev) | |||
939 | struct resource *res; | 939 | struct resource *res; |
940 | int tmp; | 940 | int tmp; |
941 | 941 | ||
942 | dev_dbg(&dev->dev, "set resources\n"); | 942 | pnp_dbg(&dev->dev, "set resources\n"); |
943 | isapnp_cfg_begin(dev->card->number, dev->number); | 943 | isapnp_cfg_begin(dev->card->number, dev->number); |
944 | dev->active = 1; | 944 | dev->active = 1; |
945 | for (tmp = 0; tmp < ISAPNP_MAX_PORT; tmp++) { | 945 | for (tmp = 0; tmp < ISAPNP_MAX_PORT; tmp++) { |
946 | res = pnp_get_resource(dev, IORESOURCE_IO, tmp); | 946 | res = pnp_get_resource(dev, IORESOURCE_IO, tmp); |
947 | if (pnp_resource_enabled(res)) { | 947 | if (pnp_resource_enabled(res)) { |
948 | dev_dbg(&dev->dev, " set io %d to %#llx\n", | 948 | pnp_dbg(&dev->dev, " set io %d to %#llx\n", |
949 | tmp, (unsigned long long) res->start); | 949 | tmp, (unsigned long long) res->start); |
950 | isapnp_write_word(ISAPNP_CFG_PORT + (tmp << 1), | 950 | isapnp_write_word(ISAPNP_CFG_PORT + (tmp << 1), |
951 | res->start); | 951 | res->start); |
@@ -957,14 +957,14 @@ static int isapnp_set_resources(struct pnp_dev *dev) | |||
957 | int irq = res->start; | 957 | int irq = res->start; |
958 | if (irq == 2) | 958 | if (irq == 2) |
959 | irq = 9; | 959 | irq = 9; |
960 | dev_dbg(&dev->dev, " set irq %d to %d\n", tmp, irq); | 960 | pnp_dbg(&dev->dev, " set irq %d to %d\n", tmp, irq); |
961 | isapnp_write_byte(ISAPNP_CFG_IRQ + (tmp << 1), irq); | 961 | isapnp_write_byte(ISAPNP_CFG_IRQ + (tmp << 1), irq); |
962 | } | 962 | } |
963 | } | 963 | } |
964 | for (tmp = 0; tmp < ISAPNP_MAX_DMA; tmp++) { | 964 | for (tmp = 0; tmp < ISAPNP_MAX_DMA; tmp++) { |
965 | res = pnp_get_resource(dev, IORESOURCE_DMA, tmp); | 965 | res = pnp_get_resource(dev, IORESOURCE_DMA, tmp); |
966 | if (pnp_resource_enabled(res)) { | 966 | if (pnp_resource_enabled(res)) { |
967 | dev_dbg(&dev->dev, " set dma %d to %lld\n", | 967 | pnp_dbg(&dev->dev, " set dma %d to %lld\n", |
968 | tmp, (unsigned long long) res->start); | 968 | tmp, (unsigned long long) res->start); |
969 | isapnp_write_byte(ISAPNP_CFG_DMA + tmp, res->start); | 969 | isapnp_write_byte(ISAPNP_CFG_DMA + tmp, res->start); |
970 | } | 970 | } |
@@ -972,7 +972,7 @@ static int isapnp_set_resources(struct pnp_dev *dev) | |||
972 | for (tmp = 0; tmp < ISAPNP_MAX_MEM; tmp++) { | 972 | for (tmp = 0; tmp < ISAPNP_MAX_MEM; tmp++) { |
973 | res = pnp_get_resource(dev, IORESOURCE_MEM, tmp); | 973 | res = pnp_get_resource(dev, IORESOURCE_MEM, tmp); |
974 | if (pnp_resource_enabled(res)) { | 974 | if (pnp_resource_enabled(res)) { |
975 | dev_dbg(&dev->dev, " set mem %d to %#llx\n", | 975 | pnp_dbg(&dev->dev, " set mem %d to %#llx\n", |
976 | tmp, (unsigned long long) res->start); | 976 | tmp, (unsigned long long) res->start); |
977 | isapnp_write_word(ISAPNP_CFG_MEM + (tmp << 3), | 977 | isapnp_write_word(ISAPNP_CFG_MEM + (tmp << 3), |
978 | (res->start >> 8) & 0xffff); | 978 | (res->start >> 8) & 0xffff); |
diff --git a/drivers/pnp/manager.c b/drivers/pnp/manager.c index b526eaad3f6c..00fd3577b985 100644 --- a/drivers/pnp/manager.c +++ b/drivers/pnp/manager.c | |||
@@ -25,7 +25,7 @@ static int pnp_assign_port(struct pnp_dev *dev, struct pnp_port *rule, int idx) | |||
25 | 25 | ||
26 | res = pnp_get_resource(dev, IORESOURCE_IO, idx); | 26 | res = pnp_get_resource(dev, IORESOURCE_IO, idx); |
27 | if (res) { | 27 | if (res) { |
28 | dev_dbg(&dev->dev, " io %d already set to %#llx-%#llx " | 28 | pnp_dbg(&dev->dev, " io %d already set to %#llx-%#llx " |
29 | "flags %#lx\n", idx, (unsigned long long) res->start, | 29 | "flags %#lx\n", idx, (unsigned long long) res->start, |
30 | (unsigned long long) res->end, res->flags); | 30 | (unsigned long long) res->end, res->flags); |
31 | return 0; | 31 | return 0; |
@@ -38,7 +38,7 @@ static int pnp_assign_port(struct pnp_dev *dev, struct pnp_port *rule, int idx) | |||
38 | 38 | ||
39 | if (!rule->size) { | 39 | if (!rule->size) { |
40 | res->flags |= IORESOURCE_DISABLED; | 40 | res->flags |= IORESOURCE_DISABLED; |
41 | dev_dbg(&dev->dev, " io %d disabled\n", idx); | 41 | pnp_dbg(&dev->dev, " io %d disabled\n", idx); |
42 | goto __add; | 42 | goto __add; |
43 | } | 43 | } |
44 | 44 | ||
@@ -49,7 +49,7 @@ static int pnp_assign_port(struct pnp_dev *dev, struct pnp_port *rule, int idx) | |||
49 | res->start += rule->align; | 49 | res->start += rule->align; |
50 | res->end = res->start + rule->size - 1; | 50 | res->end = res->start + rule->size - 1; |
51 | if (res->start > rule->max || !rule->align) { | 51 | if (res->start > rule->max || !rule->align) { |
52 | dev_dbg(&dev->dev, " couldn't assign io %d " | 52 | pnp_dbg(&dev->dev, " couldn't assign io %d " |
53 | "(min %#llx max %#llx)\n", idx, | 53 | "(min %#llx max %#llx)\n", idx, |
54 | (unsigned long long) rule->min, | 54 | (unsigned long long) rule->min, |
55 | (unsigned long long) rule->max); | 55 | (unsigned long long) rule->max); |
@@ -68,7 +68,7 @@ static int pnp_assign_mem(struct pnp_dev *dev, struct pnp_mem *rule, int idx) | |||
68 | 68 | ||
69 | res = pnp_get_resource(dev, IORESOURCE_MEM, idx); | 69 | res = pnp_get_resource(dev, IORESOURCE_MEM, idx); |
70 | if (res) { | 70 | if (res) { |
71 | dev_dbg(&dev->dev, " mem %d already set to %#llx-%#llx " | 71 | pnp_dbg(&dev->dev, " mem %d already set to %#llx-%#llx " |
72 | "flags %#lx\n", idx, (unsigned long long) res->start, | 72 | "flags %#lx\n", idx, (unsigned long long) res->start, |
73 | (unsigned long long) res->end, res->flags); | 73 | (unsigned long long) res->end, res->flags); |
74 | return 0; | 74 | return 0; |
@@ -90,7 +90,7 @@ static int pnp_assign_mem(struct pnp_dev *dev, struct pnp_mem *rule, int idx) | |||
90 | 90 | ||
91 | if (!rule->size) { | 91 | if (!rule->size) { |
92 | res->flags |= IORESOURCE_DISABLED; | 92 | res->flags |= IORESOURCE_DISABLED; |
93 | dev_dbg(&dev->dev, " mem %d disabled\n", idx); | 93 | pnp_dbg(&dev->dev, " mem %d disabled\n", idx); |
94 | goto __add; | 94 | goto __add; |
95 | } | 95 | } |
96 | 96 | ||
@@ -101,7 +101,7 @@ static int pnp_assign_mem(struct pnp_dev *dev, struct pnp_mem *rule, int idx) | |||
101 | res->start += rule->align; | 101 | res->start += rule->align; |
102 | res->end = res->start + rule->size - 1; | 102 | res->end = res->start + rule->size - 1; |
103 | if (res->start > rule->max || !rule->align) { | 103 | if (res->start > rule->max || !rule->align) { |
104 | dev_dbg(&dev->dev, " couldn't assign mem %d " | 104 | pnp_dbg(&dev->dev, " couldn't assign mem %d " |
105 | "(min %#llx max %#llx)\n", idx, | 105 | "(min %#llx max %#llx)\n", idx, |
106 | (unsigned long long) rule->min, | 106 | (unsigned long long) rule->min, |
107 | (unsigned long long) rule->max); | 107 | (unsigned long long) rule->max); |
@@ -126,7 +126,7 @@ static int pnp_assign_irq(struct pnp_dev *dev, struct pnp_irq *rule, int idx) | |||
126 | 126 | ||
127 | res = pnp_get_resource(dev, IORESOURCE_IRQ, idx); | 127 | res = pnp_get_resource(dev, IORESOURCE_IRQ, idx); |
128 | if (res) { | 128 | if (res) { |
129 | dev_dbg(&dev->dev, " irq %d already set to %d flags %#lx\n", | 129 | pnp_dbg(&dev->dev, " irq %d already set to %d flags %#lx\n", |
130 | idx, (int) res->start, res->flags); | 130 | idx, (int) res->start, res->flags); |
131 | return 0; | 131 | return 0; |
132 | } | 132 | } |
@@ -138,7 +138,7 @@ static int pnp_assign_irq(struct pnp_dev *dev, struct pnp_irq *rule, int idx) | |||
138 | 138 | ||
139 | if (bitmap_empty(rule->map.bits, PNP_IRQ_NR)) { | 139 | if (bitmap_empty(rule->map.bits, PNP_IRQ_NR)) { |
140 | res->flags |= IORESOURCE_DISABLED; | 140 | res->flags |= IORESOURCE_DISABLED; |
141 | dev_dbg(&dev->dev, " irq %d disabled\n", idx); | 141 | pnp_dbg(&dev->dev, " irq %d disabled\n", idx); |
142 | goto __add; | 142 | goto __add; |
143 | } | 143 | } |
144 | 144 | ||
@@ -160,11 +160,11 @@ static int pnp_assign_irq(struct pnp_dev *dev, struct pnp_irq *rule, int idx) | |||
160 | res->start = -1; | 160 | res->start = -1; |
161 | res->end = -1; | 161 | res->end = -1; |
162 | res->flags |= IORESOURCE_DISABLED; | 162 | res->flags |= IORESOURCE_DISABLED; |
163 | dev_dbg(&dev->dev, " irq %d disabled (optional)\n", idx); | 163 | pnp_dbg(&dev->dev, " irq %d disabled (optional)\n", idx); |
164 | goto __add; | 164 | goto __add; |
165 | } | 165 | } |
166 | 166 | ||
167 | dev_dbg(&dev->dev, " couldn't assign irq %d\n", idx); | 167 | pnp_dbg(&dev->dev, " couldn't assign irq %d\n", idx); |
168 | return -EBUSY; | 168 | return -EBUSY; |
169 | 169 | ||
170 | __add: | 170 | __add: |
@@ -184,7 +184,7 @@ static int pnp_assign_dma(struct pnp_dev *dev, struct pnp_dma *rule, int idx) | |||
184 | 184 | ||
185 | res = pnp_get_resource(dev, IORESOURCE_DMA, idx); | 185 | res = pnp_get_resource(dev, IORESOURCE_DMA, idx); |
186 | if (res) { | 186 | if (res) { |
187 | dev_dbg(&dev->dev, " dma %d already set to %d flags %#lx\n", | 187 | pnp_dbg(&dev->dev, " dma %d already set to %d flags %#lx\n", |
188 | idx, (int) res->start, res->flags); | 188 | idx, (int) res->start, res->flags); |
189 | return 0; | 189 | return 0; |
190 | } | 190 | } |
@@ -205,7 +205,7 @@ static int pnp_assign_dma(struct pnp_dev *dev, struct pnp_dma *rule, int idx) | |||
205 | res->start = res->end = MAX_DMA_CHANNELS; | 205 | res->start = res->end = MAX_DMA_CHANNELS; |
206 | #endif | 206 | #endif |
207 | res->flags |= IORESOURCE_DISABLED; | 207 | res->flags |= IORESOURCE_DISABLED; |
208 | dev_dbg(&dev->dev, " disable dma %d\n", idx); | 208 | pnp_dbg(&dev->dev, " disable dma %d\n", idx); |
209 | 209 | ||
210 | __add: | 210 | __add: |
211 | pnp_add_dma_resource(dev, res->start, res->flags); | 211 | pnp_add_dma_resource(dev, res->start, res->flags); |
@@ -238,7 +238,7 @@ static int pnp_assign_resources(struct pnp_dev *dev, int set) | |||
238 | int nport = 0, nmem = 0, nirq = 0, ndma = 0; | 238 | int nport = 0, nmem = 0, nirq = 0, ndma = 0; |
239 | int ret = 0; | 239 | int ret = 0; |
240 | 240 | ||
241 | dev_dbg(&dev->dev, "pnp_assign_resources, try dependent set %d\n", set); | 241 | pnp_dbg(&dev->dev, "pnp_assign_resources, try dependent set %d\n", set); |
242 | mutex_lock(&pnp_res_mutex); | 242 | mutex_lock(&pnp_res_mutex); |
243 | pnp_clean_resource_table(dev); | 243 | pnp_clean_resource_table(dev); |
244 | 244 | ||
@@ -270,7 +270,7 @@ static int pnp_assign_resources(struct pnp_dev *dev, int set) | |||
270 | 270 | ||
271 | mutex_unlock(&pnp_res_mutex); | 271 | mutex_unlock(&pnp_res_mutex); |
272 | if (ret < 0) { | 272 | if (ret < 0) { |
273 | dev_dbg(&dev->dev, "pnp_assign_resources failed (%d)\n", ret); | 273 | pnp_dbg(&dev->dev, "pnp_assign_resources failed (%d)\n", ret); |
274 | pnp_clean_resource_table(dev); | 274 | pnp_clean_resource_table(dev); |
275 | } else | 275 | } else |
276 | dbg_pnp_show_resources(dev, "pnp_assign_resources succeeded"); | 276 | dbg_pnp_show_resources(dev, "pnp_assign_resources succeeded"); |
@@ -286,7 +286,7 @@ int pnp_auto_config_dev(struct pnp_dev *dev) | |||
286 | int i, ret; | 286 | int i, ret; |
287 | 287 | ||
288 | if (!pnp_can_configure(dev)) { | 288 | if (!pnp_can_configure(dev)) { |
289 | dev_dbg(&dev->dev, "configuration not supported\n"); | 289 | pnp_dbg(&dev->dev, "configuration not supported\n"); |
290 | return -ENODEV; | 290 | return -ENODEV; |
291 | } | 291 | } |
292 | 292 | ||
@@ -313,7 +313,7 @@ int pnp_auto_config_dev(struct pnp_dev *dev) | |||
313 | int pnp_start_dev(struct pnp_dev *dev) | 313 | int pnp_start_dev(struct pnp_dev *dev) |
314 | { | 314 | { |
315 | if (!pnp_can_write(dev)) { | 315 | if (!pnp_can_write(dev)) { |
316 | dev_dbg(&dev->dev, "activation not supported\n"); | 316 | pnp_dbg(&dev->dev, "activation not supported\n"); |
317 | return -EINVAL; | 317 | return -EINVAL; |
318 | } | 318 | } |
319 | 319 | ||
@@ -336,7 +336,7 @@ int pnp_start_dev(struct pnp_dev *dev) | |||
336 | int pnp_stop_dev(struct pnp_dev *dev) | 336 | int pnp_stop_dev(struct pnp_dev *dev) |
337 | { | 337 | { |
338 | if (!pnp_can_disable(dev)) { | 338 | if (!pnp_can_disable(dev)) { |
339 | dev_dbg(&dev->dev, "disabling not supported\n"); | 339 | pnp_dbg(&dev->dev, "disabling not supported\n"); |
340 | return -EINVAL; | 340 | return -EINVAL; |
341 | } | 341 | } |
342 | if (dev->protocol->disable(dev) < 0) { | 342 | if (dev->protocol->disable(dev) < 0) { |
diff --git a/drivers/pnp/pnpacpi/Makefile b/drivers/pnp/pnpacpi/Makefile index 2d7a1e6908be..905326fcca85 100644 --- a/drivers/pnp/pnpacpi/Makefile +++ b/drivers/pnp/pnpacpi/Makefile | |||
@@ -3,7 +3,3 @@ | |||
3 | # | 3 | # |
4 | 4 | ||
5 | obj-y := core.o rsparser.o | 5 | obj-y := core.o rsparser.o |
6 | |||
7 | ifeq ($(CONFIG_PNP_DEBUG),y) | ||
8 | EXTRA_CFLAGS += -DDEBUG | ||
9 | endif | ||
diff --git a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c index 98b9df7776e9..a12800f8e4c9 100644 --- a/drivers/pnp/pnpacpi/core.c +++ b/drivers/pnp/pnpacpi/core.c | |||
@@ -75,7 +75,7 @@ static int __init ispnpidacpi(char *id) | |||
75 | 75 | ||
76 | static int pnpacpi_get_resources(struct pnp_dev *dev) | 76 | static int pnpacpi_get_resources(struct pnp_dev *dev) |
77 | { | 77 | { |
78 | dev_dbg(&dev->dev, "get resources\n"); | 78 | pnp_dbg(&dev->dev, "get resources\n"); |
79 | return pnpacpi_parse_allocated_resource(dev); | 79 | return pnpacpi_parse_allocated_resource(dev); |
80 | } | 80 | } |
81 | 81 | ||
@@ -86,7 +86,7 @@ static int pnpacpi_set_resources(struct pnp_dev *dev) | |||
86 | int ret; | 86 | int ret; |
87 | acpi_status status; | 87 | acpi_status status; |
88 | 88 | ||
89 | dev_dbg(&dev->dev, "set resources\n"); | 89 | pnp_dbg(&dev->dev, "set resources\n"); |
90 | ret = pnpacpi_build_resource_template(dev, &buffer); | 90 | ret = pnpacpi_build_resource_template(dev, &buffer); |
91 | if (ret) | 91 | if (ret) |
92 | return ret; | 92 | return ret; |
@@ -259,14 +259,14 @@ int pnpacpi_disabled __initdata; | |||
259 | static int __init pnpacpi_init(void) | 259 | static int __init pnpacpi_init(void) |
260 | { | 260 | { |
261 | if (acpi_disabled || pnpacpi_disabled) { | 261 | if (acpi_disabled || pnpacpi_disabled) { |
262 | pnp_info("PnP ACPI: disabled"); | 262 | printk(KERN_INFO "pnp: PnP ACPI: disabled\n"); |
263 | return 0; | 263 | return 0; |
264 | } | 264 | } |
265 | pnp_info("PnP ACPI init"); | 265 | printk(KERN_INFO "pnp: PnP ACPI init\n"); |
266 | pnp_register_protocol(&pnpacpi_protocol); | 266 | pnp_register_protocol(&pnpacpi_protocol); |
267 | register_acpi_bus_type(&acpi_pnp_bus); | 267 | register_acpi_bus_type(&acpi_pnp_bus); |
268 | acpi_get_devices(NULL, pnpacpi_add_device_handler, NULL, NULL); | 268 | acpi_get_devices(NULL, pnpacpi_add_device_handler, NULL, NULL); |
269 | pnp_info("PnP ACPI: found %d devices", num); | 269 | printk(KERN_INFO "pnp: PnP ACPI: found %d devices\n", num); |
270 | unregister_acpi_bus_type(&acpi_pnp_bus); | 270 | unregister_acpi_bus_type(&acpi_pnp_bus); |
271 | pnp_platform_devices = 1; | 271 | pnp_platform_devices = 1; |
272 | return 0; | 272 | return 0; |
diff --git a/drivers/pnp/pnpacpi/rsparser.c b/drivers/pnp/pnpacpi/rsparser.c index 95015cbfd33f..adf17856bacc 100644 --- a/drivers/pnp/pnpacpi/rsparser.c +++ b/drivers/pnp/pnpacpi/rsparser.c | |||
@@ -132,7 +132,8 @@ static void pnpacpi_parse_allocated_irqresource(struct pnp_dev *dev, | |||
132 | pnp_add_irq_resource(dev, irq, flags); | 132 | pnp_add_irq_resource(dev, irq, flags); |
133 | } | 133 | } |
134 | 134 | ||
135 | static int dma_flags(int type, int bus_master, int transfer) | 135 | static int dma_flags(struct pnp_dev *dev, int type, int bus_master, |
136 | int transfer) | ||
136 | { | 137 | { |
137 | int flags = 0; | 138 | int flags = 0; |
138 | 139 | ||
@@ -154,7 +155,7 @@ static int dma_flags(int type, int bus_master, int transfer) | |||
154 | default: | 155 | default: |
155 | /* Set a default value ? */ | 156 | /* Set a default value ? */ |
156 | flags |= IORESOURCE_DMA_COMPATIBLE; | 157 | flags |= IORESOURCE_DMA_COMPATIBLE; |
157 | pnp_err("Invalid DMA type"); | 158 | dev_err(&dev->dev, "invalid DMA type %d\n", type); |
158 | } | 159 | } |
159 | switch (transfer) { | 160 | switch (transfer) { |
160 | case ACPI_TRANSFER_8: | 161 | case ACPI_TRANSFER_8: |
@@ -169,7 +170,7 @@ static int dma_flags(int type, int bus_master, int transfer) | |||
169 | default: | 170 | default: |
170 | /* Set a default value ? */ | 171 | /* Set a default value ? */ |
171 | flags |= IORESOURCE_DMA_8AND16BIT; | 172 | flags |= IORESOURCE_DMA_8AND16BIT; |
172 | pnp_err("Invalid DMA transfer type"); | 173 | dev_err(&dev->dev, "invalid DMA transfer type %d\n", transfer); |
173 | } | 174 | } |
174 | 175 | ||
175 | return flags; | 176 | return flags; |
@@ -336,7 +337,7 @@ static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res, | |||
336 | case ACPI_RESOURCE_TYPE_DMA: | 337 | case ACPI_RESOURCE_TYPE_DMA: |
337 | dma = &res->data.dma; | 338 | dma = &res->data.dma; |
338 | if (dma->channel_count > 0 && dma->channels[0] != (u8) -1) | 339 | if (dma->channel_count > 0 && dma->channels[0] != (u8) -1) |
339 | flags = dma_flags(dma->type, dma->bus_master, | 340 | flags = dma_flags(dev, dma->type, dma->bus_master, |
340 | dma->transfer); | 341 | dma->transfer); |
341 | else | 342 | else |
342 | flags = IORESOURCE_DISABLED; | 343 | flags = IORESOURCE_DISABLED; |
@@ -449,7 +450,7 @@ int pnpacpi_parse_allocated_resource(struct pnp_dev *dev) | |||
449 | acpi_handle handle = dev->data; | 450 | acpi_handle handle = dev->data; |
450 | acpi_status status; | 451 | acpi_status status; |
451 | 452 | ||
452 | dev_dbg(&dev->dev, "parse allocated resources\n"); | 453 | pnp_dbg(&dev->dev, "parse allocated resources\n"); |
453 | 454 | ||
454 | pnp_init_resources(dev); | 455 | pnp_init_resources(dev); |
455 | 456 | ||
@@ -477,7 +478,7 @@ static __init void pnpacpi_parse_dma_option(struct pnp_dev *dev, | |||
477 | for (i = 0; i < p->channel_count; i++) | 478 | for (i = 0; i < p->channel_count; i++) |
478 | map |= 1 << p->channels[i]; | 479 | map |= 1 << p->channels[i]; |
479 | 480 | ||
480 | flags = dma_flags(p->type, p->bus_master, p->transfer); | 481 | flags = dma_flags(dev, p->type, p->bus_master, p->transfer); |
481 | pnp_register_dma_resource(dev, option_flags, map, flags); | 482 | pnp_register_dma_resource(dev, option_flags, map, flags); |
482 | } | 483 | } |
483 | 484 | ||
@@ -608,8 +609,8 @@ static __init void pnpacpi_parse_address_option(struct pnp_dev *dev, | |||
608 | unsigned char flags = 0; | 609 | unsigned char flags = 0; |
609 | 610 | ||
610 | status = acpi_resource_to_address64(r, p); | 611 | status = acpi_resource_to_address64(r, p); |
611 | if (!ACPI_SUCCESS(status)) { | 612 | if (ACPI_FAILURE(status)) { |
612 | pnp_warn("PnPACPI: failed to convert resource type %d", | 613 | dev_warn(&dev->dev, "can't convert resource type %d\n", |
613 | r->type); | 614 | r->type); |
614 | return; | 615 | return; |
615 | } | 616 | } |
@@ -735,7 +736,7 @@ int __init pnpacpi_parse_resource_option_data(struct pnp_dev *dev) | |||
735 | acpi_status status; | 736 | acpi_status status; |
736 | struct acpipnp_parse_option_s parse_data; | 737 | struct acpipnp_parse_option_s parse_data; |
737 | 738 | ||
738 | dev_dbg(&dev->dev, "parse resource options\n"); | 739 | pnp_dbg(&dev->dev, "parse resource options\n"); |
739 | 740 | ||
740 | parse_data.dev = dev; | 741 | parse_data.dev = dev; |
741 | parse_data.option_flags = 0; | 742 | parse_data.option_flags = 0; |
@@ -843,7 +844,7 @@ static void pnpacpi_encode_irq(struct pnp_dev *dev, | |||
843 | 844 | ||
844 | if (!pnp_resource_enabled(p)) { | 845 | if (!pnp_resource_enabled(p)) { |
845 | irq->interrupt_count = 0; | 846 | irq->interrupt_count = 0; |
846 | dev_dbg(&dev->dev, " encode irq (%s)\n", | 847 | pnp_dbg(&dev->dev, " encode irq (%s)\n", |
847 | p ? "disabled" : "missing"); | 848 | p ? "disabled" : "missing"); |
848 | return; | 849 | return; |
849 | } | 850 | } |
@@ -855,7 +856,7 @@ static void pnpacpi_encode_irq(struct pnp_dev *dev, | |||
855 | irq->interrupt_count = 1; | 856 | irq->interrupt_count = 1; |
856 | irq->interrupts[0] = p->start; | 857 | irq->interrupts[0] = p->start; |
857 | 858 | ||
858 | dev_dbg(&dev->dev, " encode irq %d %s %s %s (%d-byte descriptor)\n", | 859 | pnp_dbg(&dev->dev, " encode irq %d %s %s %s (%d-byte descriptor)\n", |
859 | (int) p->start, | 860 | (int) p->start, |
860 | triggering == ACPI_LEVEL_SENSITIVE ? "level" : "edge", | 861 | triggering == ACPI_LEVEL_SENSITIVE ? "level" : "edge", |
861 | polarity == ACPI_ACTIVE_LOW ? "low" : "high", | 862 | polarity == ACPI_ACTIVE_LOW ? "low" : "high", |
@@ -872,7 +873,7 @@ static void pnpacpi_encode_ext_irq(struct pnp_dev *dev, | |||
872 | 873 | ||
873 | if (!pnp_resource_enabled(p)) { | 874 | if (!pnp_resource_enabled(p)) { |
874 | extended_irq->interrupt_count = 0; | 875 | extended_irq->interrupt_count = 0; |
875 | dev_dbg(&dev->dev, " encode extended irq (%s)\n", | 876 | pnp_dbg(&dev->dev, " encode extended irq (%s)\n", |
876 | p ? "disabled" : "missing"); | 877 | p ? "disabled" : "missing"); |
877 | return; | 878 | return; |
878 | } | 879 | } |
@@ -885,7 +886,7 @@ static void pnpacpi_encode_ext_irq(struct pnp_dev *dev, | |||
885 | extended_irq->interrupt_count = 1; | 886 | extended_irq->interrupt_count = 1; |
886 | extended_irq->interrupts[0] = p->start; | 887 | extended_irq->interrupts[0] = p->start; |
887 | 888 | ||
888 | dev_dbg(&dev->dev, " encode irq %d %s %s %s\n", (int) p->start, | 889 | pnp_dbg(&dev->dev, " encode irq %d %s %s %s\n", (int) p->start, |
889 | triggering == ACPI_LEVEL_SENSITIVE ? "level" : "edge", | 890 | triggering == ACPI_LEVEL_SENSITIVE ? "level" : "edge", |
890 | polarity == ACPI_ACTIVE_LOW ? "low" : "high", | 891 | polarity == ACPI_ACTIVE_LOW ? "low" : "high", |
891 | extended_irq->sharable == ACPI_SHARED ? "shared" : "exclusive"); | 892 | extended_irq->sharable == ACPI_SHARED ? "shared" : "exclusive"); |
@@ -899,7 +900,7 @@ static void pnpacpi_encode_dma(struct pnp_dev *dev, | |||
899 | 900 | ||
900 | if (!pnp_resource_enabled(p)) { | 901 | if (!pnp_resource_enabled(p)) { |
901 | dma->channel_count = 0; | 902 | dma->channel_count = 0; |
902 | dev_dbg(&dev->dev, " encode dma (%s)\n", | 903 | pnp_dbg(&dev->dev, " encode dma (%s)\n", |
903 | p ? "disabled" : "missing"); | 904 | p ? "disabled" : "missing"); |
904 | return; | 905 | return; |
905 | } | 906 | } |
@@ -934,7 +935,7 @@ static void pnpacpi_encode_dma(struct pnp_dev *dev, | |||
934 | dma->channel_count = 1; | 935 | dma->channel_count = 1; |
935 | dma->channels[0] = p->start; | 936 | dma->channels[0] = p->start; |
936 | 937 | ||
937 | dev_dbg(&dev->dev, " encode dma %d " | 938 | pnp_dbg(&dev->dev, " encode dma %d " |
938 | "type %#x transfer %#x master %d\n", | 939 | "type %#x transfer %#x master %d\n", |
939 | (int) p->start, dma->type, dma->transfer, dma->bus_master); | 940 | (int) p->start, dma->type, dma->transfer, dma->bus_master); |
940 | } | 941 | } |
@@ -958,7 +959,7 @@ static void pnpacpi_encode_io(struct pnp_dev *dev, | |||
958 | io->address_length = 0; | 959 | io->address_length = 0; |
959 | } | 960 | } |
960 | 961 | ||
961 | dev_dbg(&dev->dev, " encode io %#x-%#x decode %#x\n", io->minimum, | 962 | pnp_dbg(&dev->dev, " encode io %#x-%#x decode %#x\n", io->minimum, |
962 | io->minimum + io->address_length - 1, io->io_decode); | 963 | io->minimum + io->address_length - 1, io->io_decode); |
963 | } | 964 | } |
964 | 965 | ||
@@ -976,7 +977,7 @@ static void pnpacpi_encode_fixed_io(struct pnp_dev *dev, | |||
976 | fixed_io->address_length = 0; | 977 | fixed_io->address_length = 0; |
977 | } | 978 | } |
978 | 979 | ||
979 | dev_dbg(&dev->dev, " encode fixed_io %#x-%#x\n", fixed_io->address, | 980 | pnp_dbg(&dev->dev, " encode fixed_io %#x-%#x\n", fixed_io->address, |
980 | fixed_io->address + fixed_io->address_length - 1); | 981 | fixed_io->address + fixed_io->address_length - 1); |
981 | } | 982 | } |
982 | 983 | ||
@@ -999,7 +1000,7 @@ static void pnpacpi_encode_mem24(struct pnp_dev *dev, | |||
999 | memory24->address_length = 0; | 1000 | memory24->address_length = 0; |
1000 | } | 1001 | } |
1001 | 1002 | ||
1002 | dev_dbg(&dev->dev, " encode mem24 %#x-%#x write_protect %#x\n", | 1003 | pnp_dbg(&dev->dev, " encode mem24 %#x-%#x write_protect %#x\n", |
1003 | memory24->minimum, | 1004 | memory24->minimum, |
1004 | memory24->minimum + memory24->address_length - 1, | 1005 | memory24->minimum + memory24->address_length - 1, |
1005 | memory24->write_protect); | 1006 | memory24->write_protect); |
@@ -1023,7 +1024,7 @@ static void pnpacpi_encode_mem32(struct pnp_dev *dev, | |||
1023 | memory32->alignment = 0; | 1024 | memory32->alignment = 0; |
1024 | } | 1025 | } |
1025 | 1026 | ||
1026 | dev_dbg(&dev->dev, " encode mem32 %#x-%#x write_protect %#x\n", | 1027 | pnp_dbg(&dev->dev, " encode mem32 %#x-%#x write_protect %#x\n", |
1027 | memory32->minimum, | 1028 | memory32->minimum, |
1028 | memory32->minimum + memory32->address_length - 1, | 1029 | memory32->minimum + memory32->address_length - 1, |
1029 | memory32->write_protect); | 1030 | memory32->write_protect); |
@@ -1046,7 +1047,7 @@ static void pnpacpi_encode_fixed_mem32(struct pnp_dev *dev, | |||
1046 | fixed_memory32->address_length = 0; | 1047 | fixed_memory32->address_length = 0; |
1047 | } | 1048 | } |
1048 | 1049 | ||
1049 | dev_dbg(&dev->dev, " encode fixed_mem32 %#x-%#x write_protect %#x\n", | 1050 | pnp_dbg(&dev->dev, " encode fixed_mem32 %#x-%#x write_protect %#x\n", |
1050 | fixed_memory32->address, | 1051 | fixed_memory32->address, |
1051 | fixed_memory32->address + fixed_memory32->address_length - 1, | 1052 | fixed_memory32->address + fixed_memory32->address_length - 1, |
1052 | fixed_memory32->write_protect); | 1053 | fixed_memory32->write_protect); |
@@ -1060,7 +1061,7 @@ int pnpacpi_encode_resources(struct pnp_dev *dev, struct acpi_buffer *buffer) | |||
1060 | struct acpi_resource *resource = buffer->pointer; | 1061 | struct acpi_resource *resource = buffer->pointer; |
1061 | int port = 0, irq = 0, dma = 0, mem = 0; | 1062 | int port = 0, irq = 0, dma = 0, mem = 0; |
1062 | 1063 | ||
1063 | dev_dbg(&dev->dev, "encode %d resources\n", res_cnt); | 1064 | pnp_dbg(&dev->dev, "encode %d resources\n", res_cnt); |
1064 | while (i < res_cnt) { | 1065 | while (i < res_cnt) { |
1065 | switch (resource->type) { | 1066 | switch (resource->type) { |
1066 | case ACPI_RESOURCE_TYPE_IRQ: | 1067 | case ACPI_RESOURCE_TYPE_IRQ: |
diff --git a/drivers/pnp/pnpbios/Makefile b/drivers/pnp/pnpbios/Makefile index 310e2b3a7710..3cd3ed760605 100644 --- a/drivers/pnp/pnpbios/Makefile +++ b/drivers/pnp/pnpbios/Makefile | |||
@@ -5,7 +5,3 @@ | |||
5 | pnpbios-proc-$(CONFIG_PNPBIOS_PROC_FS) = proc.o | 5 | pnpbios-proc-$(CONFIG_PNPBIOS_PROC_FS) = proc.o |
6 | 6 | ||
7 | obj-y := core.o bioscalls.o rsparser.o $(pnpbios-proc-y) | 7 | obj-y := core.o bioscalls.o rsparser.o $(pnpbios-proc-y) |
8 | |||
9 | ifeq ($(CONFIG_PNP_DEBUG),y) | ||
10 | EXTRA_CFLAGS += -DDEBUG | ||
11 | endif | ||
diff --git a/drivers/pnp/pnpbios/core.c b/drivers/pnp/pnpbios/core.c index 19a4be1a9a31..2f79eb2190e1 100644 --- a/drivers/pnp/pnpbios/core.c +++ b/drivers/pnp/pnpbios/core.c | |||
@@ -211,7 +211,7 @@ static int pnpbios_get_resources(struct pnp_dev *dev) | |||
211 | if (!pnpbios_is_dynamic(dev)) | 211 | if (!pnpbios_is_dynamic(dev)) |
212 | return -EPERM; | 212 | return -EPERM; |
213 | 213 | ||
214 | dev_dbg(&dev->dev, "get resources\n"); | 214 | pnp_dbg(&dev->dev, "get resources\n"); |
215 | node = kzalloc(node_info.max_node_size, GFP_KERNEL); | 215 | node = kzalloc(node_info.max_node_size, GFP_KERNEL); |
216 | if (!node) | 216 | if (!node) |
217 | return -1; | 217 | return -1; |
@@ -234,7 +234,7 @@ static int pnpbios_set_resources(struct pnp_dev *dev) | |||
234 | if (!pnpbios_is_dynamic(dev)) | 234 | if (!pnpbios_is_dynamic(dev)) |
235 | return -EPERM; | 235 | return -EPERM; |
236 | 236 | ||
237 | dev_dbg(&dev->dev, "set resources\n"); | 237 | pnp_dbg(&dev->dev, "set resources\n"); |
238 | node = kzalloc(node_info.max_node_size, GFP_KERNEL); | 238 | node = kzalloc(node_info.max_node_size, GFP_KERNEL); |
239 | if (!node) | 239 | if (!node) |
240 | return -1; | 240 | return -1; |
diff --git a/drivers/pnp/pnpbios/rsparser.c b/drivers/pnp/pnpbios/rsparser.c index ca567671379e..87b4f49a5251 100644 --- a/drivers/pnp/pnpbios/rsparser.c +++ b/drivers/pnp/pnpbios/rsparser.c | |||
@@ -87,7 +87,7 @@ static unsigned char *pnpbios_parse_allocated_resource_data(struct pnp_dev *dev, | |||
87 | if (!p) | 87 | if (!p) |
88 | return NULL; | 88 | return NULL; |
89 | 89 | ||
90 | dev_dbg(&dev->dev, "parse allocated resources\n"); | 90 | pnp_dbg(&dev->dev, "parse allocated resources\n"); |
91 | 91 | ||
92 | pnp_init_resources(dev); | 92 | pnp_init_resources(dev); |
93 | 93 | ||
@@ -324,7 +324,7 @@ pnpbios_parse_resource_option_data(unsigned char *p, unsigned char *end, | |||
324 | if (!p) | 324 | if (!p) |
325 | return NULL; | 325 | return NULL; |
326 | 326 | ||
327 | dev_dbg(&dev->dev, "parse resource options\n"); | 327 | pnp_dbg(&dev->dev, "parse resource options\n"); |
328 | option_flags = 0; | 328 | option_flags = 0; |
329 | while ((char *)p < (char *)end) { | 329 | while ((char *)p < (char *)end) { |
330 | 330 | ||
@@ -519,7 +519,7 @@ static void pnpbios_encode_mem(struct pnp_dev *dev, unsigned char *p, | |||
519 | p[10] = (len >> 8) & 0xff; | 519 | p[10] = (len >> 8) & 0xff; |
520 | p[11] = ((len >> 8) >> 8) & 0xff; | 520 | p[11] = ((len >> 8) >> 8) & 0xff; |
521 | 521 | ||
522 | dev_dbg(&dev->dev, " encode mem %#lx-%#lx\n", base, base + len - 1); | 522 | pnp_dbg(&dev->dev, " encode mem %#lx-%#lx\n", base, base + len - 1); |
523 | } | 523 | } |
524 | 524 | ||
525 | static void pnpbios_encode_mem32(struct pnp_dev *dev, unsigned char *p, | 525 | static void pnpbios_encode_mem32(struct pnp_dev *dev, unsigned char *p, |
@@ -549,7 +549,7 @@ static void pnpbios_encode_mem32(struct pnp_dev *dev, unsigned char *p, | |||
549 | p[18] = (len >> 16) & 0xff; | 549 | p[18] = (len >> 16) & 0xff; |
550 | p[19] = (len >> 24) & 0xff; | 550 | p[19] = (len >> 24) & 0xff; |
551 | 551 | ||
552 | dev_dbg(&dev->dev, " encode mem32 %#lx-%#lx\n", base, base + len - 1); | 552 | pnp_dbg(&dev->dev, " encode mem32 %#lx-%#lx\n", base, base + len - 1); |
553 | } | 553 | } |
554 | 554 | ||
555 | static void pnpbios_encode_fixed_mem32(struct pnp_dev *dev, unsigned char *p, | 555 | static void pnpbios_encode_fixed_mem32(struct pnp_dev *dev, unsigned char *p, |
@@ -575,7 +575,7 @@ static void pnpbios_encode_fixed_mem32(struct pnp_dev *dev, unsigned char *p, | |||
575 | p[10] = (len >> 16) & 0xff; | 575 | p[10] = (len >> 16) & 0xff; |
576 | p[11] = (len >> 24) & 0xff; | 576 | p[11] = (len >> 24) & 0xff; |
577 | 577 | ||
578 | dev_dbg(&dev->dev, " encode fixed_mem32 %#lx-%#lx\n", base, | 578 | pnp_dbg(&dev->dev, " encode fixed_mem32 %#lx-%#lx\n", base, |
579 | base + len - 1); | 579 | base + len - 1); |
580 | } | 580 | } |
581 | 581 | ||
@@ -592,7 +592,7 @@ static void pnpbios_encode_irq(struct pnp_dev *dev, unsigned char *p, | |||
592 | p[1] = map & 0xff; | 592 | p[1] = map & 0xff; |
593 | p[2] = (map >> 8) & 0xff; | 593 | p[2] = (map >> 8) & 0xff; |
594 | 594 | ||
595 | dev_dbg(&dev->dev, " encode irq mask %#lx\n", map); | 595 | pnp_dbg(&dev->dev, " encode irq mask %#lx\n", map); |
596 | } | 596 | } |
597 | 597 | ||
598 | static void pnpbios_encode_dma(struct pnp_dev *dev, unsigned char *p, | 598 | static void pnpbios_encode_dma(struct pnp_dev *dev, unsigned char *p, |
@@ -607,7 +607,7 @@ static void pnpbios_encode_dma(struct pnp_dev *dev, unsigned char *p, | |||
607 | 607 | ||
608 | p[1] = map & 0xff; | 608 | p[1] = map & 0xff; |
609 | 609 | ||
610 | dev_dbg(&dev->dev, " encode dma mask %#lx\n", map); | 610 | pnp_dbg(&dev->dev, " encode dma mask %#lx\n", map); |
611 | } | 611 | } |
612 | 612 | ||
613 | static void pnpbios_encode_port(struct pnp_dev *dev, unsigned char *p, | 613 | static void pnpbios_encode_port(struct pnp_dev *dev, unsigned char *p, |
@@ -630,7 +630,7 @@ static void pnpbios_encode_port(struct pnp_dev *dev, unsigned char *p, | |||
630 | p[5] = (base >> 8) & 0xff; | 630 | p[5] = (base >> 8) & 0xff; |
631 | p[7] = len & 0xff; | 631 | p[7] = len & 0xff; |
632 | 632 | ||
633 | dev_dbg(&dev->dev, " encode io %#lx-%#lx\n", base, base + len - 1); | 633 | pnp_dbg(&dev->dev, " encode io %#lx-%#lx\n", base, base + len - 1); |
634 | } | 634 | } |
635 | 635 | ||
636 | static void pnpbios_encode_fixed_port(struct pnp_dev *dev, unsigned char *p, | 636 | static void pnpbios_encode_fixed_port(struct pnp_dev *dev, unsigned char *p, |
@@ -651,7 +651,7 @@ static void pnpbios_encode_fixed_port(struct pnp_dev *dev, unsigned char *p, | |||
651 | p[2] = (base >> 8) & 0xff; | 651 | p[2] = (base >> 8) & 0xff; |
652 | p[3] = len & 0xff; | 652 | p[3] = len & 0xff; |
653 | 653 | ||
654 | dev_dbg(&dev->dev, " encode fixed_io %#lx-%#lx\n", base, | 654 | pnp_dbg(&dev->dev, " encode fixed_io %#lx-%#lx\n", base, |
655 | base + len - 1); | 655 | base + len - 1); |
656 | } | 656 | } |
657 | 657 | ||
diff --git a/drivers/pnp/quirks.c b/drivers/pnp/quirks.c index 0bdf9b8a5e58..3d2e56094783 100644 --- a/drivers/pnp/quirks.c +++ b/drivers/pnp/quirks.c | |||
@@ -337,10 +337,8 @@ void pnp_fixup_device(struct pnp_dev *dev) | |||
337 | for (f = pnp_fixups; *f->id; f++) { | 337 | for (f = pnp_fixups; *f->id; f++) { |
338 | if (!compare_pnp_id(dev->id, f->id)) | 338 | if (!compare_pnp_id(dev->id, f->id)) |
339 | continue; | 339 | continue; |
340 | #ifdef DEBUG | 340 | pnp_dbg(&dev->dev, "%s: calling %pF\n", f->id, |
341 | dev_dbg(&dev->dev, "%s: calling ", f->id); | 341 | f->quirk_function); |
342 | print_fn_descriptor_symbol("%s\n", f->quirk_function); | ||
343 | #endif | ||
344 | f->quirk_function(dev); | 342 | f->quirk_function(dev); |
345 | } | 343 | } |
346 | } | 344 | } |
diff --git a/drivers/pnp/resource.c b/drivers/pnp/resource.c index 4cfe3a1efdfb..5ef463d89f16 100644 --- a/drivers/pnp/resource.c +++ b/drivers/pnp/resource.c | |||
@@ -294,7 +294,7 @@ static int pci_dev_uses_irq(struct pnp_dev *pnp, struct pci_dev *pci, | |||
294 | u8 progif; | 294 | u8 progif; |
295 | 295 | ||
296 | if (pci->irq == irq) { | 296 | if (pci->irq == irq) { |
297 | dev_dbg(&pnp->dev, "device %s using irq %d\n", | 297 | pnp_dbg(&pnp->dev, " device %s using irq %d\n", |
298 | pci_name(pci), irq); | 298 | pci_name(pci), irq); |
299 | return 1; | 299 | return 1; |
300 | } | 300 | } |
@@ -316,7 +316,7 @@ static int pci_dev_uses_irq(struct pnp_dev *pnp, struct pci_dev *pci, | |||
316 | if ((progif & 0x5) != 0x5) | 316 | if ((progif & 0x5) != 0x5) |
317 | if (pci_get_legacy_ide_irq(pci, 0) == irq || | 317 | if (pci_get_legacy_ide_irq(pci, 0) == irq || |
318 | pci_get_legacy_ide_irq(pci, 1) == irq) { | 318 | pci_get_legacy_ide_irq(pci, 1) == irq) { |
319 | dev_dbg(&pnp->dev, "legacy IDE device %s " | 319 | pnp_dbg(&pnp->dev, " legacy IDE device %s " |
320 | "using irq %d\n", pci_name(pci), irq); | 320 | "using irq %d\n", pci_name(pci), irq); |
321 | return 1; | 321 | return 1; |
322 | } | 322 | } |
@@ -517,7 +517,7 @@ struct pnp_resource *pnp_add_irq_resource(struct pnp_dev *dev, int irq, | |||
517 | res->start = irq; | 517 | res->start = irq; |
518 | res->end = irq; | 518 | res->end = irq; |
519 | 519 | ||
520 | dev_dbg(&dev->dev, " add irq %d flags %#x\n", irq, flags); | 520 | pnp_dbg(&dev->dev, " add irq %d flags %#x\n", irq, flags); |
521 | return pnp_res; | 521 | return pnp_res; |
522 | } | 522 | } |
523 | 523 | ||
@@ -538,7 +538,7 @@ struct pnp_resource *pnp_add_dma_resource(struct pnp_dev *dev, int dma, | |||
538 | res->start = dma; | 538 | res->start = dma; |
539 | res->end = dma; | 539 | res->end = dma; |
540 | 540 | ||
541 | dev_dbg(&dev->dev, " add dma %d flags %#x\n", dma, flags); | 541 | pnp_dbg(&dev->dev, " add dma %d flags %#x\n", dma, flags); |
542 | return pnp_res; | 542 | return pnp_res; |
543 | } | 543 | } |
544 | 544 | ||
@@ -562,7 +562,7 @@ struct pnp_resource *pnp_add_io_resource(struct pnp_dev *dev, | |||
562 | res->start = start; | 562 | res->start = start; |
563 | res->end = end; | 563 | res->end = end; |
564 | 564 | ||
565 | dev_dbg(&dev->dev, " add io %#llx-%#llx flags %#x\n", | 565 | pnp_dbg(&dev->dev, " add io %#llx-%#llx flags %#x\n", |
566 | (unsigned long long) start, (unsigned long long) end, flags); | 566 | (unsigned long long) start, (unsigned long long) end, flags); |
567 | return pnp_res; | 567 | return pnp_res; |
568 | } | 568 | } |
@@ -587,7 +587,7 @@ struct pnp_resource *pnp_add_mem_resource(struct pnp_dev *dev, | |||
587 | res->start = start; | 587 | res->start = start; |
588 | res->end = end; | 588 | res->end = end; |
589 | 589 | ||
590 | dev_dbg(&dev->dev, " add mem %#llx-%#llx flags %#x\n", | 590 | pnp_dbg(&dev->dev, " add mem %#llx-%#llx flags %#x\n", |
591 | (unsigned long long) start, (unsigned long long) end, flags); | 591 | (unsigned long long) start, (unsigned long long) end, flags); |
592 | return pnp_res; | 592 | return pnp_res; |
593 | } | 593 | } |
diff --git a/drivers/pnp/support.c b/drivers/pnp/support.c index b42df1620718..63087d5ce609 100644 --- a/drivers/pnp/support.c +++ b/drivers/pnp/support.c | |||
@@ -75,18 +75,17 @@ char *pnp_resource_type_name(struct resource *res) | |||
75 | 75 | ||
76 | void dbg_pnp_show_resources(struct pnp_dev *dev, char *desc) | 76 | void dbg_pnp_show_resources(struct pnp_dev *dev, char *desc) |
77 | { | 77 | { |
78 | #ifdef DEBUG | ||
79 | char buf[128]; | 78 | char buf[128]; |
80 | int len; | 79 | int len; |
81 | struct pnp_resource *pnp_res; | 80 | struct pnp_resource *pnp_res; |
82 | struct resource *res; | 81 | struct resource *res; |
83 | 82 | ||
84 | if (list_empty(&dev->resources)) { | 83 | if (list_empty(&dev->resources)) { |
85 | dev_dbg(&dev->dev, "%s: no current resources\n", desc); | 84 | pnp_dbg(&dev->dev, "%s: no current resources\n", desc); |
86 | return; | 85 | return; |
87 | } | 86 | } |
88 | 87 | ||
89 | dev_dbg(&dev->dev, "%s: current resources:\n", desc); | 88 | pnp_dbg(&dev->dev, "%s: current resources:\n", desc); |
90 | list_for_each_entry(pnp_res, &dev->resources, list) { | 89 | list_for_each_entry(pnp_res, &dev->resources, list) { |
91 | res = &pnp_res->res; | 90 | res = &pnp_res->res; |
92 | len = 0; | 91 | len = 0; |
@@ -95,7 +94,7 @@ void dbg_pnp_show_resources(struct pnp_dev *dev, char *desc) | |||
95 | pnp_resource_type_name(res)); | 94 | pnp_resource_type_name(res)); |
96 | 95 | ||
97 | if (res->flags & IORESOURCE_DISABLED) { | 96 | if (res->flags & IORESOURCE_DISABLED) { |
98 | dev_dbg(&dev->dev, "%sdisabled\n", buf); | 97 | pnp_dbg(&dev->dev, "%sdisabled\n", buf); |
99 | continue; | 98 | continue; |
100 | } | 99 | } |
101 | 100 | ||
@@ -116,9 +115,8 @@ void dbg_pnp_show_resources(struct pnp_dev *dev, char *desc) | |||
116 | res->flags); | 115 | res->flags); |
117 | break; | 116 | break; |
118 | } | 117 | } |
119 | dev_dbg(&dev->dev, "%s\n", buf); | 118 | pnp_dbg(&dev->dev, "%s\n", buf); |
120 | } | 119 | } |
121 | #endif | ||
122 | } | 120 | } |
123 | 121 | ||
124 | char *pnp_option_priority_name(struct pnp_option *option) | 122 | char *pnp_option_priority_name(struct pnp_option *option) |
@@ -136,7 +134,6 @@ char *pnp_option_priority_name(struct pnp_option *option) | |||
136 | 134 | ||
137 | void dbg_pnp_show_option(struct pnp_dev *dev, struct pnp_option *option) | 135 | void dbg_pnp_show_option(struct pnp_dev *dev, struct pnp_option *option) |
138 | { | 136 | { |
139 | #ifdef DEBUG | ||
140 | char buf[128]; | 137 | char buf[128]; |
141 | int len = 0, i; | 138 | int len = 0, i; |
142 | struct pnp_port *port; | 139 | struct pnp_port *port; |
@@ -208,6 +205,5 @@ void dbg_pnp_show_option(struct pnp_dev *dev, struct pnp_option *option) | |||
208 | "flags %#x", dma->map, dma->flags); | 205 | "flags %#x", dma->map, dma->flags); |
209 | break; | 206 | break; |
210 | } | 207 | } |
211 | dev_dbg(&dev->dev, "%s\n", buf); | 208 | pnp_dbg(&dev->dev, "%s\n", buf); |
212 | #endif | ||
213 | } | 209 | } |