Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/radeon: Remove references to struct drm_device.pdev

Using struct drm_device.pdev is deprecated. Convert radeon to struct
drm_device.dev. No functional changes.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Christian König <christian.koenig@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201201103542.2182-17-tzimmermann@suse.de

+142 -139
+3 -3
drivers/gpu/drm/radeon/atombios_encoders.c
··· 2062 2062 struct radeon_crtc *radeon_crtc = to_radeon_crtc(encoder->crtc); 2063 2063 2064 2064 /* Funky macbooks */ 2065 - if ((dev->pdev->device == 0x71C5) && 2066 - (dev->pdev->subsystem_vendor == 0x106b) && 2067 - (dev->pdev->subsystem_device == 0x0080)) { 2065 + if ((rdev->pdev->device == 0x71C5) && 2066 + (rdev->pdev->subsystem_vendor == 0x106b) && 2067 + (rdev->pdev->subsystem_device == 0x0080)) { 2068 2068 if (radeon_encoder->devices & ATOM_DEVICE_LCD1_SUPPORT) { 2069 2069 uint32_t lvtma_bit_depth_control = RREG32(AVIVO_LVTMA_BIT_DEPTH_CONTROL); 2070 2070
+12 -13
drivers/gpu/drm/radeon/r100.c
··· 2612 2612 2613 2613 void r100_set_common_regs(struct radeon_device *rdev) 2614 2614 { 2615 - struct drm_device *dev = rdev->ddev; 2616 2615 bool force_dac2 = false; 2617 2616 u32 tmp; 2618 2617 ··· 2629 2630 * don't report it in the bios connector 2630 2631 * table. 2631 2632 */ 2632 - switch (dev->pdev->device) { 2633 + switch (rdev->pdev->device) { 2633 2634 /* RN50 */ 2634 2635 case 0x515e: 2635 2636 case 0x5969: ··· 2639 2640 case 0x5159: 2640 2641 case 0x515a: 2641 2642 /* DELL triple head servers */ 2642 - if ((dev->pdev->subsystem_vendor == 0x1028 /* DELL */) && 2643 - ((dev->pdev->subsystem_device == 0x016c) || 2644 - (dev->pdev->subsystem_device == 0x016d) || 2645 - (dev->pdev->subsystem_device == 0x016e) || 2646 - (dev->pdev->subsystem_device == 0x016f) || 2647 - (dev->pdev->subsystem_device == 0x0170) || 2648 - (dev->pdev->subsystem_device == 0x017d) || 2649 - (dev->pdev->subsystem_device == 0x017e) || 2650 - (dev->pdev->subsystem_device == 0x0183) || 2651 - (dev->pdev->subsystem_device == 0x018a) || 2652 - (dev->pdev->subsystem_device == 0x019a))) 2643 + if ((rdev->pdev->subsystem_vendor == 0x1028 /* DELL */) && 2644 + ((rdev->pdev->subsystem_device == 0x016c) || 2645 + (rdev->pdev->subsystem_device == 0x016d) || 2646 + (rdev->pdev->subsystem_device == 0x016e) || 2647 + (rdev->pdev->subsystem_device == 0x016f) || 2648 + (rdev->pdev->subsystem_device == 0x0170) || 2649 + (rdev->pdev->subsystem_device == 0x017d) || 2650 + (rdev->pdev->subsystem_device == 0x017e) || 2651 + (rdev->pdev->subsystem_device == 0x0183) || 2652 + (rdev->pdev->subsystem_device == 0x018a) || 2653 + (rdev->pdev->subsystem_device == 0x019a))) 2653 2654 force_dac2 = true; 2654 2655 break; 2655 2656 }
+16 -16
drivers/gpu/drm/radeon/radeon.h
··· 2622 2622 (rdev->family == CHIP_RV410) || \ 2623 2623 (rdev->family == CHIP_RS400) || \ 2624 2624 (rdev->family == CHIP_RS480)) 2625 - #define ASIC_IS_X2(rdev) ((rdev->ddev->pdev->device == 0x9441) || \ 2626 - (rdev->ddev->pdev->device == 0x9443) || \ 2627 - (rdev->ddev->pdev->device == 0x944B) || \ 2628 - (rdev->ddev->pdev->device == 0x9506) || \ 2629 - (rdev->ddev->pdev->device == 0x9509) || \ 2630 - (rdev->ddev->pdev->device == 0x950F) || \ 2631 - (rdev->ddev->pdev->device == 0x689C) || \ 2632 - (rdev->ddev->pdev->device == 0x689D)) 2625 + #define ASIC_IS_X2(rdev) ((rdev->pdev->device == 0x9441) || \ 2626 + (rdev->pdev->device == 0x9443) || \ 2627 + (rdev->pdev->device == 0x944B) || \ 2628 + (rdev->pdev->device == 0x9506) || \ 2629 + (rdev->pdev->device == 0x9509) || \ 2630 + (rdev->pdev->device == 0x950F) || \ 2631 + (rdev->pdev->device == 0x689C) || \ 2632 + (rdev->pdev->device == 0x689D)) 2633 2633 #define ASIC_IS_AVIVO(rdev) ((rdev->family >= CHIP_RS600)) 2634 2634 #define ASIC_IS_DCE2(rdev) ((rdev->family == CHIP_RS600) || \ 2635 2635 (rdev->family == CHIP_RS690) || \ ··· 2652 2652 #define ASIC_IS_DCE83(rdev) ((rdev->family == CHIP_KABINI) || \ 2653 2653 (rdev->family == CHIP_MULLINS)) 2654 2654 2655 - #define ASIC_IS_LOMBOK(rdev) ((rdev->ddev->pdev->device == 0x6849) || \ 2656 - (rdev->ddev->pdev->device == 0x6850) || \ 2657 - (rdev->ddev->pdev->device == 0x6858) || \ 2658 - (rdev->ddev->pdev->device == 0x6859) || \ 2659 - (rdev->ddev->pdev->device == 0x6840) || \ 2660 - (rdev->ddev->pdev->device == 0x6841) || \ 2661 - (rdev->ddev->pdev->device == 0x6842) || \ 2662 - (rdev->ddev->pdev->device == 0x6843)) 2655 + #define ASIC_IS_LOMBOK(rdev) ((rdev->pdev->device == 0x6849) || \ 2656 + (rdev->pdev->device == 0x6850) || \ 2657 + (rdev->pdev->device == 0x6858) || \ 2658 + (rdev->pdev->device == 0x6859) || \ 2659 + (rdev->pdev->device == 0x6840) || \ 2660 + (rdev->pdev->device == 0x6841) || \ 2661 + (rdev->pdev->device == 0x6842) || \ 2662 + (rdev->pdev->device == 0x6843)) 2663 2663 2664 2664 /* 2665 2665 * BIOS helpers.
+45 -44
drivers/gpu/drm/radeon/radeon_atombios.c
··· 284 284 uint16_t *line_mux, 285 285 struct radeon_hpd *hpd) 286 286 { 287 + struct pci_dev *pdev = to_pci_dev(dev->dev); 287 288 288 289 /* Asus M2A-VM HDMI board lists the DVI port as HDMI */ 289 - if ((dev->pdev->device == 0x791e) && 290 - (dev->pdev->subsystem_vendor == 0x1043) && 291 - (dev->pdev->subsystem_device == 0x826d)) { 290 + if ((pdev->device == 0x791e) && 291 + (pdev->subsystem_vendor == 0x1043) && 292 + (pdev->subsystem_device == 0x826d)) { 292 293 if ((*connector_type == DRM_MODE_CONNECTOR_HDMIA) && 293 294 (supported_device == ATOM_DEVICE_DFP3_SUPPORT)) 294 295 *connector_type = DRM_MODE_CONNECTOR_DVID; 295 296 } 296 297 297 298 /* Asrock RS600 board lists the DVI port as HDMI */ 298 - if ((dev->pdev->device == 0x7941) && 299 - (dev->pdev->subsystem_vendor == 0x1849) && 300 - (dev->pdev->subsystem_device == 0x7941)) { 299 + if ((pdev->device == 0x7941) && 300 + (pdev->subsystem_vendor == 0x1849) && 301 + (pdev->subsystem_device == 0x7941)) { 301 302 if ((*connector_type == DRM_MODE_CONNECTOR_HDMIA) && 302 303 (supported_device == ATOM_DEVICE_DFP3_SUPPORT)) 303 304 *connector_type = DRM_MODE_CONNECTOR_DVID; 304 305 } 305 306 306 307 /* MSI K9A2GM V2/V3 board has no HDMI or DVI */ 307 - if ((dev->pdev->device == 0x796e) && 308 - (dev->pdev->subsystem_vendor == 0x1462) && 309 - (dev->pdev->subsystem_device == 0x7302)) { 308 + if ((pdev->device == 0x796e) && 309 + (pdev->subsystem_vendor == 0x1462) && 310 + (pdev->subsystem_device == 0x7302)) { 310 311 if ((supported_device == ATOM_DEVICE_DFP2_SUPPORT) || 311 312 (supported_device == ATOM_DEVICE_DFP3_SUPPORT)) 312 313 return false; 313 314 } 314 315 315 316 /* a-bit f-i90hd - ciaranm on #radeonhd - this board has no DVI */ 316 - if ((dev->pdev->device == 0x7941) && 317 - (dev->pdev->subsystem_vendor == 0x147b) && 318 - (dev->pdev->subsystem_device == 0x2412)) { 317 + if ((pdev->device == 0x7941) && 318 + (pdev->subsystem_vendor == 0x147b) && 319 + (pdev->subsystem_device == 0x2412)) { 319 320 if (*connector_type == DRM_MODE_CONNECTOR_DVII) 320 321 return false; 321 322 } 322 323 323 324 /* Falcon NW laptop lists vga ddc line for LVDS */ 324 - if ((dev->pdev->device == 0x5653) && 325 - (dev->pdev->subsystem_vendor == 0x1462) && 326 - (dev->pdev->subsystem_device == 0x0291)) { 325 + if ((pdev->device == 0x5653) && 326 + (pdev->subsystem_vendor == 0x1462) && 327 + (pdev->subsystem_device == 0x0291)) { 327 328 if (*connector_type == DRM_MODE_CONNECTOR_LVDS) { 328 329 i2c_bus->valid = false; 329 330 *line_mux = 53; ··· 332 331 } 333 332 334 333 /* HIS X1300 is DVI+VGA, not DVI+DVI */ 335 - if ((dev->pdev->device == 0x7146) && 336 - (dev->pdev->subsystem_vendor == 0x17af) && 337 - (dev->pdev->subsystem_device == 0x2058)) { 334 + if ((pdev->device == 0x7146) && 335 + (pdev->subsystem_vendor == 0x17af) && 336 + (pdev->subsystem_device == 0x2058)) { 338 337 if (supported_device == ATOM_DEVICE_DFP1_SUPPORT) 339 338 return false; 340 339 } 341 340 342 341 /* Gigabyte X1300 is DVI+VGA, not DVI+DVI */ 343 - if ((dev->pdev->device == 0x7142) && 344 - (dev->pdev->subsystem_vendor == 0x1458) && 345 - (dev->pdev->subsystem_device == 0x2134)) { 342 + if ((pdev->device == 0x7142) && 343 + (pdev->subsystem_vendor == 0x1458) && 344 + (pdev->subsystem_device == 0x2134)) { 346 345 if (supported_device == ATOM_DEVICE_DFP1_SUPPORT) 347 346 return false; 348 347 } 349 348 350 349 351 350 /* Funky macbooks */ 352 - if ((dev->pdev->device == 0x71C5) && 353 - (dev->pdev->subsystem_vendor == 0x106b) && 354 - (dev->pdev->subsystem_device == 0x0080)) { 351 + if ((pdev->device == 0x71C5) && 352 + (pdev->subsystem_vendor == 0x106b) && 353 + (pdev->subsystem_device == 0x0080)) { 355 354 if ((supported_device == ATOM_DEVICE_CRT1_SUPPORT) || 356 355 (supported_device == ATOM_DEVICE_DFP2_SUPPORT)) 357 356 return false; ··· 367 366 } 368 367 369 368 /* ASUS HD 3600 XT board lists the DVI port as HDMI */ 370 - if ((dev->pdev->device == 0x9598) && 371 - (dev->pdev->subsystem_vendor == 0x1043) && 372 - (dev->pdev->subsystem_device == 0x01da)) { 369 + if ((pdev->device == 0x9598) && 370 + (pdev->subsystem_vendor == 0x1043) && 371 + (pdev->subsystem_device == 0x01da)) { 373 372 if (*connector_type == DRM_MODE_CONNECTOR_HDMIA) { 374 373 *connector_type = DRM_MODE_CONNECTOR_DVII; 375 374 } 376 375 } 377 376 378 377 /* ASUS HD 3600 board lists the DVI port as HDMI */ 379 - if ((dev->pdev->device == 0x9598) && 380 - (dev->pdev->subsystem_vendor == 0x1043) && 381 - (dev->pdev->subsystem_device == 0x01e4)) { 378 + if ((pdev->device == 0x9598) && 379 + (pdev->subsystem_vendor == 0x1043) && 380 + (pdev->subsystem_device == 0x01e4)) { 382 381 if (*connector_type == DRM_MODE_CONNECTOR_HDMIA) { 383 382 *connector_type = DRM_MODE_CONNECTOR_DVII; 384 383 } 385 384 } 386 385 387 386 /* ASUS HD 3450 board lists the DVI port as HDMI */ 388 - if ((dev->pdev->device == 0x95C5) && 389 - (dev->pdev->subsystem_vendor == 0x1043) && 390 - (dev->pdev->subsystem_device == 0x01e2)) { 387 + if ((pdev->device == 0x95C5) && 388 + (pdev->subsystem_vendor == 0x1043) && 389 + (pdev->subsystem_device == 0x01e2)) { 391 390 if (*connector_type == DRM_MODE_CONNECTOR_HDMIA) { 392 391 *connector_type = DRM_MODE_CONNECTOR_DVII; 393 392 } ··· 412 411 * with different crtcs which isn't possible on the hardware 413 412 * side and leaves no crtcs for LVDS or VGA. 414 413 */ 415 - if (((dev->pdev->device == 0x95c4) || (dev->pdev->device == 0x9591)) && 416 - (dev->pdev->subsystem_vendor == 0x1025) && 417 - (dev->pdev->subsystem_device == 0x013c)) { 414 + if (((pdev->device == 0x95c4) || (pdev->device == 0x9591)) && 415 + (pdev->subsystem_vendor == 0x1025) && 416 + (pdev->subsystem_device == 0x013c)) { 418 417 if ((*connector_type == DRM_MODE_CONNECTOR_DVII) && 419 418 (supported_device == ATOM_DEVICE_DFP1_SUPPORT)) { 420 419 /* actually it's a DVI-D port not DVI-I */ ··· 426 425 /* XFX Pine Group device rv730 reports no VGA DDC lines 427 426 * even though they are wired up to record 0x93 428 427 */ 429 - if ((dev->pdev->device == 0x9498) && 430 - (dev->pdev->subsystem_vendor == 0x1682) && 431 - (dev->pdev->subsystem_device == 0x2452) && 428 + if ((pdev->device == 0x9498) && 429 + (pdev->subsystem_vendor == 0x1682) && 430 + (pdev->subsystem_device == 0x2452) && 432 431 (i2c_bus->valid == false) && 433 432 !(supported_device & (ATOM_DEVICE_TV_SUPPORT | ATOM_DEVICE_CV_SUPPORT))) { 434 433 struct radeon_device *rdev = dev->dev_private; ··· 436 435 } 437 436 438 437 /* Fujitsu D3003-S2 board lists DVI-I as DVI-D and VGA */ 439 - if (((dev->pdev->device == 0x9802) || 440 - (dev->pdev->device == 0x9805) || 441 - (dev->pdev->device == 0x9806)) && 442 - (dev->pdev->subsystem_vendor == 0x1734) && 443 - (dev->pdev->subsystem_device == 0x11bd)) { 438 + if (((pdev->device == 0x9802) || 439 + (pdev->device == 0x9805) || 440 + (pdev->device == 0x9806)) && 441 + (pdev->subsystem_vendor == 0x1734) && 442 + (pdev->subsystem_device == 0x11bd)) { 444 443 if (*connector_type == DRM_MODE_CONNECTOR_VGA) { 445 444 *connector_type = DRM_MODE_CONNECTOR_DVII; 446 445 *line_mux = 0x3103;
+3 -3
drivers/gpu/drm/radeon/radeon_bios.c
··· 528 528 crtc_ext_cntl = RREG32(RADEON_CRTC_EXT_CNTL); 529 529 fp2_gen_cntl = 0; 530 530 531 - if (rdev->ddev->pdev->device == PCI_DEVICE_ID_ATI_RADEON_QY) { 531 + if (rdev->pdev->device == PCI_DEVICE_ID_ATI_RADEON_QY) { 532 532 fp2_gen_cntl = RREG32(RADEON_FP2_GEN_CNTL); 533 533 } 534 534 ··· 565 565 (RADEON_CRTC_SYNC_TRISTAT | 566 566 RADEON_CRTC_DISPLAY_DIS))); 567 567 568 - if (rdev->ddev->pdev->device == PCI_DEVICE_ID_ATI_RADEON_QY) { 568 + if (rdev->pdev->device == PCI_DEVICE_ID_ATI_RADEON_QY) { 569 569 WREG32(RADEON_FP2_GEN_CNTL, (fp2_gen_cntl & ~RADEON_FP2_ON)); 570 570 } 571 571 ··· 583 583 WREG32(RADEON_CRTC2_GEN_CNTL, crtc2_gen_cntl); 584 584 } 585 585 WREG32(RADEON_CRTC_EXT_CNTL, crtc_ext_cntl); 586 - if (rdev->ddev->pdev->device == PCI_DEVICE_ID_ATI_RADEON_QY) { 586 + if (rdev->pdev->device == PCI_DEVICE_ID_ATI_RADEON_QY) { 587 587 WREG32(RADEON_FP2_GEN_CNTL, fp2_gen_cntl); 588 588 } 589 589 return r;
+29 -26
drivers/gpu/drm/radeon/radeon_combios.c
··· 894 894 895 895 /* quirks */ 896 896 /* Radeon 7000 (RV100) */ 897 - if (((dev->pdev->device == 0x5159) && 898 - (dev->pdev->subsystem_vendor == 0x174B) && 899 - (dev->pdev->subsystem_device == 0x7c28)) || 897 + if (((rdev->pdev->device == 0x5159) && 898 + (rdev->pdev->subsystem_vendor == 0x174B) && 899 + (rdev->pdev->subsystem_device == 0x7c28)) || 900 900 /* Radeon 9100 (R200) */ 901 - ((dev->pdev->device == 0x514D) && 902 - (dev->pdev->subsystem_vendor == 0x174B) && 903 - (dev->pdev->subsystem_device == 0x7149))) { 901 + ((rdev->pdev->device == 0x514D) && 902 + (rdev->pdev->subsystem_vendor == 0x174B) && 903 + (rdev->pdev->subsystem_device == 0x7149))) { 904 904 /* vbios value is bad, use the default */ 905 905 found = 0; 906 906 } ··· 2221 2221 struct radeon_i2c_bus_rec *ddc_i2c, 2222 2222 struct radeon_hpd *hpd) 2223 2223 { 2224 + struct radeon_device *rdev = dev->dev_private; 2224 2225 2225 2226 /* Certain IBM chipset RN50s have a BIOS reporting two VGAs, 2226 2227 one with VGA DDC and one with CRT2 DDC. - kill the CRT2 DDC one */ 2227 - if (dev->pdev->device == 0x515e && 2228 - dev->pdev->subsystem_vendor == 0x1014) { 2228 + if (rdev->pdev->device == 0x515e && 2229 + rdev->pdev->subsystem_vendor == 0x1014) { 2229 2230 if (*legacy_connector == CONNECTOR_CRT_LEGACY && 2230 2231 ddc_i2c->mask_clk_reg == RADEON_GPIO_CRT2_DDC) 2231 2232 return false; 2232 2233 } 2233 2234 2234 2235 /* X300 card with extra non-existent DVI port */ 2235 - if (dev->pdev->device == 0x5B60 && 2236 - dev->pdev->subsystem_vendor == 0x17af && 2237 - dev->pdev->subsystem_device == 0x201e && bios_index == 2) { 2236 + if (rdev->pdev->device == 0x5B60 && 2237 + rdev->pdev->subsystem_vendor == 0x17af && 2238 + rdev->pdev->subsystem_device == 0x201e && bios_index == 2) { 2238 2239 if (*legacy_connector == CONNECTOR_DVI_I_LEGACY) 2239 2240 return false; 2240 2241 } ··· 2245 2244 2246 2245 static bool radeon_apply_legacy_tv_quirks(struct drm_device *dev) 2247 2246 { 2247 + struct radeon_device *rdev = dev->dev_private; 2248 + 2248 2249 /* Acer 5102 has non-existent TV port */ 2249 - if (dev->pdev->device == 0x5975 && 2250 - dev->pdev->subsystem_vendor == 0x1025 && 2251 - dev->pdev->subsystem_device == 0x009f) 2250 + if (rdev->pdev->device == 0x5975 && 2251 + rdev->pdev->subsystem_vendor == 0x1025 && 2252 + rdev->pdev->subsystem_device == 0x009f) 2252 2253 return false; 2253 2254 2254 2255 /* HP dc5750 has non-existent TV port */ 2255 - if (dev->pdev->device == 0x5974 && 2256 - dev->pdev->subsystem_vendor == 0x103c && 2257 - dev->pdev->subsystem_device == 0x280a) 2256 + if (rdev->pdev->device == 0x5974 && 2257 + rdev->pdev->subsystem_vendor == 0x103c && 2258 + rdev->pdev->subsystem_device == 0x280a) 2258 2259 return false; 2259 2260 2260 2261 /* MSI S270 has non-existent TV port */ 2261 - if (dev->pdev->device == 0x5955 && 2262 - dev->pdev->subsystem_vendor == 0x1462 && 2263 - dev->pdev->subsystem_device == 0x0131) 2262 + if (rdev->pdev->device == 0x5955 && 2263 + rdev->pdev->subsystem_vendor == 0x1462 && 2264 + rdev->pdev->subsystem_device == 0x0131) 2264 2265 return false; 2265 2266 2266 2267 return true; ··· 2416 2413 /* RV100 board with external TDMS bit mis-set. 2417 2414 * Actually uses internal TMDS, clear the bit. 2418 2415 */ 2419 - if (dev->pdev->device == 0x5159 && 2420 - dev->pdev->subsystem_vendor == 0x1014 && 2421 - dev->pdev->subsystem_device == 0x029A) { 2416 + if (rdev->pdev->device == 0x5159 && 2417 + rdev->pdev->subsystem_vendor == 0x1014 && 2418 + rdev->pdev->subsystem_device == 0x029A) { 2422 2419 tmp &= ~(1 << 4); 2423 2420 } 2424 2421 if ((tmp >> 4) & 0x1) { ··· 2710 2707 /* boards with a thermal chip, but no overdrive table */ 2711 2708 2712 2709 /* Asus 9600xt has an f75375 on the monid bus */ 2713 - if ((dev->pdev->device == 0x4152) && 2714 - (dev->pdev->subsystem_vendor == 0x1043) && 2715 - (dev->pdev->subsystem_device == 0xc002)) { 2710 + if ((rdev->pdev->device == 0x4152) && 2711 + (rdev->pdev->subsystem_vendor == 0x1043) && 2712 + (rdev->pdev->subsystem_device == 0xc002)) { 2716 2713 i2c_bus = combios_setup_i2c_bus(rdev, DDC_MONID, 0, 0); 2717 2714 rdev->pm.i2c_bus = radeon_i2c_lookup(rdev, &i2c_bus); 2718 2715 if (rdev->pm.i2c_bus) {
+1 -2
drivers/gpu/drm/radeon/radeon_cs.c
··· 130 130 * IGP chips to avoid image corruptions 131 131 */ 132 132 if (p->ring == R600_RING_TYPE_UVD_INDEX && 133 - (i <= 0 || pci_find_capability(p->rdev->ddev->pdev, 134 - PCI_CAP_ID_AGP) || 133 + (i <= 0 || pci_find_capability(p->rdev->pdev, PCI_CAP_ID_AGP) || 135 134 p->rdev->family == CHIP_RS780 || 136 135 p->rdev->family == CHIP_RS880)) { 137 136
+10 -7
drivers/gpu/drm/radeon/radeon_device.c
··· 1562 1562 bool fbcon, bool freeze) 1563 1563 { 1564 1564 struct radeon_device *rdev; 1565 + struct pci_dev *pdev; 1565 1566 struct drm_crtc *crtc; 1566 1567 struct drm_connector *connector; 1567 1568 int i, r; ··· 1572 1571 } 1573 1572 1574 1573 rdev = dev->dev_private; 1574 + pdev = to_pci_dev(dev->dev); 1575 1575 1576 1576 if (dev->switch_power_state == DRM_SWITCH_POWER_OFF) 1577 1577 return 0; ··· 1638 1636 1639 1637 radeon_agp_suspend(rdev); 1640 1638 1641 - pci_save_state(dev->pdev); 1639 + pci_save_state(pdev); 1642 1640 if (freeze && rdev->family >= CHIP_CEDAR && !(rdev->flags & RADEON_IS_IGP)) { 1643 1641 rdev->asic->asic_reset(rdev, true); 1644 - pci_restore_state(dev->pdev); 1642 + pci_restore_state(pdev); 1645 1643 } else if (suspend) { 1646 1644 /* Shut down the device */ 1647 - pci_disable_device(dev->pdev); 1648 - pci_set_power_state(dev->pdev, PCI_D3hot); 1645 + pci_disable_device(pdev); 1646 + pci_set_power_state(pdev, PCI_D3hot); 1649 1647 } 1650 1648 1651 1649 if (fbcon) { ··· 1667 1665 { 1668 1666 struct drm_connector *connector; 1669 1667 struct radeon_device *rdev = dev->dev_private; 1668 + struct pci_dev *pdev = to_pci_dev(dev->dev); 1670 1669 struct drm_crtc *crtc; 1671 1670 int r; 1672 1671 ··· 1678 1675 console_lock(); 1679 1676 } 1680 1677 if (resume) { 1681 - pci_set_power_state(dev->pdev, PCI_D0); 1682 - pci_restore_state(dev->pdev); 1683 - if (pci_enable_device(dev->pdev)) { 1678 + pci_set_power_state(pdev, PCI_D0); 1679 + pci_restore_state(pdev); 1680 + if (pci_enable_device(pdev)) { 1684 1681 if (fbcon) 1685 1682 console_unlock(); 1686 1683 return -1;
+1 -1
drivers/gpu/drm/radeon/radeon_display.c
··· 1317 1317 1318 1318 obj = drm_gem_object_lookup(file_priv, mode_cmd->handles[0]); 1319 1319 if (obj == NULL) { 1320 - dev_err(&dev->pdev->dev, "No GEM object associated to handle 0x%08X, " 1320 + dev_err(dev->dev, "No GEM object associated to handle 0x%08X, " 1321 1321 "can't create framebuffer\n", mode_cmd->handles[0]); 1322 1322 return ERR_PTR(-ENOENT); 1323 1323 }
+1 -2
drivers/gpu/drm/radeon/radeon_drv.c
··· 342 342 if (ret) 343 343 goto err_free; 344 344 345 - dev->pdev = pdev; 346 345 #ifdef __alpha__ 347 346 dev->hose = pdev->sysdata; 348 347 #endif 349 348 350 349 pci_set_drvdata(pdev, dev); 351 350 352 - if (pci_find_capability(dev->pdev, PCI_CAP_ID_AGP)) 351 + if (pci_find_capability(pdev, PCI_CAP_ID_AGP)) 353 352 dev->agp = drm_agp_init(dev); 354 353 if (dev->agp) { 355 354 dev->agp->agp_mtrr = arch_phys_wc_add(
+1 -1
drivers/gpu/drm/radeon/radeon_fb.c
··· 290 290 DRM_INFO("fb depth is %d\n", fb->format->depth); 291 291 DRM_INFO(" pitch is %d\n", fb->pitches[0]); 292 292 293 - vga_switcheroo_client_fb_set(rdev->ddev->pdev, info); 293 + vga_switcheroo_client_fb_set(rdev->pdev, info); 294 294 return 0; 295 295 296 296 out:
+3 -3
drivers/gpu/drm/radeon/radeon_gem.c
··· 651 651 } 652 652 653 653 if (args->offset < RADEON_VA_RESERVED_SIZE) { 654 - dev_err(&dev->pdev->dev, 654 + dev_err(dev->dev, 655 655 "offset 0x%lX is in reserved area 0x%X\n", 656 656 (unsigned long)args->offset, 657 657 RADEON_VA_RESERVED_SIZE); ··· 665 665 */ 666 666 invalid_flags = RADEON_VM_PAGE_VALID | RADEON_VM_PAGE_SYSTEM; 667 667 if ((args->flags & invalid_flags)) { 668 - dev_err(&dev->pdev->dev, "invalid flags 0x%08X vs 0x%08X\n", 668 + dev_err(dev->dev, "invalid flags 0x%08X vs 0x%08X\n", 669 669 args->flags, invalid_flags); 670 670 args->operation = RADEON_VA_RESULT_ERROR; 671 671 return -EINVAL; ··· 676 676 case RADEON_VA_UNMAP: 677 677 break; 678 678 default: 679 - dev_err(&dev->pdev->dev, "unsupported operation %d\n", 679 + dev_err(dev->dev, "unsupported operation %d\n", 680 680 args->operation); 681 681 args->operation = RADEON_VA_RESULT_ERROR; 682 682 return -EINVAL;
+1 -1
drivers/gpu/drm/radeon/radeon_i2c.c
··· 919 919 i2c->rec = *rec; 920 920 i2c->adapter.owner = THIS_MODULE; 921 921 i2c->adapter.class = I2C_CLASS_DDC; 922 - i2c->adapter.dev.parent = &dev->pdev->dev; 922 + i2c->adapter.dev.parent = dev->dev; 923 923 i2c->dev = dev; 924 924 i2c_set_adapdata(&i2c->adapter, i2c); 925 925 mutex_init(&i2c->mutex);
+1 -1
drivers/gpu/drm/radeon/radeon_irq_kms.c
··· 314 314 INIT_WORK(&rdev->audio_work, r600_audio_update_hdmi); 315 315 316 316 rdev->irq.installed = true; 317 - r = drm_irq_install(rdev->ddev, rdev->ddev->pdev->irq); 317 + r = drm_irq_install(rdev->ddev, rdev->pdev->irq); 318 318 if (r) { 319 319 rdev->irq.installed = false; 320 320 flush_delayed_work(&rdev->hotplug_work);
+9 -9
drivers/gpu/drm/radeon/radeon_kms.c
··· 105 105 */ 106 106 int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags) 107 107 { 108 + struct pci_dev *pdev = to_pci_dev(dev->dev); 108 109 struct radeon_device *rdev; 109 110 int r, acpi_status; 110 111 ··· 116 115 dev->dev_private = (void *)rdev; 117 116 118 117 /* update BUS flag */ 119 - if (pci_find_capability(dev->pdev, PCI_CAP_ID_AGP)) { 118 + if (pci_find_capability(pdev, PCI_CAP_ID_AGP)) { 120 119 flags |= RADEON_IS_AGP; 121 - } else if (pci_is_pcie(dev->pdev)) { 120 + } else if (pci_is_pcie(pdev)) { 122 121 flags |= RADEON_IS_PCIE; 123 122 } else { 124 123 flags |= RADEON_IS_PCI; ··· 127 126 if ((radeon_runtime_pm != 0) && 128 127 radeon_has_atpx() && 129 128 ((flags & RADEON_IS_IGP) == 0) && 130 - !pci_is_thunderbolt_attached(dev->pdev)) 129 + !pci_is_thunderbolt_attached(pdev)) 131 130 flags |= RADEON_IS_PX; 132 131 133 132 /* radeon_device_init should report only fatal error ··· 136 135 * properly initialize the GPU MC controller and permit 137 136 * VRAM allocation 138 137 */ 139 - r = radeon_device_init(rdev, dev, dev->pdev, flags); 138 + r = radeon_device_init(rdev, dev, pdev, flags); 140 139 if (r) { 141 - dev_err(&dev->pdev->dev, "Fatal error during GPU init\n"); 140 + dev_err(dev->dev, "Fatal error during GPU init\n"); 142 141 goto out; 143 142 } 144 143 ··· 148 147 */ 149 148 r = radeon_modeset_init(rdev); 150 149 if (r) 151 - dev_err(&dev->pdev->dev, "Fatal error during modeset init\n"); 150 + dev_err(dev->dev, "Fatal error during modeset init\n"); 152 151 153 152 /* Call ACPI methods: require modeset init 154 153 * but failure is not fatal ··· 156 155 if (!r) { 157 156 acpi_status = radeon_acpi_init(rdev); 158 157 if (acpi_status) 159 - dev_dbg(&dev->pdev->dev, 160 - "Error during ACPI methods call\n"); 158 + dev_dbg(dev->dev, "Error during ACPI methods call\n"); 161 159 } 162 160 163 161 if (radeon_is_px(dev)) { ··· 239 239 240 240 switch (info->request) { 241 241 case RADEON_INFO_DEVICE_ID: 242 - *value = dev->pdev->device; 242 + *value = to_pci_dev(dev->dev)->device; 243 243 break; 244 244 case RADEON_INFO_NUM_GB_PIPES: 245 245 *value = rdev->num_gb_pipes;
+3 -3
drivers/gpu/drm/radeon/radeon_legacy_encoders.c
··· 974 974 975 975 /* XXX: these are oem specific */ 976 976 if (ASIC_IS_R300(rdev)) { 977 - if ((dev->pdev->device == 0x4850) && 978 - (dev->pdev->subsystem_vendor == 0x1028) && 979 - (dev->pdev->subsystem_device == 0x2001)) /* Dell Inspiron 8600 */ 977 + if ((rdev->pdev->device == 0x4850) && 978 + (rdev->pdev->subsystem_vendor == 0x1028) && 979 + (rdev->pdev->subsystem_device == 0x2001)) /* Dell Inspiron 8600 */ 980 980 fp2_gen_cntl |= R300_FP2_DVO_CLOCK_MODE_SINGLE; 981 981 else 982 982 fp2_gen_cntl |= RADEON_FP2_PAD_FLOP_EN | R300_FP2_DVO_CLOCK_MODE_SINGLE;
+3 -4
drivers/gpu/drm/radeon/rs780_dpm.c
··· 223 223 static void rs780_voltage_scaling_init(struct radeon_device *rdev) 224 224 { 225 225 struct igp_power_info *pi = rs780_get_pi(rdev); 226 - struct drm_device *dev = rdev->ddev; 227 226 u32 fv_throt_pwm_fb_div_range[3]; 228 227 u32 fv_throt_pwm_range[4]; 229 228 230 - if (dev->pdev->device == 0x9614) { 229 + if (rdev->pdev->device == 0x9614) { 231 230 fv_throt_pwm_fb_div_range[0] = RS780D_FVTHROTPWMFBDIVRANGEREG0_DFLT; 232 231 fv_throt_pwm_fb_div_range[1] = RS780D_FVTHROTPWMFBDIVRANGEREG1_DFLT; 233 232 fv_throt_pwm_fb_div_range[2] = RS780D_FVTHROTPWMFBDIVRANGEREG2_DFLT; 234 - } else if ((dev->pdev->device == 0x9714) || 235 - (dev->pdev->device == 0x9715)) { 233 + } else if ((rdev->pdev->device == 0x9714) || 234 + (rdev->pdev->device == 0x9715)) { 236 235 fv_throt_pwm_fb_div_range[0] = RS880D_FVTHROTPWMFBDIVRANGEREG0_DFLT; 237 236 fv_throt_pwm_fb_div_range[1] = RS880D_FVTHROTPWMFBDIVRANGEREG1_DFLT; 238 237 fv_throt_pwm_fb_div_range[2] = RS880D_FVTHROTPWMFBDIVRANGEREG2_DFLT;