From: Matthias Brugger <matthias.bgg@gmail.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
broonie@kernel.org, gregkh@linuxfoundation.org, neil@brown.name,
blogic@openwrt.org
Cc: linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH 1/4] spi: mt7621: Fix an error message in mt7621_spi_probe()
Date: Mon, 29 Aug 2022 13:07:03 +0200 [thread overview]
Message-ID: <778646cb-1b25-52d7-abd5-274757f40e93@gmail.com> (raw)
In-Reply-To: <928f3fb507d53ba0774df27cea0bbba4b055993b.1661599671.git.christophe.jaillet@wanadoo.fr>
On 27/08/2022 13:42, Christophe JAILLET wrote:
> 'status' is known to be 0 at this point. The expected error code is
> PTR_ERR(clk).
>
> Switch to dev_err_probe() in order to display the expected error code (in a
> human readable way).
> This also filters -EPROBE_DEFER cases, should it happen.
>
> Fixes: 1ab7f2a43558 ("staging: mt7621-spi: add mt7621 support")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
> ---
> drivers/spi/spi-mt7621.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/spi/spi-mt7621.c b/drivers/spi/spi-mt7621.c
> index b4b9b7309b5e..351b0ef52bbc 100644
> --- a/drivers/spi/spi-mt7621.c
> +++ b/drivers/spi/spi-mt7621.c
> @@ -340,11 +340,9 @@ static int mt7621_spi_probe(struct platform_device *pdev)
> return PTR_ERR(base);
>
> clk = devm_clk_get(&pdev->dev, NULL);
> - if (IS_ERR(clk)) {
> - dev_err(&pdev->dev, "unable to get SYS clock, err=%d\n",
> - status);
> - return PTR_ERR(clk);
> - }
> + if (IS_ERR(clk))
> + return dev_err_probe(&pdev->dev, PTR_ERR(clk),
> + "unable to get SYS clock\n");
>
> status = clk_prepare_enable(clk);
> if (status)
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2022-08-29 11:08 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-27 11:41 [PATCH 0/4] spi: mt7621: Fix an erroneous message + clean-ups Christophe JAILLET
2022-08-27 11:42 ` [PATCH 1/4] spi: mt7621: Fix an error message in mt7621_spi_probe() Christophe JAILLET
2022-08-29 11:07 ` Matthias Brugger [this message]
2022-08-30 9:46 ` AngeloGioacchino Del Regno
2022-08-27 11:42 ` [PATCH 2/4] spi: mt7621: Use the devm_clk_get_enabled() helper to simplify error handling Christophe JAILLET
2022-08-29 11:14 ` Matthias Brugger
2022-08-30 9:46 ` AngeloGioacchino Del Regno
2022-08-27 11:42 ` [PATCH 3/4] spi: mt7621: Use devm_spi_register_controller() Christophe JAILLET
2022-08-29 11:16 ` Matthias Brugger
2022-08-27 11:42 ` [PATCH 4/4] spi: mt7621: Remove 'clk' from 'struct mt7621_spi' Christophe JAILLET
2022-08-29 11:18 ` Matthias Brugger
2022-08-29 17:23 ` Christophe JAILLET
2022-08-29 20:54 ` [PATCH 0/4] spi: mt7621: Fix an erroneous message + clean-ups Mark Brown
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=778646cb-1b25-52d7-abd5-274757f40e93@gmail.com \
--to=matthias.bgg@gmail.com \
--cc=blogic@openwrt.org \
--cc=broonie@kernel.org \
--cc=christophe.jaillet@wanadoo.fr \
--cc=gregkh@linuxfoundation.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-spi@vger.kernel.org \
--cc=neil@brown.name \
/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).