[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZBRtCwtmFsQQ+Oo0@matsya>
Date: Fri, 17 Mar 2023 19:07:15 +0530
From: Vinod Koul <vkoul@...nel.org>
To: Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>
Cc: Bard Liao <yung-chuan.liao@...ux.intel.com>,
alsa-devel@...a-project.org, linux-kernel@...r.kernel.org,
bard.liao@...el.com
Subject: Re: [PATCH] soundwire: stream: uniquify dev_err() logs
On 15-03-23, 09:38, Pierre-Louis Bossart wrote:
>
>
> On 3/15/23 05:09, Vinod Koul wrote:
> > On 09-03-23, 13:49, Bard Liao wrote:
> >> From: Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>
> >>
> >> There are a couple of duplicate logs which makes harder than needed to
> >> follow the error flows. Add __func__ or make the log unique.
> >>
> >> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>
> >> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@...ux.intel.com>
> >> Signed-off-by: Bard Liao <yung-chuan.liao@...ux.intel.com>
> >> ---
> >> drivers/soundwire/stream.c | 18 ++++++++++--------
> >> 1 file changed, 10 insertions(+), 8 deletions(-)
> >>
> >> diff --git a/drivers/soundwire/stream.c b/drivers/soundwire/stream.c
> >> index 2e39587ed1de..dd09855caac9 100644
> >> --- a/drivers/soundwire/stream.c
> >> +++ b/drivers/soundwire/stream.c
> >> @@ -1389,7 +1389,7 @@ static int _sdw_prepare_stream(struct sdw_stream_runtime *stream,
> >>
> >> ret = do_bank_switch(stream);
> >> if (ret < 0) {
> >> - dev_err(bus->dev, "Bank switch failed: %d\n", ret);
> >> + pr_err("%s: do_bank_switch failed: %d\n", __func__, ret);
> >
> > why make it pr_ and loose the dev name? There is a trick to emit
> > function for dev_err too using dynamic debug
>
> a stream can be cased on multiple managers/buses.
>
> It's incorrect to use bus->dev in this case, see all other error cases
> in stream.c, they all use pr_err already for the same reason. bus->dev
> is only valid when dealing with a single bus, typically in loops in that
> file.
>
> That said we could have split the two changes where dev_err() is changed
> as pr_err() for clarity.
Thanks, that would be better way
--
~Vinod
Powered by blists - more mailing lists