From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 999E17A for ; Sat, 23 Apr 2022 05:51:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1D009C385A5; Sat, 23 Apr 2022 05:51:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650693092; bh=5TfSzoM0+C34kFA270DcwrDwiICarNl9PErqjvsvgTo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=U89bcblhhca3nsvoaUke0u7d+3p0CiHD/UB3cZssf5WCzDou/ql9fPVJa83D0hFoD qu/IfndpWM8t7fcUzTlixos3bHPGKS4xEdiX2CkhIbCEoup8prGtUy7K43D5Pyaq5U wy0E5VQEV2yFpmX8GkqTJTmnKhRZ4nfH06s45e6A= Date: Sat, 23 Apr 2022 07:51:27 +0200 From: Greg KH To: Ian Cowan Cc: Dan Carpenter , clabbe@baylibre.com, mchehab@kernel.org, mjpeg-users@lists.sourceforge.net, linux-media@vger.kernel.org, linux-staging@lists.linux.dev Subject: Re: [PATCH] media: staging: zoran: refactor printk debugging function Message-ID: References: <20220421002316.873109-1-ian@linux.cowan.aero> <20220421142153.GA2462@kadam> <20220421155203.GB2462@kadam> Precedence: bulk X-Mailing-List: linux-staging@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Sat, Apr 23, 2022 at 01:23:31AM -0400, Ian Cowan wrote: > 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. Looks good, nice work!