From: Christophe JAILLET <christophe.jaillet@wanadoo.fr> To: broonie@kernel.org, matthias.bgg@gmail.com, 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, Christophe JAILLET <christophe.jaillet@wanadoo.fr> Subject: [PATCH 1/4] spi: mt7621: Fix an error message in mt7621_spi_probe() Date: Sat, 27 Aug 2022 13:42:07 +0200 [thread overview] Message-ID: <928f3fb507d53ba0774df27cea0bbba4b055993b.1661599671.git.christophe.jaillet@wanadoo.fr> (raw) In-Reply-To: <cover.1661599671.git.christophe.jaillet@wanadoo.fr> '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> --- 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) -- 2.34.1
WARNING: multiple messages have this Message-ID (diff)
From: Christophe JAILLET <christophe.jaillet@wanadoo.fr> To: broonie@kernel.org, matthias.bgg@gmail.com, 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, Christophe JAILLET <christophe.jaillet@wanadoo.fr> Subject: [PATCH 1/4] spi: mt7621: Fix an error message in mt7621_spi_probe() Date: Sat, 27 Aug 2022 13:42:07 +0200 [thread overview] Message-ID: <928f3fb507d53ba0774df27cea0bbba4b055993b.1661599671.git.christophe.jaillet@wanadoo.fr> (raw) In-Reply-To: <cover.1661599671.git.christophe.jaillet@wanadoo.fr> '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> --- 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) -- 2.34.1 _______________________________________________ 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-27 11:42 UTC|newest] Thread overview: 26+ 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:41 ` Christophe JAILLET 2022-08-27 11:42 ` Christophe JAILLET [this message] 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 2022-08-29 11:07 ` Matthias Brugger 2022-08-30 9:46 ` AngeloGioacchino Del Regno 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-27 11:42 ` Christophe JAILLET 2022-08-29 11:14 ` Matthias Brugger 2022-08-29 11:14 ` Matthias Brugger 2022-08-30 9:46 ` AngeloGioacchino Del Regno 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-27 11:42 ` Christophe JAILLET 2022-08-29 11:16 ` Matthias Brugger 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-27 11:42 ` Christophe JAILLET 2022-08-29 11:18 ` Matthias Brugger 2022-08-29 11:18 ` Matthias Brugger 2022-08-29 17:23 ` Christophe JAILLET 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 2022-08-29 20:54 ` 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=928f3fb507d53ba0774df27cea0bbba4b055993b.1661599671.git.christophe.jaillet@wanadoo.fr \ --to=christophe.jaillet@wanadoo.fr \ --cc=blogic@openwrt.org \ --cc=broonie@kernel.org \ --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=matthias.bgg@gmail.com \ --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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.