[PATCH] drm: Replace DRM_INFO() with pr_info()

Thomas Zimmermann tzimmermann at suse.de
Mon Dec 19 16:15:00 UTC 2022


Hi

Am 19.12.22 um 16:34 schrieb Siddh Raman Pant:
> On Mon, 19 Dec 2022 20:27:45 +0530, Thomas Zimmermann wrote:
>> Hi
>>
>> Am 19.12.22 um 15:23 schrieb Siddh Raman Pant:
>>> Line 536 of drm_print.h says DRM_INFO() is deprecated
>>> in favor of pr_info().
>>
>> That's a misleading comment. DRM_INFO() is deprecated for drm_info().
>> pr_info() et al is only to be used of you don't have a dev pointer.
>>
>> Best regards
>> Thomas
> 
> Maybe you are confusing it with DRM_DEV_INFO? It takes the dev pointer,
> and is indeed told to be deprecated in favour of drm_info() in the
> comments (see line 394).
> 
> DRM_INFO is a separate macro for printing stuff, and does not take the
> dev pointer. They seem to be early wrappers for printk, I guess when
> pr_info did not exist. And all they do different from pr_info is to add
> DRM_NAME (which seems to be just "drm") in front of the string.

The DRM_ print macros in capital letters are deprecated AFAIK. In cases 
where a dev pointer is available, using drm_info() et al. is preferred 
over pr_info().

In the context of your patch, you should use drm_info() in 
drm_client_target_cloned(), as is gets a dev pointer as its first 
argument. In most the other cases from your patch, you can get the dev 
pointer from connector->dev.

The final case, drm_legacy_pci_exit(), there's no dev pointer, so you 
can use pr_info() there. I'd remove '[drm]' from the string. We don't 
use this much elsewhere.

Best regards
Thomas

> 
> Thanks,
> Siddh

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20221219/da5029a3/attachment.sig>


More information about the dri-devel mailing list