Commit e3cf69511a2c5369c58f6fd6a065de152c3d4b22

Authored by Bjorn Helgaas
Committed by Dave Airlie
1 parent 55814b74c9

agp: use dev_printk when possible

Convert printks to use dev_printk().

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>

Showing 11 changed files with 141 additions and 134 deletions Side-by-side Diff

drivers/char/agp/ali-agp.c
... ... @@ -110,7 +110,8 @@
110 110  
111 111 nlvm_addr+= agp_bridge->gart_bus_addr;
112 112 nlvm_addr|=(agp_bridge->gart_bus_addr>>12);
113   - printk(KERN_INFO PFX "nlvm top &base = %8x\n",nlvm_addr);
  113 + dev_info(&agp_bridge->dev->dev, "nlvm top &base = %8x\n",
  114 + nlvm_addr);
114 115 }
115 116 #endif
116 117  
... ... @@ -315,8 +316,8 @@
315 316 goto found;
316 317 }
317 318  
318   - printk(KERN_ERR PFX "Unsupported ALi chipset (device id: %04x)\n",
319   - pdev->device);
  319 + dev_err(&pdev->dev, "unsupported ALi chipset [%04x/%04x])\n",
  320 + pdev->vendor, pdev->device);
320 321 return -ENODEV;
321 322  
322 323  
... ... @@ -361,8 +362,7 @@
361 362 bridge->driver = &ali_generic_bridge;
362 363 }
363 364  
364   - printk(KERN_INFO PFX "Detected ALi %s chipset\n",
365   - devs[j].chipset_name);
  365 + dev_info(&pdev->dev, "ALi %s chipset\n", devs[j].chipset_name);
366 366  
367 367 /* Fill in the mode register */
368 368 pci_read_config_dword(pdev,
drivers/char/agp/amd-k7-agp.c
... ... @@ -419,8 +419,8 @@
419 419 return -ENODEV;
420 420  
421 421 j = ent - agp_amdk7_pci_table;
422   - printk(KERN_INFO PFX "Detected AMD %s chipset\n",
423   - amd_agp_device_ids[j].chipset_name);
  422 + dev_info(&pdev->dev, "AMD %s chipset\n",
  423 + amd_agp_device_ids[j].chipset_name);
424 424  
425 425 bridge = agp_alloc_bridge();
426 426 if (!bridge)
... ... @@ -442,7 +442,7 @@
442 442 while (!cap_ptr) {
443 443 gfxcard = pci_get_class(PCI_CLASS_DISPLAY_VGA<<8, gfxcard);
444 444 if (!gfxcard) {
445   - printk (KERN_INFO PFX "Couldn't find an AGP VGA controller.\n");
  445 + dev_info(&pdev->dev, "no AGP VGA controller\n");
446 446 return -ENODEV;
447 447 }
448 448 cap_ptr = pci_find_capability(gfxcard, PCI_CAP_ID_AGP);
... ... @@ -453,7 +453,7 @@
453 453 (if necessary at all). */
454 454 if (gfxcard->vendor == PCI_VENDOR_ID_NVIDIA) {
455 455 agp_bridge->flags |= AGP_ERRATA_1X;
456   - printk (KERN_INFO PFX "AMD 751 chipset with NVidia GeForce detected. Forcing to 1X due to errata.\n");
  456 + dev_info(&pdev->dev, "AMD 751 chipset with NVidia GeForce; forcing 1X due to errata\n");
457 457 }
458 458 pci_dev_put(gfxcard);
459 459 }
... ... @@ -469,7 +469,7 @@
469 469 agp_bridge->flags = AGP_ERRATA_FASTWRITES;
470 470 agp_bridge->flags |= AGP_ERRATA_SBA;
471 471 agp_bridge->flags |= AGP_ERRATA_1X;
472   - printk (KERN_INFO PFX "AMD 761 chipset with errata detected - disabling AGP fast writes & SBA and forcing to 1X.\n");
  472 + dev_info(&pdev->dev, "AMD 761 chipset with errata; disabling AGP fast writes & SBA and forcing to 1X\n");
473 473 }
474 474 }
475 475  
drivers/char/agp/amd64-agp.c
... ... @@ -294,12 +294,13 @@
294 294 * so let double check that order, and lets trust the AMD NB settings
295 295 */
296 296 if (order >=0 && aper + (32ULL<<(20 + order)) > 0x100000000ULL) {
297   - printk(KERN_INFO "Aperture size %u MB is not right, using settings from NB\n",
298   - 32 << order);
  297 + dev_info(&agp->dev, "aperture size %u MB is not right, using settings from NB\n",
  298 + 32 << order);
299 299 order = nb_order;
300 300 }
301 301  
302   - printk(KERN_INFO PFX "Aperture from AGP @ %Lx size %u MB\n", aper, 32 << order);
  302 + dev_info(&agp->dev, "aperture from AGP @ %Lx size %u MB\n",
  303 + aper, 32 << order);
303 304 if (order < 0 || !agp_aperture_valid(aper, (32*1024*1024)<<order))
304 305 return -1;
305 306  
306 307  
... ... @@ -320,10 +321,10 @@
320 321 for (i = 0; i < num_k8_northbridges; i++) {
321 322 struct pci_dev *dev = k8_northbridges[i];
322 323 if (fix_northbridge(dev, pdev, cap_ptr) < 0) {
323   - printk(KERN_ERR PFX "No usable aperture found.\n");
  324 + dev_err(&dev->dev, "no usable aperture found\n");
324 325 #ifdef __x86_64__
325 326 /* should port this to i386 */
326   - printk(KERN_ERR PFX "Consider rebooting with iommu=memaper=2 to get a good aperture.\n");
  327 + dev_err(&dev->dev, "consider rebooting with iommu=memaper=2 to get a good aperture\n");
327 328 #endif
328 329 return -1;
329 330 }
330 331  
... ... @@ -346,14 +347,14 @@
346 347 default: revstring="??"; break;
347 348 }
348 349  
349   - printk (KERN_INFO PFX "Detected AMD 8151 AGP Bridge rev %s\n", revstring);
  350 + dev_info(&pdev->dev, "AMD 8151 AGP Bridge rev %s\n", revstring);
350 351  
351 352 /*
352 353 * Work around errata.
353 354 * Chips before B2 stepping incorrectly reporting v3.5
354 355 */
355 356 if (pdev->revision < 0x13) {
356   - printk (KERN_INFO PFX "Correcting AGP revision (reports 3.5, is really 3.0)\n");
  357 + dev_info(&pdev->dev, "correcting AGP revision (reports 3.5, is really 3.0)\n");
357 358 bridge->major_version = 3;
358 359 bridge->minor_version = 0;
359 360 }
360 361  
... ... @@ -376,11 +377,11 @@
376 377 struct pci_dev *dev1;
377 378 int i;
378 379 unsigned size = amd64_fetch_size();
379   - printk(KERN_INFO "Setting up ULi AGP.\n");
  380 +
  381 + dev_info(&pdev->dev, "setting up ULi AGP\n");
380 382 dev1 = pci_get_slot (pdev->bus,PCI_DEVFN(0,0));
381 383 if (dev1 == NULL) {
382   - printk(KERN_INFO PFX "Detected a ULi chipset, "
383   - "but could not fine the secondary device.\n");
  384 + dev_info(&pdev->dev, "can't find ULi secondary device\n");
384 385 return -ENODEV;
385 386 }
386 387  
... ... @@ -389,7 +390,7 @@
389 390 break;
390 391  
391 392 if (i == ARRAY_SIZE(uli_sizes)) {
392   - printk(KERN_INFO PFX "No ULi size found for %d\n", size);
  393 + dev_info(&pdev->dev, "no ULi size found for %d\n", size);
393 394 return -ENODEV;
394 395 }
395 396  
396 397  
... ... @@ -434,13 +435,11 @@
434 435 int i;
435 436 unsigned size = amd64_fetch_size();
436 437  
437   - printk(KERN_INFO PFX "Setting up Nforce3 AGP.\n");
  438 + dev_info(&pdev->dev, "setting up Nforce3 AGP\n");
438 439  
439 440 dev1 = pci_get_slot(pdev->bus, PCI_DEVFN(11, 0));
440 441 if (dev1 == NULL) {
441   - printk(KERN_INFO PFX "agpgart: Detected an NVIDIA "
442   - "nForce3 chipset, but could not find "
443   - "the secondary device.\n");
  442 + dev_info(&pdev->dev, "can't find Nforce3 secondary device\n");
444 443 return -ENODEV;
445 444 }
446 445  
... ... @@ -449,7 +448,7 @@
449 448 break;
450 449  
451 450 if (i == ARRAY_SIZE(nforce3_sizes)) {
452   - printk(KERN_INFO PFX "No NForce3 size found for %d\n", size);
  451 + dev_info(&pdev->dev, "no NForce3 size found for %d\n", size);
453 452 return -ENODEV;
454 453 }
455 454  
... ... @@ -463,7 +462,7 @@
463 462  
464 463 /* if x86-64 aperture base is beyond 4G, exit here */
465 464 if ( (apbase & 0x7fff) >> (32 - 25) ) {
466   - printk(KERN_INFO PFX "aperture base > 4G\n");
  465 + dev_info(&pdev->dev, "aperture base > 4G\n");
467 466 return -ENODEV;
468 467 }
469 468  
... ... @@ -506,7 +505,8 @@
506 505 pdev->device == PCI_DEVICE_ID_AMD_8151_0) {
507 506 amd8151_init(pdev, bridge);
508 507 } else {
509   - printk(KERN_INFO PFX "Detected AGP bridge %x\n", pdev->devfn);
  508 + dev_info(&pdev->dev, "AGP bridge [%04x/%04x]\n",
  509 + pdev->vendor, pdev->device);
510 510 }
511 511  
512 512 bridge->driver = &amd_8151_driver;
drivers/char/agp/ati-agp.c
... ... @@ -486,8 +486,8 @@
486 486 goto found;
487 487 }
488 488  
489   - printk(KERN_ERR PFX
490   - "Unsupported Ati chipset (device id: %04x)\n", pdev->device);
  489 + dev_err(&pdev->dev, "unsupported Ati chipset [%04x/%04x])\n",
  490 + pdev->vendor, pdev->device);
491 491 return -ENODEV;
492 492  
493 493 found:
... ... @@ -500,8 +500,7 @@
500 500  
501 501 bridge->driver = &ati_generic_bridge;
502 502  
503   - printk(KERN_INFO PFX "Detected Ati %s chipset\n",
504   - devs[j].chipset_name);
  503 + dev_info(&pdev->dev, "Ati %s chipset\n", devs[j].chipset_name);
505 504  
506 505 /* Fill in the mode register */
507 506 pci_read_config_dword(pdev,
drivers/char/agp/backend.c
... ... @@ -144,7 +144,8 @@
144 144 void *addr = bridge->driver->agp_alloc_page(bridge);
145 145  
146 146 if (!addr) {
147   - printk(KERN_ERR PFX "unable to get memory for scratch page.\n");
  147 + dev_err(&bridge->dev->dev,
  148 + "can't get memory for scratch page\n");
148 149 return -ENOMEM;
149 150 }
150 151  
151 152  
... ... @@ -155,13 +156,13 @@
155 156  
156 157 size_value = bridge->driver->fetch_size();
157 158 if (size_value == 0) {
158   - printk(KERN_ERR PFX "unable to determine aperture size.\n");
  159 + dev_err(&bridge->dev->dev, "can't determine aperture size\n");
159 160 rc = -EINVAL;
160 161 goto err_out;
161 162 }
162 163 if (bridge->driver->create_gatt_table(bridge)) {
163   - printk(KERN_ERR PFX
164   - "unable to get memory for graphics translation table.\n");
  164 + dev_err(&bridge->dev->dev,
  165 + "can't get memory for graphics translation table\n");
165 166 rc = -ENOMEM;
166 167 goto err_out;
167 168 }
... ... @@ -169,7 +170,8 @@
169 170  
170 171 bridge->key_list = vmalloc(PAGE_SIZE * 4);
171 172 if (bridge->key_list == NULL) {
172   - printk(KERN_ERR PFX "error allocating memory for key lists.\n");
  173 + dev_err(&bridge->dev->dev,
  174 + "can't allocate memory for key lists\n");
173 175 rc = -ENOMEM;
174 176 goto err_out;
175 177 }
... ... @@ -179,7 +181,7 @@
179 181 memset(bridge->key_list, 0, PAGE_SIZE * 4);
180 182  
181 183 if (bridge->driver->configure()) {
182   - printk(KERN_ERR PFX "error configuring host chipset.\n");
  184 + dev_err(&bridge->dev->dev, "error configuring host chipset\n");
183 185 rc = -EINVAL;
184 186 goto err_out;
185 187 }
186 188  
187 189  
188 190  
... ... @@ -269,25 +271,27 @@
269 271  
270 272 /* Grab reference on the chipset driver. */
271 273 if (!try_module_get(bridge->driver->owner)) {
272   - printk (KERN_INFO PFX "Couldn't lock chipset driver.\n");
  274 + dev_info(&bridge->dev->dev, "can't lock chipset driver\n");
273 275 return -EINVAL;
274 276 }
275 277  
276 278 error = agp_backend_initialize(bridge);
277 279 if (error) {
278   - printk (KERN_INFO PFX "agp_backend_initialize() failed.\n");
  280 + dev_info(&bridge->dev->dev,
  281 + "agp_backend_initialize() failed\n");
279 282 goto err_out;
280 283 }
281 284  
282 285 if (list_empty(&agp_bridges)) {
283 286 error = agp_frontend_initialize();
284 287 if (error) {
285   - printk (KERN_INFO PFX "agp_frontend_initialize() failed.\n");
  288 + dev_info(&bridge->dev->dev,
  289 + "agp_frontend_initialize() failed\n");
286 290 goto frontend_err;
287 291 }
288 292  
289   - printk(KERN_INFO PFX "AGP aperture is %dM @ 0x%lx\n",
290   - bridge->driver->fetch_size(), bridge->gart_bus_addr);
  293 + dev_info(&bridge->dev->dev, "AGP aperture is %dM @ 0x%lx\n",
  294 + bridge->driver->fetch_size(), bridge->gart_bus_addr);
291 295  
292 296 }
293 297  
drivers/char/agp/generic.c
... ... @@ -771,8 +771,8 @@
771 771 if (!agp)
772 772 continue;
773 773  
774   - printk(KERN_INFO PFX "Putting AGP V%d device at %s into %dx mode\n",
775   - agp_v3 ? 3 : 2, pci_name(device), mode);
  774 + dev_info(&device->dev, "putting AGP V%d device into %dx mode\n",
  775 + agp_v3 ? 3 : 2, mode);
776 776 pci_write_config_dword(device, agp + PCI_AGP_COMMAND, bridge_agpstat);
777 777 }
778 778 }
... ... @@ -800,10 +800,8 @@
800 800  
801 801 get_agp_version(agp_bridge);
802 802  
803   - printk(KERN_INFO PFX "Found an AGP %d.%d compliant device at %s.\n",
804   - agp_bridge->major_version,
805   - agp_bridge->minor_version,
806   - pci_name(agp_bridge->dev));
  803 + dev_info(&agp_bridge->dev->dev, "AGP %d.%d bridge\n",
  804 + agp_bridge->major_version, agp_bridge->minor_version);
807 805  
808 806 pci_read_config_dword(agp_bridge->dev,
809 807 agp_bridge->capndx + PCI_AGP_STATUS, &bridge_agpstat);
... ... @@ -832,8 +830,7 @@
832 830 pci_write_config_dword(bridge->dev,
833 831 bridge->capndx+AGPCTRL, temp);
834 832  
835   - printk(KERN_INFO PFX "Device is in legacy mode,"
836   - " falling back to 2.x\n");
  833 + dev_info(&bridge->dev->dev, "bridge is in legacy mode, falling back to 2.x\n");
837 834 }
838 835 }
839 836  
drivers/char/agp/intel-agp.c
... ... @@ -161,7 +161,7 @@
161 161 values = A_SIZE_FIX(agp_bridge->driver->aperture_sizes);
162 162  
163 163 if ((smram_miscc & I810_GMS) == I810_GMS_DISABLE) {
164   - printk(KERN_WARNING PFX "i810 is disabled\n");
  164 + dev_warn(&agp_bridge->dev->dev, "i810 is disabled\n");
165 165 return 0;
166 166 }
167 167 if ((smram_miscc & I810_GFX_MEM_WIN_SIZE) == I810_GFX_MEM_WIN_32M) {
... ... @@ -193,7 +193,8 @@
193 193  
194 194 intel_private.registers = ioremap(temp, 128 * 4096);
195 195 if (!intel_private.registers) {
196   - printk(KERN_ERR PFX "Unable to remap memory.\n");
  196 + dev_err(&intel_private.pcidev->dev,
  197 + "can't remap memory\n");
197 198 return -ENOMEM;
198 199 }
199 200 }
... ... @@ -201,7 +202,8 @@
201 202 if ((readl(intel_private.registers+I810_DRAM_CTL)
202 203 & I810_DRAM_ROW_0) == I810_DRAM_ROW_0_SDRAM) {
203 204 /* This will need to be dynamically assigned */
204   - printk(KERN_INFO PFX "detected 4MB dedicated video ram.\n");
  205 + dev_info(&intel_private.pcidev->dev,
  206 + "detected 4MB dedicated video ram\n");
205 207 intel_private.num_dcache_entries = 1024;
206 208 }
207 209 pci_read_config_dword(intel_private.pcidev, I810_GMADDR, &temp);
... ... @@ -500,8 +502,8 @@
500 502 size = 1024 + 512;
501 503 break;
502 504 default:
503   - printk(KERN_INFO PFX "Unknown page table size, "
504   - "assuming 512KB\n");
  505 + dev_info(&intel_private.pcidev->dev,
  506 + "unknown page table size, assuming 512KB\n");
505 507 size = 512;
506 508 }
507 509 size += 4; /* add in BIOS popup space */
... ... @@ -515,8 +517,8 @@
515 517 size = 2048;
516 518 break;
517 519 default:
518   - printk(KERN_INFO PFX "Unknown page table size 0x%x, "
519   - "assuming 512KB\n",
  520 + dev_info(&agp_bridge->dev->dev,
  521 + "unknown page table size 0x%x, assuming 512KB\n",
520 522 (gmch_ctrl & G33_PGETBL_SIZE_MASK));
521 523 size = 512;
522 524 }
523 525  
... ... @@ -627,11 +629,11 @@
627 629 }
628 630 }
629 631 if (gtt_entries > 0)
630   - printk(KERN_INFO PFX "Detected %dK %s memory.\n",
  632 + dev_info(&agp_bridge->dev->dev, "detected %dK %s memory\n",
631 633 gtt_entries / KB(1), local ? "local" : "stolen");
632 634 else
633   - printk(KERN_INFO PFX
634   - "No pre-allocated video memory detected.\n");
  635 + dev_info(&agp_bridge->dev->dev,
  636 + "no pre-allocated video memory detected\n");
635 637 gtt_entries /= KB(4);
636 638  
637 639 intel_private.gtt_entries = gtt_entries;
638 640  
... ... @@ -801,10 +803,12 @@
801 803 num_entries = A_SIZE_FIX(temp)->num_entries;
802 804  
803 805 if (pg_start < intel_private.gtt_entries) {
804   - printk(KERN_DEBUG PFX "pg_start == 0x%.8lx,intel_private.gtt_entries == 0x%.8x\n",
805   - pg_start, intel_private.gtt_entries);
  806 + dev_printk(KERN_DEBUG, &intel_private.pcidev->dev,
  807 + "pg_start == 0x%.8lx, intel_private.gtt_entries == 0x%.8x\n",
  808 + pg_start, intel_private.gtt_entries);
806 809  
807   - printk(KERN_INFO PFX "Trying to insert into local/stolen memory\n");
  810 + dev_info(&intel_private.pcidev->dev,
  811 + "trying to insert into local/stolen memory\n");
808 812 goto out_err;
809 813 }
810 814  
... ... @@ -851,7 +855,8 @@
851 855 return 0;
852 856  
853 857 if (pg_start < intel_private.gtt_entries) {
854   - printk(KERN_INFO PFX "Trying to disable local/stolen memory\n");
  858 + dev_info(&intel_private.pcidev->dev,
  859 + "trying to disable local/stolen memory\n");
855 860 return -EINVAL;
856 861 }
857 862  
... ... @@ -957,7 +962,7 @@
957 962 if (intel_private.ifp_resource.start) {
958 963 intel_private.i9xx_flush_page = ioremap_nocache(intel_private.ifp_resource.start, PAGE_SIZE);
959 964 if (!intel_private.i9xx_flush_page)
960   - printk(KERN_INFO "unable to ioremap flush page - no chipset flushing");
  965 + dev_info(&intel_private.pcidev->dev, "can't ioremap flush page - no chipset flushing");
961 966 }
962 967 }
963 968  
964 969  
... ... @@ -1028,10 +1033,12 @@
1028 1033 num_entries = A_SIZE_FIX(temp)->num_entries;
1029 1034  
1030 1035 if (pg_start < intel_private.gtt_entries) {
1031   - printk(KERN_DEBUG PFX "pg_start == 0x%.8lx,intel_private.gtt_entries == 0x%.8x\n",
1032   - pg_start, intel_private.gtt_entries);
  1036 + dev_printk(KERN_DEBUG, &intel_private.pcidev->dev,
  1037 + "pg_start == 0x%.8lx, intel_private.gtt_entries == 0x%.8x\n",
  1038 + pg_start, intel_private.gtt_entries);
1033 1039  
1034   - printk(KERN_INFO PFX "Trying to insert into local/stolen memory\n");
  1040 + dev_info(&intel_private.pcidev->dev,
  1041 + "trying to insert into local/stolen memory\n");
1035 1042 goto out_err;
1036 1043 }
1037 1044  
... ... @@ -1078,7 +1085,8 @@
1078 1085 return 0;
1079 1086  
1080 1087 if (pg_start < intel_private.gtt_entries) {
1081   - printk(KERN_INFO PFX "Trying to disable local/stolen memory\n");
  1088 + dev_info(&intel_private.pcidev->dev,
  1089 + "trying to disable local/stolen memory\n");
1082 1090 return -EINVAL;
1083 1091 }
1084 1092  
... ... @@ -1379,7 +1387,7 @@
1379 1387 /* the Intel 815 chipset spec. says that bits 29-31 in the
1380 1388 * ATTBASE register are reserved -> try not to write them */
1381 1389 if (agp_bridge->gatt_bus_addr & INTEL_815_ATTBASE_MASK) {
1382   - printk(KERN_EMERG PFX "gatt bus addr too high");
  1390 + dev_emerg(&agp_bridge->dev->dev, "gatt bus addr too high");
1383 1391 return -EINVAL;
1384 1392 }
1385 1393  
... ... @@ -2163,8 +2171,8 @@
2163 2171  
2164 2172 if (intel_agp_chipsets[i].name == NULL) {
2165 2173 if (cap_ptr)
2166   - printk(KERN_WARNING PFX "Unsupported Intel chipset"
2167   - "(device id: %04x)\n", pdev->device);
  2174 + dev_warn(&pdev->dev, "unsupported Intel chipset [%04x/%04x]\n",
  2175 + pdev->vendor, pdev->device);
2168 2176 agp_put_bridge(bridge);
2169 2177 return -ENODEV;
2170 2178 }
... ... @@ -2172,9 +2180,8 @@
2172 2180 if (bridge->driver == NULL) {
2173 2181 /* bridge has no AGP and no IGD detected */
2174 2182 if (cap_ptr)
2175   - printk(KERN_WARNING PFX "Failed to find bridge device "
2176   - "(chip_id: %04x)\n",
2177   - intel_agp_chipsets[i].gmch_chip_id);
  2183 + dev_warn(&pdev->dev, "can't find bridge device (chip_id: %04x)\n",
  2184 + intel_agp_chipsets[i].gmch_chip_id);
2178 2185 agp_put_bridge(bridge);
2179 2186 return -ENODEV;
2180 2187 }
... ... @@ -2183,8 +2190,7 @@
2183 2190 bridge->capndx = cap_ptr;
2184 2191 bridge->dev_private_data = &intel_private;
2185 2192  
2186   - printk(KERN_INFO PFX "Detected an Intel %s Chipset.\n",
2187   - intel_agp_chipsets[i].name);
  2193 + dev_info(&pdev->dev, "Intel %s Chipset\n", intel_agp_chipsets[i].name);
2188 2194  
2189 2195 /*
2190 2196 * The following fixes the case where the BIOS has "forgotten" to
... ... @@ -2194,7 +2200,7 @@
2194 2200 r = &pdev->resource[0];
2195 2201 if (!r->start && r->end) {
2196 2202 if (pci_assign_resource(pdev, 0)) {
2197   - printk(KERN_ERR PFX "could not assign resource 0\n");
  2203 + dev_err(&pdev->dev, "can't assign resource 0\n");
2198 2204 agp_put_bridge(bridge);
2199 2205 return -ENODEV;
2200 2206 }
... ... @@ -2206,7 +2212,7 @@
2206 2212 * 20030610 - hamish@zot.org
2207 2213 */
2208 2214 if (pci_enable_device(pdev)) {
2209   - printk(KERN_ERR PFX "Unable to Enable PCI device\n");
  2215 + dev_err(&pdev->dev, "can't enable PCI device\n");
2210 2216 agp_put_bridge(bridge);
2211 2217 return -ENODEV;
2212 2218 }
drivers/char/agp/isoch.c
... ... @@ -153,7 +153,7 @@
153 153  
154 154 /* Check if this configuration has any chance of working */
155 155 if (tot_bw > target.maxbw) {
156   - printk(KERN_ERR PFX "isochronous bandwidth required "
  156 + dev_err(&td->dev, "isochronous bandwidth required "
157 157 "by AGP 3.0 devices exceeds that which is supported by "
158 158 "the AGP 3.0 bridge!\n");
159 159 ret = -ENODEV;
... ... @@ -188,7 +188,7 @@
188 188 /* Exit if the minimal ISOCH_N allocation among the masters is more
189 189 * than the target can handle. */
190 190 if (tot_n > target.n) {
191   - printk(KERN_ERR PFX "number of isochronous "
  191 + dev_err(&td->dev, "number of isochronous "
192 192 "transactions per period required by AGP 3.0 devices "
193 193 "exceeds that which is supported by the AGP 3.0 "
194 194 "bridge!\n");
... ... @@ -229,7 +229,7 @@
229 229 /* Exit if the minimal RQ needs of the masters exceeds what the target
230 230 * can provide. */
231 231 if (tot_rq > rq_isoch) {
232   - printk(KERN_ERR PFX "number of request queue slots "
  232 + dev_err(&td->dev, "number of request queue slots "
233 233 "required by the isochronous bandwidth requested by "
234 234 "AGP 3.0 devices exceeds the number provided by the "
235 235 "AGP 3.0 bridge!\n");
... ... @@ -359,8 +359,9 @@
359 359 case 0x0001: /* Unclassified device */
360 360 /* Don't know what this is, but log it for investigation. */
361 361 if (mcapndx != 0) {
362   - printk (KERN_INFO PFX "Wacky, found unclassified AGP device. %x:%x\n",
363   - dev->vendor, dev->device);
  362 + dev_info(&td->dev, "wacky, found unclassified AGP device %s [%04x/%04x]\n",
  363 + pci_name(dev),
  364 + dev->vendor, dev->device);
364 365 }
365 366 continue;
366 367  
367 368  
... ... @@ -407,17 +408,18 @@
407 408 }
408 409  
409 410 if (mcapndx == 0) {
410   - printk(KERN_ERR PFX "woah! Non-AGP device "
411   - "found on the secondary bus of an AGP 3.5 bridge!\n");
  411 + dev_err(&td->dev, "woah! Non-AGP device %s on "
  412 + "secondary bus of AGP 3.5 bridge!\n",
  413 + pci_name(dev));
412 414 ret = -ENODEV;
413 415 goto free_and_exit;
414 416 }
415 417  
416 418 mmajor = (ncapid >> AGP_MAJOR_VERSION_SHIFT) & 0xf;
417 419 if (mmajor < 3) {
418   - printk(KERN_ERR PFX "woah! AGP 2.0 device "
419   - "found on the secondary bus of an AGP 3.5 "
420   - "bridge operating with AGP 3.0 electricals!\n");
  420 + dev_err(&td->dev, "woah! AGP 2.0 device %s on "
  421 + "secondary bus of AGP 3.5 bridge operating "
  422 + "with AGP 3.0 electricals!\n", pci_name(dev));
421 423 ret = -ENODEV;
422 424 goto free_and_exit;
423 425 }
... ... @@ -427,10 +429,10 @@
427 429 pci_read_config_dword(dev, cur->capndx+AGPSTAT, &mstatus);
428 430  
429 431 if (((mstatus >> 3) & 0x1) == 0) {
430   - printk(KERN_ERR PFX "woah! AGP 3.x device "
431   - "not operating in AGP 3.x mode found on the "
432   - "secondary bus of an AGP 3.5 bridge operating "
433   - "with AGP 3.0 electricals!\n");
  432 + dev_err(&td->dev, "woah! AGP 3.x device %s not "
  433 + "operating in AGP 3.x mode on secondary bus "
  434 + "of AGP 3.5 bridge operating with AGP 3.0 "
  435 + "electricals!\n", pci_name(dev));
434 436 ret = -ENODEV;
435 437 goto free_and_exit;
436 438 }
... ... @@ -444,9 +446,9 @@
444 446 if (isoch) {
445 447 ret = agp_3_5_isochronous_node_enable(bridge, dev_list, ndevs);
446 448 if (ret) {
447   - printk(KERN_INFO PFX "Something bad happened setting "
448   - "up isochronous xfers. Falling back to "
449   - "non-isochronous xfer mode.\n");
  449 + dev_info(&td->dev, "something bad happened setting "
  450 + "up isochronous xfers; falling back to "
  451 + "non-isochronous xfer mode\n");
450 452 } else {
451 453 goto free_and_exit;
452 454 }
drivers/char/agp/sis-agp.c
... ... @@ -79,10 +79,8 @@
79 79 u32 command;
80 80 int rate;
81 81  
82   - printk(KERN_INFO PFX "Found an AGP %d.%d compliant device at %s.\n",
83   - agp_bridge->major_version,
84   - agp_bridge->minor_version,
85   - pci_name(agp_bridge->dev));
  82 + dev_info(&agp_bridge->dev->dev, "AGP %d.%d bridge\n",
  83 + agp_bridge->major_version, agp_bridge->minor_version);
86 84  
87 85 pci_read_config_dword(agp_bridge->dev, agp_bridge->capndx + PCI_AGP_STATUS, &command);
88 86 command = agp_collect_device_status(bridge, mode, command);
... ... @@ -94,8 +92,8 @@
94 92 if (!agp)
95 93 continue;
96 94  
97   - printk(KERN_INFO PFX "Putting AGP V3 device at %s into %dx mode\n",
98   - pci_name(device), rate);
  95 + dev_info(&agp_bridge->dev->dev, "putting AGP V3 device at %s into %dx mode\n",
  96 + pci_name(device), rate);
99 97  
100 98 pci_write_config_dword(device, agp + PCI_AGP_COMMAND, command);
101 99  
... ... @@ -105,7 +103,7 @@
105 103 * cannot be configured
106 104 */
107 105 if (device->device == bridge->dev->device) {
108   - printk(KERN_INFO PFX "SiS delay workaround: giving bridge time to recover.\n");
  106 + dev_info(&agp_bridge->dev->dev, "SiS delay workaround: giving bridge time to recover\n");
109 107 msleep(10);
110 108 }
111 109 }
... ... @@ -190,7 +188,8 @@
190 188 return -ENODEV;
191 189  
192 190  
193   - printk(KERN_INFO PFX "Detected SiS chipset - id:%i\n", pdev->device);
  191 + dev_info(&pdev->dev, "SiS chipset [%04x/%04x]\n",
  192 + pdev->vendor, pdev->device);
194 193 bridge = agp_alloc_bridge();
195 194 if (!bridge)
196 195 return -ENOMEM;
drivers/char/agp/sworks-agp.c
... ... @@ -241,7 +241,8 @@
241 241 while (readb(serverworks_private.registers+SVWRKS_POSTFLUSH) == 1) {
242 242 cpu_relax();
243 243 if (time_after(jiffies, timeout)) {
244   - printk(KERN_ERR PFX "TLB post flush took more than 3 seconds\n");
  244 + dev_err(&serverworks_private.svrwrks_dev->dev,
  245 + "TLB post flush took more than 3 seconds\n");
245 246 break;
246 247 }
247 248 }
... ... @@ -251,7 +252,8 @@
251 252 while (readl(serverworks_private.registers+SVWRKS_DIRFLUSH) == 1) {
252 253 cpu_relax();
253 254 if (time_after(jiffies, timeout)) {
254   - printk(KERN_ERR PFX "TLB Dir flush took more than 3 seconds\n");
  255 + dev_err(&serverworks_private.svrwrks_dev->dev,
  256 + "TLB Dir flush took more than 3 seconds\n");
255 257 break;
256 258 }
257 259 }
... ... @@ -271,7 +273,7 @@
271 273 temp = (temp & PCI_BASE_ADDRESS_MEM_MASK);
272 274 serverworks_private.registers = (volatile u8 __iomem *) ioremap(temp, 4096);
273 275 if (!serverworks_private.registers) {
274   - printk (KERN_ERR PFX "Unable to ioremap() memory.\n");
  276 + dev_err(&agp_bridge->dev->dev, "can't ioremap(%#x)\n", temp);
275 277 return -ENOMEM;
276 278 }
277 279  
... ... @@ -451,7 +453,7 @@
451 453  
452 454 switch (pdev->device) {
453 455 case 0x0006:
454   - printk (KERN_ERR PFX "ServerWorks CNB20HE is unsupported due to lack of documentation.\n");
  456 + dev_err(&pdev->dev, "ServerWorks CNB20HE is unsupported due to lack of documentation\n");
455 457 return -ENODEV;
456 458  
457 459 case PCI_DEVICE_ID_SERVERWORKS_HE:
... ... @@ -461,8 +463,8 @@
461 463  
462 464 default:
463 465 if (cap_ptr)
464   - printk(KERN_ERR PFX "Unsupported Serverworks chipset "
465   - "(device id: %04x)\n", pdev->device);
  466 + dev_err(&pdev->dev, "unsupported Serverworks chipset "
  467 + "[%04x/%04x]\n", pdev->vendor, pdev->device);
466 468 return -ENODEV;
467 469 }
468 470  
... ... @@ -470,8 +472,7 @@
470 472 bridge_dev = pci_get_bus_and_slot((unsigned int)pdev->bus->number,
471 473 PCI_DEVFN(0, 1));
472 474 if (!bridge_dev) {
473   - printk(KERN_INFO PFX "Detected a Serverworks chipset "
474   - "but could not find the secondary device.\n");
  475 + dev_info(&pdev->dev, "can't find secondary device\n");
475 476 return -ENODEV;
476 477 }
477 478  
... ... @@ -482,8 +483,8 @@
482 483 if (temp & PCI_BASE_ADDRESS_MEM_TYPE_64) {
483 484 pci_read_config_dword(pdev, SVWRKS_APSIZE + 4, &temp2);
484 485 if (temp2 != 0) {
485   - printk(KERN_INFO PFX "Detected 64 bit aperture address, "
486   - "but top bits are not zero. Disabling agp\n");
  486 + dev_info(&pdev->dev, "64 bit aperture address, "
  487 + "but top bits are not zero; disabling AGP\n");
487 488 return -ENODEV;
488 489 }
489 490 serverworks_private.mm_addr_ofs = 0x18;
... ... @@ -495,8 +496,8 @@
495 496 pci_read_config_dword(pdev,
496 497 serverworks_private.mm_addr_ofs + 4, &temp2);
497 498 if (temp2 != 0) {
498   - printk(KERN_INFO PFX "Detected 64 bit MMIO address, "
499   - "but top bits are not zero. Disabling agp\n");
  499 + dev_info(&pdev->dev, "64 bit MMIO address, but top "
  500 + "bits are not zero; disabling AGP\n");
500 501 return -ENODEV;
501 502 }
502 503 }
drivers/char/agp/uninorth-agp.c
... ... @@ -46,8 +46,8 @@
46 46 break;
47 47  
48 48 if (i == agp_bridge->driver->num_aperture_sizes) {
49   - printk(KERN_ERR PFX "Invalid aperture size, using"
50   - " default\n");
  49 + dev_err(&agp_bridge->dev->dev, "invalid aperture size, "
  50 + "using default\n");
51 51 size = 0;
52 52 aperture = NULL;
53 53 }
... ... @@ -108,8 +108,8 @@
108 108  
109 109 current_size = A_SIZE_32(agp_bridge->current_size);
110 110  
111   - printk(KERN_INFO PFX "configuring for size idx: %d\n",
112   - current_size->size_value);
  111 + dev_info(&agp_bridge->dev->dev, "configuring for size idx: %d\n",
  112 + current_size->size_value);
113 113  
114 114 /* aperture size and gatt addr */
115 115 pci_write_config_dword(agp_bridge->dev,
... ... @@ -197,8 +197,9 @@
197 197 gp = (u32 *) &agp_bridge->gatt_table[pg_start];
198 198 for (i = 0; i < mem->page_count; ++i) {
199 199 if (gp[i]) {
200   - printk("u3_insert_memory: entry 0x%x occupied (%x)\n",
201   - i, gp[i]);
  200 + dev_info(&agp_bridge->dev->dev,
  201 + "u3_insert_memory: entry 0x%x occupied (%x)\n",
  202 + i, gp[i]);
202 203 return -EBUSY;
203 204 }
204 205 }
... ... @@ -276,8 +277,8 @@
276 277 &scratch);
277 278 } while ((scratch & PCI_AGP_COMMAND_AGP) == 0 && ++timeout < 1000);
278 279 if ((scratch & PCI_AGP_COMMAND_AGP) == 0)
279   - printk(KERN_ERR PFX "failed to write UniNorth AGP"
280   - " command register\n");
  280 + dev_err(&bridge->dev->dev, "can't write UniNorth AGP "
  281 + "command register\n");
281 282  
282 283 if (uninorth_rev >= 0x30) {
283 284 /* This is an AGP V3 */
... ... @@ -330,8 +331,8 @@
330 331 pci_read_config_dword(device, agp + PCI_AGP_COMMAND, &cmd);
331 332 if (!(cmd & PCI_AGP_COMMAND_AGP))
332 333 continue;
333   - printk("uninorth-agp: disabling AGP on device %s\n",
334   - pci_name(device));
  334 + dev_info(&pdev->dev, "disabling AGP on device %s\n",
  335 + pci_name(device));
335 336 cmd &= ~PCI_AGP_COMMAND_AGP;
336 337 pci_write_config_dword(device, agp + PCI_AGP_COMMAND, cmd);
337 338 }
... ... @@ -341,8 +342,7 @@
341 342 pci_read_config_dword(pdev, agp + PCI_AGP_COMMAND, &cmd);
342 343 bridge->dev_private_data = (void *)(long)cmd;
343 344 if (cmd & PCI_AGP_COMMAND_AGP) {
344   - printk("uninorth-agp: disabling AGP on bridge %s\n",
345   - pci_name(pdev));
  345 + dev_info(&pdev->dev, "disabling AGP on bridge\n");
346 346 cmd &= ~PCI_AGP_COMMAND_AGP;
347 347 pci_write_config_dword(pdev, agp + PCI_AGP_COMMAND, cmd);
348 348 }
349 349  
... ... @@ -591,14 +591,14 @@
591 591 /* probe for known chipsets */
592 592 for (j = 0; devs[j].chipset_name != NULL; ++j) {
593 593 if (pdev->device == devs[j].device_id) {
594   - printk(KERN_INFO PFX "Detected Apple %s chipset\n",
595   - devs[j].chipset_name);
  594 + dev_info(&pdev->dev, "Apple %s chipset\n",
  595 + devs[j].chipset_name);
596 596 goto found;
597 597 }
598 598 }
599 599  
600   - printk(KERN_ERR PFX "Unsupported Apple chipset (device id: %04x).\n",
601   - pdev->device);
  600 + dev_err(&pdev->dev, "unsupported Apple chipset [%04x/%04x]\n",
  601 + pdev->vendor, pdev->device);
602 602 return -ENODEV;
603 603  
604 604 found: