[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <02699364973B424C83A42A84B04FDA8548B8E7@JPYOKXMS113.jp.sony.com>
Date: Fri, 6 Apr 2018 00:28:46 +0000
From: <Yasunari.Takiguchi@...y.com>
To: <mchehab@...pensource.com>
CC: <linux-kernel@...r.kernel.org>, <devicetree@...r.kernel.org>,
<linux-media@...r.kernel.org>, <tbird20d@...il.com>,
<frowand.list@...il.com>, <Masayuki.Yamamoto@...y.com>,
<Hideki.Nozawa@...y.com>, <Kota.Yonezawa@...y.com>,
<Toshihiko.Matsumoto@...y.com>, <Satoshi.C.Watanabe@...y.com>,
<Yasunari.Takiguchi@...y.com>
Subject: RE: [PATCH v5 02/12] [media] cxd2880-spi: Add support for CXD2880
SPI interface
Hi, Mauro
> > + u8 send_data[BURST_WRITE_MAX + 4];
> > + const u8 *write_data_top = NULL;
> > + int ret = 0;
> > +
> > + if (!spi || !data) {
> > + pr_err("invalid arg\n");
> > + return -EINVAL;
> > + }
> > + if (size > BURST_WRITE_MAX) {
> > + pr_err("data size > WRITE_MAX\n");
> > + return -EINVAL;
> > + }
> > +
> > + if (sub_address + size > 0x100) {
> > + pr_err("out of range\n");
> > + return -EINVAL;
> > + }
>
> It is better to use dev_err(spi->dev, ...) instead of pr_err().
I got comment for this previous version patch as below
--------------------------------------------------------------------------------------
The best would be to se dev_err() & friends for printing messages, as they print the device's name as filled at struct device.
If you don't use, please add a define that will print the name at the logs, like:
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
either at the begining of the driver or at some header file.
Btw, I'm noticing that you're also using dev_err() on other places of the code.
Please standardize. OK, on a few places, you may still need to use pr_err(), if you need to print a message before initializing struct device, but I suspect that you can init
--------------------------------------------------------------------------------------
You pointed out here before. Because dev_foo () and pr_foo () were mixed.
We standardize with pr_foo() because the logs is outputted before getting the device structure.
Is it better to use dev_foo() where we can use it?
Takiguchi
Powered by blists - more mailing lists