linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Aleksandr Burakov <a.burakov@rosalinux.ru>
Cc: "Yue Wang" <yue.wang@amlogic.com>,
	"Hanjie Lin" <hanjie.lin@amlogic.com>,
	"Lorenzo Pieralisi" <lorenzo.pieralisi@arm.com>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Wilczyński" <kw@linux.com>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Neil Armstrong" <neil.armstrong@linaro.org>,
	"Kevin Hilman" <khilman@baylibre.com>,
	"Jerome Brunet" <jbrunet@baylibre.com>,
	"Martin Blumenstingl" <martin.blumenstingl@googlemail.com>,
	linux-pci@vger.kernel.org, linux-amlogic@lists.infradead.org,
	linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org
Subject: Re: [PATCH] PCI: amlogic: The check for devm_add_action_or_reset's return value added
Date: Thu, 29 Dec 2022 13:43:33 -0600	[thread overview]
Message-ID: <20221229194333.GA625014@bhelgaas> (raw)
In-Reply-To: <20221220092137.6527-1-a.burakov@rosalinux.ru>

Hi Aleksandr,

Thanks for the patch!

On Tue, Dec 20, 2022 at 12:21:37PM +0300, Aleksandr Burakov wrote:
> The return value of the function devm_add_action_or_reset() was not
> checked hence an error code would not be returned.

You can save Lorenzo and Krzysztof some work by:

  - Rewording the subject line in the typical "<verb> <object>"
    imperative form, e.g., "Check for devm_add_action_or_reset()
    failure"

  - Rewording the commit log similarly.  Note that the existing commit
    only describes the current situation and doesn't actually say what
    the patch does.

Here's a good guide to commit logs: https://cbea.ms/git-commit/

> Fixes: 9c0ef6d34fdb ("PCI: amlogic: Add the Amlogic Meson PCIe controller driver")
> Signed-off-by: Aleksandr Burakov <a.burakov@rosalinux.ru>
> ---
>  drivers/pci/controller/dwc/pci-meson.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/pci/controller/dwc/pci-meson.c b/drivers/pci/controller/dwc/pci-meson.c
> index c1527693bed9..3d82f0b65480 100644
> --- a/drivers/pci/controller/dwc/pci-meson.c
> +++ b/drivers/pci/controller/dwc/pci-meson.c
> @@ -187,9 +187,13 @@ static inline struct clk *meson_pcie_probe_clock(struct device *dev,
>  		return ERR_PTR(ret);
>  	}
>  
> -	devm_add_action_or_reset(dev,
> +	ret = devm_add_action_or_reset(dev,
>  				 (void (*) (void *))clk_disable_unprepare,
>  				 clk);
> +	if (ret) {
> +		dev_err(dev, "couldn't reset clk\n");
> +		return ERR_PTR(ret);
> +	}
>  
>  	return clk;
>  }
> -- 
> 2.25.1
> 

  reply	other threads:[~2022-12-29 19:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-20  9:21 [PATCH] PCI: amlogic: The check for devm_add_action_or_reset's return value added Aleksandr Burakov
2022-12-29 19:43 ` Bjorn Helgaas [this message]
2022-12-29 21:43 ` Christophe JAILLET

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=20221229194333.GA625014@bhelgaas \
    --to=helgaas@kernel.org \
    --cc=a.burakov@rosalinux.ru \
    --cc=bhelgaas@google.com \
    --cc=hanjie.lin@amlogic.com \
    --cc=jbrunet@baylibre.com \
    --cc=khilman@baylibre.com \
    --cc=kw@linux.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=lvc-project@linuxtesting.org \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=neil.armstrong@linaro.org \
    --cc=robh@kernel.org \
    --cc=yue.wang@amlogic.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;
as well as URLs for NNTP newsgroup(s).