Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752556AbdLFOkt (ORCPT ); Wed, 6 Dec 2017 09:40:49 -0500 Received: from metis.ext.4.pengutronix.de ([92.198.50.35]:38181 "EHLO metis.ext.4.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752524AbdLFOkq (ORCPT ); Wed, 6 Dec 2017 09:40:46 -0500 Date: Wed, 6 Dec 2017 15:40:35 +0100 From: Sascha Hauer To: Patrick =?iso-8859-15?Q?Br=FCnn?= Cc: linux-kernel-dev , Shawn Guo , Sascha Hauer , Alessandro Zummo , Alexandre Belloni , Mark Rutland , "open list:REAL TIME CLOCK (RTC) SUBSYSTEM" , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Juergen Borleis , open list , Russell King , Noel Vellemans , Rob Herring , Philippe Ombredanne , Fabio Estevam , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , Lothar =?iso-8859-15?Q?Wa=DFmann?= Subject: Re: [PATCH v2 5/5] rtc: add mxc driver for i.MX53 SRTC Message-ID: <20171206144035.5brxvavkx2u2tk23@pengutronix.de> References: <20171205140646.30367-1-linux-kernel-dev@beckhoff.com> <20171205140646.30367-6-linux-kernel-dev@beckhoff.com> <20171206083618.eea63zqmpgaaazwl@pengutronix.de> <3BB206AB2B1BD448954845CE6FF69A8E01CB531D9C@NT-Mail07.beckhoff.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3BB206AB2B1BD448954845CE6FF69A8E01CB531D9C@NT-Mail07.beckhoff.com> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 15:29:03 up 30 days, 20:27, 44 users, load average: 0.04, 0.16, 0.24 User-Agent: Mutt/1.6.2-neo (2016-06-11) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1610 Lines: 36 On Wed, Dec 06, 2017 at 10:17:06AM +0000, Patrick Br?nn wrote: > >From: Sascha Hauer [mailto:s.hauer@pengutronix.de] > >Sent: Mittwoch, 6. Dezember 2017 09:36 > >On Tue, Dec 05, 2017 at 03:06:46PM +0100, linux-kernel-dev@beckhoff.com > >wrote: > >> +static int mxc_rtc_wait_for_flag(void *__iomem ioaddr, int flag) > >> +{ > >> + unsigned int timeout = REG_READ_TIMEOUT; > >> + > >> + while (!(readl(ioaddr) & flag)) { > >> + if (!--timeout) { > >> + pr_err("Wait timeout for 0x%x@%p!\n", flag, ioaddr); > > > >Please use dev_* functions for printing. In this case the message should > >probably be printed from the caller. > Do you have a link at hand about dev_* vs. pr_*? I just choose pr_err here, > because I would have to change the functions signature to get a device. > However, I will drop the message and move it to the caller. No, I don't have a link. However, a message printed with pr_err comes with absolutely no context, so without grepping the source you do not get a clue which device has a problem. You could add more context using some prefix either to each message or by using #define pr_fmt(fmt) "mydriver: " fmt but then you still not know which instance the message throws. Using dev_* just does the right thing without much thinking. Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |