Linux PCI subsystem development
 help / color / mirror / Atom feed
From: Javier Carrasco <javier.carrasco.cruz@gmail.com>
To: "Krzysztof Wilczyński" <kw@linux.com>
Cc: Xiaowei Song <songxiaowei@hisilicon.com>,
	Binghui Wang <wangbinghui@hisilicon.com>,
	Lorenzo Pieralisi <lpieralisi@kernel.org>,
	Rob Herring <robh@kernel.org>,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	Bjorn Helgaas <bhelgaas@google.com>,
	linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] PCI: kirin: use dev_err_probe() in probe error paths
Date: Sun, 7 Jul 2024 14:19:48 +0200	[thread overview]
Message-ID: <0608fa9e-9ada-43a6-888d-fab6ed06bfb8@gmail.com> (raw)
In-Reply-To: <20240707065358.GA3809216@rocinante>

On 07/07/2024 08:53, Krzysztof Wilczyński wrote:
> Hello,
> 
> [...]
>> Use dev_err_probe() in all error paths with that construction.
> 
> Thank you for this nice refactoring!  Much appreciated.
> 
> [...]
>> -	if (ret > MAX_PCI_SLOTS) {
>> -		dev_err(dev, "Too many GPIO clock requests!\n");
>> -		return -EINVAL;
>> -	}
>> +	if (ret > MAX_PCI_SLOTS)
>> +		return dev_err_probe(dev, -EINVAL,
>> +				     "Too many GPIO clock requests!\n");
> 
> Something that would be nice to get consistent: adjust all the errors
> capitalisation to make everything consistent, as appropriate, so that it's
> either all lower-case or title case.  A mix of both often looks a bit
> sloppy.
> 
> Do you think this would be something you would be willing to clean up in
> this series too?  Especially since we are touching this code now.
> 
>> -	if (!dev->of_node) {
>> -		dev_err(dev, "NULL node\n");
>> -		return -EINVAL;
>> -	}
>> +	if (!dev->of_node)
>> +		return dev_err_probe(dev, -EINVAL, "NULL node\n");
> 
> Perhaps -ENODEV would be more appropriate here?  Also, the error message is
> not the best, as such, I wonder if we could make it better while we are at
> it, so to speak.
> 
> 	Krzysztof

Sure, I will add that to v2. I have seen that typical error messages in
other drivers for this error are "OF node not found", "Device node not
found" and "This driver needs device tree". Given that "OF data missing"
is used in this driver, I will go for the first one of the list, unless
something different is preferred.

Best regards,
Javier Carrasco


  reply	other threads:[~2024-07-07 12:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-06 15:07 [PATCH 0/2] PCI: kirin: cleanup (dev_err_probe() and scoped loop) Javier Carrasco
2024-07-06 15:07 ` [PATCH 1/2] PCI: kirin: use dev_err_probe() in probe error paths Javier Carrasco
2024-07-06 19:47   ` Christophe JAILLET
2024-07-06 20:12     ` Javier Carrasco
2024-07-07  6:53   ` Krzysztof Wilczyński
2024-07-07 12:19     ` Javier Carrasco [this message]
2024-07-06 15:07 ` [PATCH 2/2] PCI: kirin: use for_each_available_child_of_node_scoped() Javier Carrasco

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=0608fa9e-9ada-43a6-888d-fab6ed06bfb8@gmail.com \
    --to=javier.carrasco.cruz@gmail.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=bhelgaas@google.com \
    --cc=kw@linux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=robh@kernel.org \
    --cc=songxiaowei@hisilicon.com \
    --cc=wangbinghui@hisilicon.com \
    /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