Skip to content

Commit 2f53432

Browse files
Bjorn Helgaaslenb
authored andcommitted
PNP: convert to using pnp_dbg()
pnp_dbg() is equivalent to dev_dbg() except that we can turn it on at boot-time with the "pnp.debug" kernel parameter, so we don't have to build a new kernel image. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
1 parent 97ef062 commit 2f53432

10 files changed

Lines changed: 63 additions & 63 deletions

File tree

‎drivers/pnp/core.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ int pnp_add_device(struct pnp_dev *dev)
200200
for (id = dev->id; id; id = id->next)
201201
len += scnprintf(buf + len, sizeof(buf) - len, " %s", id->id);
202202

203-
dev_dbg(&dev->dev, "%s device, IDs%s (%s)\n",
203+
pnp_dbg(&dev->dev, "%s device, IDs%s (%s)\n",
204204
dev->protocol->name, buf, dev->active ? "active" : "disabled");
205205
return 0;
206206
}

‎drivers/pnp/isapnp/core.c‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,7 @@ static int isapnp_get_resources(struct pnp_dev *dev)
901901
{
902902
int i, ret;
903903

904-
dev_dbg(&dev->dev, "get resources\n");
904+
pnp_dbg(&dev->dev, "get resources\n");
905905
pnp_init_resources(dev);
906906
isapnp_cfg_begin(dev->card->number, dev->number);
907907
dev->active = isapnp_read_byte(ISAPNP_CFG_ACTIVATE);
@@ -939,13 +939,13 @@ static int isapnp_set_resources(struct pnp_dev *dev)
939939
struct resource *res;
940940
int tmp;
941941

942-
dev_dbg(&dev->dev, "set resources\n");
942+
pnp_dbg(&dev->dev, "set resources\n");
943943
isapnp_cfg_begin(dev->card->number, dev->number);
944944
dev->active = 1;
945945
for (tmp = 0; tmp < ISAPNP_MAX_PORT; tmp++) {
946946
res = pnp_get_resource(dev, IORESOURCE_IO, tmp);
947947
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",
949949
tmp, (unsigned long long) res->start);
950950
isapnp_write_word(ISAPNP_CFG_PORT + (tmp << 1),
951951
res->start);
@@ -957,22 +957,22 @@ static int isapnp_set_resources(struct pnp_dev *dev)
957957
int irq = res->start;
958958
if (irq == 2)
959959
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);
961961
isapnp_write_byte(ISAPNP_CFG_IRQ + (tmp << 1), irq);
962962
}
963963
}
964964
for (tmp = 0; tmp < ISAPNP_MAX_DMA; tmp++) {
965965
res = pnp_get_resource(dev, IORESOURCE_DMA, tmp);
966966
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",
968968
tmp, (unsigned long long) res->start);
969969
isapnp_write_byte(ISAPNP_CFG_DMA + tmp, res->start);
970970
}
971971
}
972972
for (tmp = 0; tmp < ISAPNP_MAX_MEM; tmp++) {
973973
res = pnp_get_resource(dev, IORESOURCE_MEM, tmp);
974974
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",
976976
tmp, (unsigned long long) res->start);
977977
isapnp_write_word(ISAPNP_CFG_MEM + (tmp << 3),
978978
(res->start >> 8) & 0xffff);

‎drivers/pnp/manager.c‎

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ static int pnp_assign_port(struct pnp_dev *dev, struct pnp_port *rule, int idx)
2525

2626
res = pnp_get_resource(dev, IORESOURCE_IO, idx);
2727
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 "
2929
"flags %#lx\n", idx, (unsigned long long) res->start,
3030
(unsigned long long) res->end, res->flags);
3131
return 0;
@@ -38,7 +38,7 @@ static int pnp_assign_port(struct pnp_dev *dev, struct pnp_port *rule, int idx)
3838

3939
if (!rule->size) {
4040
res->flags |= IORESOURCE_DISABLED;
41-
dev_dbg(&dev->dev, " io %d disabled\n", idx);
41+
pnp_dbg(&dev->dev, " io %d disabled\n", idx);
4242
goto __add;
4343
}
4444

@@ -49,7 +49,7 @@ static int pnp_assign_port(struct pnp_dev *dev, struct pnp_port *rule, int idx)
4949
res->start += rule->align;
5050
res->end = res->start + rule->size - 1;
5151
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 "
5353
"(min %#llx max %#llx)\n", idx,
5454
(unsigned long long) rule->min,
5555
(unsigned long long) rule->max);
@@ -68,7 +68,7 @@ static int pnp_assign_mem(struct pnp_dev *dev, struct pnp_mem *rule, int idx)
6868

6969
res = pnp_get_resource(dev, IORESOURCE_MEM, idx);
7070
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 "
7272
"flags %#lx\n", idx, (unsigned long long) res->start,
7373
(unsigned long long) res->end, res->flags);
7474
return 0;
@@ -90,7 +90,7 @@ static int pnp_assign_mem(struct pnp_dev *dev, struct pnp_mem *rule, int idx)
9090

9191
if (!rule->size) {
9292
res->flags |= IORESOURCE_DISABLED;
93-
dev_dbg(&dev->dev, " mem %d disabled\n", idx);
93+
pnp_dbg(&dev->dev, " mem %d disabled\n", idx);
9494
goto __add;
9595
}
9696

@@ -101,7 +101,7 @@ static int pnp_assign_mem(struct pnp_dev *dev, struct pnp_mem *rule, int idx)
101101
res->start += rule->align;
102102
res->end = res->start + rule->size - 1;
103103
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 "
105105
"(min %#llx max %#llx)\n", idx,
106106
(unsigned long long) rule->min,
107107
(unsigned long long) rule->max);
@@ -126,7 +126,7 @@ static int pnp_assign_irq(struct pnp_dev *dev, struct pnp_irq *rule, int idx)
126126

127127
res = pnp_get_resource(dev, IORESOURCE_IRQ, idx);
128128
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",
130130
idx, (int) res->start, res->flags);
131131
return 0;
132132
}
@@ -138,7 +138,7 @@ static int pnp_assign_irq(struct pnp_dev *dev, struct pnp_irq *rule, int idx)
138138

139139
if (bitmap_empty(rule->map.bits, PNP_IRQ_NR)) {
140140
res->flags |= IORESOURCE_DISABLED;
141-
dev_dbg(&dev->dev, " irq %d disabled\n", idx);
141+
pnp_dbg(&dev->dev, " irq %d disabled\n", idx);
142142
goto __add;
143143
}
144144

@@ -160,11 +160,11 @@ static int pnp_assign_irq(struct pnp_dev *dev, struct pnp_irq *rule, int idx)
160160
res->start = -1;
161161
res->end = -1;
162162
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);
164164
goto __add;
165165
}
166166

167-
dev_dbg(&dev->dev, " couldn't assign irq %d\n", idx);
167+
pnp_dbg(&dev->dev, " couldn't assign irq %d\n", idx);
168168
return -EBUSY;
169169

170170
__add:
@@ -184,7 +184,7 @@ static int pnp_assign_dma(struct pnp_dev *dev, struct pnp_dma *rule, int idx)
184184

185185
res = pnp_get_resource(dev, IORESOURCE_DMA, idx);
186186
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",
188188
idx, (int) res->start, res->flags);
189189
return 0;
190190
}
@@ -205,7 +205,7 @@ static int pnp_assign_dma(struct pnp_dev *dev, struct pnp_dma *rule, int idx)
205205
res->start = res->end = MAX_DMA_CHANNELS;
206206
#endif
207207
res->flags |= IORESOURCE_DISABLED;
208-
dev_dbg(&dev->dev, " disable dma %d\n", idx);
208+
pnp_dbg(&dev->dev, " disable dma %d\n", idx);
209209

210210
__add:
211211
pnp_add_dma_resource(dev, res->start, res->flags);
@@ -238,7 +238,7 @@ static int pnp_assign_resources(struct pnp_dev *dev, int set)
238238
int nport = 0, nmem = 0, nirq = 0, ndma = 0;
239239
int ret = 0;
240240

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);
242242
mutex_lock(&pnp_res_mutex);
243243
pnp_clean_resource_table(dev);
244244

@@ -270,7 +270,7 @@ static int pnp_assign_resources(struct pnp_dev *dev, int set)
270270

271271
mutex_unlock(&pnp_res_mutex);
272272
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);
274274
pnp_clean_resource_table(dev);
275275
} else
276276
dbg_pnp_show_resources(dev, "pnp_assign_resources succeeded");
@@ -286,7 +286,7 @@ int pnp_auto_config_dev(struct pnp_dev *dev)
286286
int i, ret;
287287

288288
if (!pnp_can_configure(dev)) {
289-
dev_dbg(&dev->dev, "configuration not supported\n");
289+
pnp_dbg(&dev->dev, "configuration not supported\n");
290290
return -ENODEV;
291291
}
292292

@@ -313,7 +313,7 @@ int pnp_auto_config_dev(struct pnp_dev *dev)
313313
int pnp_start_dev(struct pnp_dev *dev)
314314
{
315315
if (!pnp_can_write(dev)) {
316-
dev_dbg(&dev->dev, "activation not supported\n");
316+
pnp_dbg(&dev->dev, "activation not supported\n");
317317
return -EINVAL;
318318
}
319319

@@ -336,7 +336,7 @@ int pnp_start_dev(struct pnp_dev *dev)
336336
int pnp_stop_dev(struct pnp_dev *dev)
337337
{
338338
if (!pnp_can_disable(dev)) {
339-
dev_dbg(&dev->dev, "disabling not supported\n");
339+
pnp_dbg(&dev->dev, "disabling not supported\n");
340340
return -EINVAL;
341341
}
342342
if (dev->protocol->disable(dev) < 0) {

‎drivers/pnp/pnpacpi/core.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ static int __init ispnpidacpi(char *id)
7575

7676
static int pnpacpi_get_resources(struct pnp_dev *dev)
7777
{
78-
dev_dbg(&dev->dev, "get resources\n");
78+
pnp_dbg(&dev->dev, "get resources\n");
7979
return pnpacpi_parse_allocated_resource(dev);
8080
}
8181

@@ -86,7 +86,7 @@ static int pnpacpi_set_resources(struct pnp_dev *dev)
8686
int ret;
8787
acpi_status status;
8888

89-
dev_dbg(&dev->dev, "set resources\n");
89+
pnp_dbg(&dev->dev, "set resources\n");
9090
ret = pnpacpi_build_resource_template(dev, &buffer);
9191
if (ret)
9292
return ret;

‎drivers/pnp/pnpacpi/rsparser.c‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ int pnpacpi_parse_allocated_resource(struct pnp_dev *dev)
450450
acpi_handle handle = dev->data;
451451
acpi_status status;
452452

453-
dev_dbg(&dev->dev, "parse allocated resources\n");
453+
pnp_dbg(&dev->dev, "parse allocated resources\n");
454454

455455
pnp_init_resources(dev);
456456

@@ -736,7 +736,7 @@ int __init pnpacpi_parse_resource_option_data(struct pnp_dev *dev)
736736
acpi_status status;
737737
struct acpipnp_parse_option_s parse_data;
738738

739-
dev_dbg(&dev->dev, "parse resource options\n");
739+
pnp_dbg(&dev->dev, "parse resource options\n");
740740

741741
parse_data.dev = dev;
742742
parse_data.option_flags = 0;
@@ -844,7 +844,7 @@ static void pnpacpi_encode_irq(struct pnp_dev *dev,
844844

845845
if (!pnp_resource_enabled(p)) {
846846
irq->interrupt_count = 0;
847-
dev_dbg(&dev->dev, " encode irq (%s)\n",
847+
pnp_dbg(&dev->dev, " encode irq (%s)\n",
848848
p ? "disabled" : "missing");
849849
return;
850850
}
@@ -856,7 +856,7 @@ static void pnpacpi_encode_irq(struct pnp_dev *dev,
856856
irq->interrupt_count = 1;
857857
irq->interrupts[0] = p->start;
858858

859-
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",
860860
(int) p->start,
861861
triggering == ACPI_LEVEL_SENSITIVE ? "level" : "edge",
862862
polarity == ACPI_ACTIVE_LOW ? "low" : "high",
@@ -873,7 +873,7 @@ static void pnpacpi_encode_ext_irq(struct pnp_dev *dev,
873873

874874
if (!pnp_resource_enabled(p)) {
875875
extended_irq->interrupt_count = 0;
876-
dev_dbg(&dev->dev, " encode extended irq (%s)\n",
876+
pnp_dbg(&dev->dev, " encode extended irq (%s)\n",
877877
p ? "disabled" : "missing");
878878
return;
879879
}
@@ -886,7 +886,7 @@ static void pnpacpi_encode_ext_irq(struct pnp_dev *dev,
886886
extended_irq->interrupt_count = 1;
887887
extended_irq->interrupts[0] = p->start;
888888

889-
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,
890890
triggering == ACPI_LEVEL_SENSITIVE ? "level" : "edge",
891891
polarity == ACPI_ACTIVE_LOW ? "low" : "high",
892892
extended_irq->sharable == ACPI_SHARED ? "shared" : "exclusive");
@@ -900,7 +900,7 @@ static void pnpacpi_encode_dma(struct pnp_dev *dev,
900900

901901
if (!pnp_resource_enabled(p)) {
902902
dma->channel_count = 0;
903-
dev_dbg(&dev->dev, " encode dma (%s)\n",
903+
pnp_dbg(&dev->dev, " encode dma (%s)\n",
904904
p ? "disabled" : "missing");
905905
return;
906906
}
@@ -935,7 +935,7 @@ static void pnpacpi_encode_dma(struct pnp_dev *dev,
935935
dma->channel_count = 1;
936936
dma->channels[0] = p->start;
937937

938-
dev_dbg(&dev->dev, " encode dma %d "
938+
pnp_dbg(&dev->dev, " encode dma %d "
939939
"type %#x transfer %#x master %d\n",
940940
(int) p->start, dma->type, dma->transfer, dma->bus_master);
941941
}
@@ -959,7 +959,7 @@ static void pnpacpi_encode_io(struct pnp_dev *dev,
959959
io->address_length = 0;
960960
}
961961

962-
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,
963963
io->minimum + io->address_length - 1, io->io_decode);
964964
}
965965

@@ -977,7 +977,7 @@ static void pnpacpi_encode_fixed_io(struct pnp_dev *dev,
977977
fixed_io->address_length = 0;
978978
}
979979

980-
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,
981981
fixed_io->address + fixed_io->address_length - 1);
982982
}
983983

@@ -1000,7 +1000,7 @@ static void pnpacpi_encode_mem24(struct pnp_dev *dev,
10001000
memory24->address_length = 0;
10011001
}
10021002

1003-
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",
10041004
memory24->minimum,
10051005
memory24->minimum + memory24->address_length - 1,
10061006
memory24->write_protect);
@@ -1024,7 +1024,7 @@ static void pnpacpi_encode_mem32(struct pnp_dev *dev,
10241024
memory32->alignment = 0;
10251025
}
10261026

1027-
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",
10281028
memory32->minimum,
10291029
memory32->minimum + memory32->address_length - 1,
10301030
memory32->write_protect);
@@ -1047,7 +1047,7 @@ static void pnpacpi_encode_fixed_mem32(struct pnp_dev *dev,
10471047
fixed_memory32->address_length = 0;
10481048
}
10491049

1050-
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",
10511051
fixed_memory32->address,
10521052
fixed_memory32->address + fixed_memory32->address_length - 1,
10531053
fixed_memory32->write_protect);
@@ -1061,7 +1061,7 @@ int pnpacpi_encode_resources(struct pnp_dev *dev, struct acpi_buffer *buffer)
10611061
struct acpi_resource *resource = buffer->pointer;
10621062
int port = 0, irq = 0, dma = 0, mem = 0;
10631063

1064-
dev_dbg(&dev->dev, "encode %d resources\n", res_cnt);
1064+
pnp_dbg(&dev->dev, "encode %d resources\n", res_cnt);
10651065
while (i < res_cnt) {
10661066
switch (resource->type) {
10671067
case ACPI_RESOURCE_TYPE_IRQ:

‎drivers/pnp/pnpbios/core.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ static int pnpbios_get_resources(struct pnp_dev *dev)
211211
if (!pnpbios_is_dynamic(dev))
212212
return -EPERM;
213213

214-
dev_dbg(&dev->dev, "get resources\n");
214+
pnp_dbg(&dev->dev, "get resources\n");
215215
node = kzalloc(node_info.max_node_size, GFP_KERNEL);
216216
if (!node)
217217
return -1;
@@ -234,7 +234,7 @@ static int pnpbios_set_resources(struct pnp_dev *dev)
234234
if (!pnpbios_is_dynamic(dev))
235235
return -EPERM;
236236

237-
dev_dbg(&dev->dev, "set resources\n");
237+
pnp_dbg(&dev->dev, "set resources\n");
238238
node = kzalloc(node_info.max_node_size, GFP_KERNEL);
239239
if (!node)
240240
return -1;

0 commit comments

Comments
 (0)