Message ID | 20210721175526.22020-3-sean@poorly.run (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | drm/trace: Mirror DRM debug logs to tracefs | expand |
hi Sean, one little niggle here. On Wed, Jul 21, 2021 at 1:55 PM Sean Paul <sean@poorly.run> wrote: > > From: Sean Paul <seanpaul@chromium.org> > > Use the drm debug helper instead of dev_printk in order to leverage the > upcoming tracefs support > > Signed-off-by: Sean Paul <seanpaul@chromium.org> > Link: https://patchwork.freedesktop.org/patch/msgid/20200608210505.48519-3-sean@poorly.run #v5 > > Changes in v5: > -Added to the set > Changes in v6: > -None > --- > drivers/gpu/drm/i2c/sil164_drv.c | 12 ++++-------- > 1 file changed, 4 insertions(+), 8 deletions(-) > > diff --git a/drivers/gpu/drm/i2c/sil164_drv.c b/drivers/gpu/drm/i2c/sil164_drv.c > index 741886b54419..b315a789fca2 100644 > --- a/drivers/gpu/drm/i2c/sil164_drv.c > +++ b/drivers/gpu/drm/i2c/sil164_drv.c > @@ -43,11 +43,6 @@ struct sil164_priv { > #define to_sil164_priv(x) \ > ((struct sil164_priv *)to_encoder_slave(x)->slave_priv) > > -#define sil164_dbg(client, format, ...) do { \ > - if (drm_debug_enabled(DRM_UT_KMS)) \ > - dev_printk(KERN_DEBUG, &client->dev, \ > - "%s: " format, __func__, ## __VA_ARGS__); \ > - } while (0) > #define sil164_info(client, format, ...) \ > dev_info(&client->dev, format, __VA_ARGS__) > #define sil164_err(client, format, ...) \ > @@ -359,8 +354,8 @@ sil164_probe(struct i2c_client *client, const struct i2c_device_id *id) > int rev = sil164_read(client, SIL164_REVISION); > > if (vendor != 0x1 || device != 0x6) { > - sil164_dbg(client, "Unknown device %x:%x.%x\n", > - vendor, device, rev); > + drm_dev_dbg(&client->dev, DRM_UT_KMS, > + "Unknown device %x:%x.%x\n", vendor, device, rev); we have a macro for that :-) #define drm_dbg_kms(drm, fmt, ...) \ - drm_dev_dbg((drm) ? (drm)->dev : NULL, DRM_UT_KMS, fmt, ##__VA_ARGS__) + drm_dev_dbg((drm) ? (drm)->dev : NULL, DRM_DBG_CLASS_KMS, fmt, ##__VA_ARGS__) and again below.
diff --git a/drivers/gpu/drm/i2c/sil164_drv.c b/drivers/gpu/drm/i2c/sil164_drv.c index 741886b54419..b315a789fca2 100644 --- a/drivers/gpu/drm/i2c/sil164_drv.c +++ b/drivers/gpu/drm/i2c/sil164_drv.c @@ -43,11 +43,6 @@ struct sil164_priv { #define to_sil164_priv(x) \ ((struct sil164_priv *)to_encoder_slave(x)->slave_priv) -#define sil164_dbg(client, format, ...) do { \ - if (drm_debug_enabled(DRM_UT_KMS)) \ - dev_printk(KERN_DEBUG, &client->dev, \ - "%s: " format, __func__, ## __VA_ARGS__); \ - } while (0) #define sil164_info(client, format, ...) \ dev_info(&client->dev, format, __VA_ARGS__) #define sil164_err(client, format, ...) \ @@ -359,8 +354,8 @@ sil164_probe(struct i2c_client *client, const struct i2c_device_id *id) int rev = sil164_read(client, SIL164_REVISION); if (vendor != 0x1 || device != 0x6) { - sil164_dbg(client, "Unknown device %x:%x.%x\n", - vendor, device, rev); + drm_dev_dbg(&client->dev, DRM_UT_KMS, + "Unknown device %x:%x.%x\n", vendor, device, rev); return -ENODEV; } @@ -389,7 +384,8 @@ sil164_detect_slave(struct i2c_client *client) }; if (i2c_transfer(adap, &msg, 1) != 1) { - sil164_dbg(adap, "No dual-link slave found."); + drm_dev_dbg(&adap->dev, DRM_UT_KMS, + "No dual-link slave found."); return NULL; }