mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: "Patrick Brünn" <P.Bruenn@beckhoff.com>
Cc: linux-kernel-dev <linux-kernel-dev@beckhoff.com>,
	"Shawn Guo" <shawnguo@kernel.org>,
	"Sascha Hauer" <kernel@pengutronix.de>,
	"Alessandro Zummo" <a.zummo@towertech.it>,
	"Alexandre Belloni" <alexandre.belloni@free-electrons.com>,
	"Mark Rutland" <mark.rutland@arm.com>,
	"open list:REAL TIME CLOCK (RTC) SUBSYSTEM"
	<linux-rtc@vger.kernel.org>,
	"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
	<devicetree@vger.kernel.org>,
	"Juergen Borleis" <jbe@pengutronix.de>,
	"open list" <linux-kernel@vger.kernel.org>,
	"Russell King" <linux@armlinux.org.uk>,
	"Noel Vellemans" <Noel.Vellemans@visionbms.com>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Philippe Ombredanne" <pombredanne@nexb.com>,
	"Fabio Estevam" <fabio.estevam@nxp.com>,
	"moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE"
	<linux-arm-kernel@lists.infradead.org>,
	"Lothar Waßmann" <LW@KARO-electronics.de>
Subject: Re: [PATCH v2 5/5] rtc: add mxc driver for i.MX53 SRTC
Date: Wed, 6 Dec 2017 15:40:35 +0100	[thread overview]
Message-ID: <20171206144035.5brxvavkx2u2tk23@pengutronix.de> (raw)
In-Reply-To: <3BB206AB2B1BD448954845CE6FF69A8E01CB531D9C@NT-Mail07.beckhoff.com>

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 |

  reply	other threads:[~2017-12-06 14:40 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-05 14:06 [PATCH v2 0/5] " linux-kernel-dev
2017-12-05 14:06 ` [PATCH v2 1/5] dt-bindings: rtc: add bindings " linux-kernel-dev
2017-12-06 21:54   ` Rob Herring
2017-12-11  7:08     ` Patrick Brünn
2017-12-11 23:08       ` Fabio Estevam
2017-12-12  5:05         ` Patrick Brünn
2017-12-15 21:58       ` Rob Herring
2017-12-05 14:06 ` [PATCH v2 2/5] ARM: dts: imx53: add srtc node linux-kernel-dev
2017-12-05 14:13   ` Fabio Estevam
2017-12-05 14:20     ` Patrick Brünn
2017-12-10 19:03       ` Fabio Estevam
2017-12-05 14:06 ` [PATCH v2 3/5] rtc: mxc_v2: add driver for i.MX53 SRTC linux-kernel-dev
2017-12-05 14:12   ` Fabio Estevam
2017-12-05 14:06 ` [PATCH v2 4/5] ARM: imx_v4_v5_defconfig: enable RTC_DRV_MXC_V2 linux-kernel-dev
2017-12-05 14:10   ` Fabio Estevam
2017-12-05 14:06 ` [PATCH v2 5/5] rtc: add mxc driver for i.MX53 SRTC linux-kernel-dev
2017-12-06  8:36   ` Sascha Hauer
2017-12-06  8:58     ` Alexandre Belloni
2017-12-06  9:28       ` Patrick Brünn
2017-12-06 10:17     ` Patrick Brünn
2017-12-06 14:40       ` Sascha Hauer [this message]
2017-12-06 11:05   ` Alexandre Belloni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171206144035.5brxvavkx2u2tk23@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=LW@KARO-electronics.de \
    --cc=Noel.Vellemans@visionbms.com \
    --cc=P.Bruenn@beckhoff.com \
    --cc=a.zummo@towertech.it \
    --cc=alexandre.belloni@free-electrons.com \
    --cc=devicetree@vger.kernel.org \
    --cc=fabio.estevam@nxp.com \
    --cc=jbe@pengutronix.de \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel-dev@beckhoff.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=mark.rutland@arm.com \
    --cc=pombredanne@nexb.com \
    --cc=robh+dt@kernel.org \
    --cc=shawnguo@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®