Re: [PATCH] media: staging: zoran: refactor printk debugging function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Apr 22, 2022 at 07:10:34AM +0200, Greg KH wrote:
> On Thu, Apr 21, 2022 at 08:30:25PM -0400, Ian Cowan wrote:
> > On Thu, Apr 21, 2022 at 06:52:04PM +0300, Dan Carpenter wrote:
> > > On Thu, Apr 21, 2022 at 11:22:00AM -0400, Ian Cowan wrote:
> > > > 
> > > > For using the dev_dbg() macro, do you define this in the header file
> > > > (i.e. for this it would be videocodec.h), or where should this be
> > > > included from?
> > > 
> > > dev_dbg() is defined in include/linux/dev_printk.h.  Look around at how
> > > it's used.  pr_debug() might be an option, but I don't know if we will
> > > accept that, we prefer dev_dbg().
> > > 
> > > regards,
> > > dan carpenter
> > > 
> > 
> > I'm about to submit the modified patch, but I went and looked and we
> > cannot use dev_dbg() because these specific drivers do not have any
> > association with a device struct.
> 
> Then please fix that issue, as there is a real struct device that they
> are using somewhere.  That is the correct solution as drivers should
> never use pr_* calls directly.
> 
> thanks,
> 
> greg k-h
> 

I just resubmitted and this time used dev_dbg() (I split the resubmitted
patch into 4 parts that will work if they are applied in order). There
were a few places that pr_debug() had to be used (or it can be changed
back to dprintk()) because they are cleanup functions and do not have
any devices available at the cleanup. If there is a better way to handle
that, I will go back and make a modification to that. Other than those 3
spots, dev_dbg() is being used.

---
Ian Cowan



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux