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

drm/radeon: add helper rdev_to_drm(rdev)

Add helper rdev_to_drm(rdev), similar to amdgpu, most function should
access the "drm_device" with "rdev_to_drm(rdev)" instead, where amdgpu has
"adev_to_drm(adev)". It also makes changing from "*drm_device" to "drm_device"
in "radeon_devicce" later on easier.

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Tested-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Wu Hoi Pok <wuhoipok@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Wu Hoi Pok and committed by
Alex Deucher
a6e23bec 78dd6a8d

+5
+5
drivers/gpu/drm/radeon/radeon.h
··· 2476 2476 u32 cik_mm_rdoorbell(struct radeon_device *rdev, u32 index); 2477 2477 void cik_mm_wdoorbell(struct radeon_device *rdev, u32 index, u32 v); 2478 2478 2479 + static inline struct drm_device *rdev_to_drm(struct radeon_device *rdev) 2480 + { 2481 + return rdev->ddev; 2482 + } 2483 + 2479 2484 /* 2480 2485 * Cast helper 2481 2486 */