On Thu, 23 Jan 2025, Jani Nikula <jani.nikula@xxxxxxxxxxxxxxx> wrote: > On Thu, 23 Jan 2025, Damon Ding <damon.ding@xxxxxxxxxxxxxx> wrote: >> According to the comments in include/drm/drm_print.h, the DRM_...() >> functions are deprecated in favor of drm_...() or dev_...() functions. >> >> Use drm_err()/drm_dbg_core()/drm_dbg_kms() instead of >> DRM_DEV_ERROR()/DRM_ERROR()/DRM_DEV_DEBUG()/DRM_DEBUG_KMS(). >> >> Signed-off-by: Damon Ding <damon.ding@xxxxxxxxxxxxxx> >> >> --- >> >> Changes in v6: >> - Use drm_...() uniformly rather than mixing drm_...() and dev_..() >> - Pass 'dp' in drm_...() rather than 'dp->drm_dev' >> --- >> .../gpu/drm/rockchip/analogix_dp-rockchip.c | 29 ++++++++++--------- >> 1 file changed, 15 insertions(+), 14 deletions(-) >> >> diff --git a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c >> index 0844175c37c5..dd33d7540e4b 100644 >> --- a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c >> +++ b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c >> @@ -100,13 +100,13 @@ static int rockchip_dp_poweron(struct analogix_dp_plat_data *plat_data) >> >> ret = clk_prepare_enable(dp->pclk); >> if (ret < 0) { >> - DRM_DEV_ERROR(dp->dev, "failed to enable pclk %d\n", ret); >> + drm_err(dp, "failed to enable pclk %d\n", ret); > > Please don't do this. > > You're supposed to pass struct drm_device to drm_err() and friends. Not > some random struct pointer that just happens to have a ->dev member. > > The drm_* macros may change at any time to actually expect the correct > type. And with [1] I'm hoping "at any time" becomes "real soon now". BR, Jani. [1] https://lore.kernel.org/all/cover.1737644530.git.jani.nikula@xxxxxxxxx -- Jani Nikula, Intel