All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jinjie Ruan <ruanjinjie@huawei.com>
To: <linux-spi@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	Radu Pirea <radu_nicolae.pirea@upb.ro>,
	Mark Brown <broonie@kernel.org>,
	Nicolas Ferre <nicolas.ferre@microchip.com>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Claudiu Beznea <claudiu.beznea@tuxon.dev>
Cc: <ruanjinjie@huawei.com>
Subject: [PATCH -next] spi: at91-usart: Use PTR_ERR_OR_ZERO() to simplify code
Date: Tue, 22 Aug 2023 20:46:42 +0800	[thread overview]
Message-ID: <20230822124643.987079-1-ruanjinjie@huawei.com> (raw)

Return PTR_ERR_OR_ZERO() instead of return 0 or PTR_ERR() to
simplify code.

Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
---
 drivers/spi/spi-at91-usart.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/spi/spi-at91-usart.c b/drivers/spi/spi-at91-usart.c
index 75d9bc606442..b11d0f993cc7 100644
--- a/drivers/spi/spi-at91-usart.c
+++ b/drivers/spi/spi-at91-usart.c
@@ -485,10 +485,7 @@ static int at91_usart_gpio_setup(struct platform_device *pdev)
 
 	cs_gpios = devm_gpiod_get_array_optional(&pdev->dev, "cs", GPIOD_OUT_LOW);
 
-	if (IS_ERR(cs_gpios))
-		return PTR_ERR(cs_gpios);
-
-	return 0;
+	return PTR_ERR_OR_ZERO(cs_gpios);
 }
 
 static int at91_usart_spi_probe(struct platform_device *pdev)
-- 
2.34.1


WARNING: multiple messages have this Message-ID (diff)
From: Jinjie Ruan <ruanjinjie@huawei.com>
To: <linux-spi@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	Radu Pirea <radu_nicolae.pirea@upb.ro>,
	Mark Brown <broonie@kernel.org>,
	Nicolas Ferre <nicolas.ferre@microchip.com>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Claudiu Beznea <claudiu.beznea@tuxon.dev>
Cc: <ruanjinjie@huawei.com>
Subject: [PATCH -next] spi: at91-usart: Use PTR_ERR_OR_ZERO() to simplify code
Date: Tue, 22 Aug 2023 20:46:42 +0800	[thread overview]
Message-ID: <20230822124643.987079-1-ruanjinjie@huawei.com> (raw)

Return PTR_ERR_OR_ZERO() instead of return 0 or PTR_ERR() to
simplify code.

Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
---
 drivers/spi/spi-at91-usart.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/spi/spi-at91-usart.c b/drivers/spi/spi-at91-usart.c
index 75d9bc606442..b11d0f993cc7 100644
--- a/drivers/spi/spi-at91-usart.c
+++ b/drivers/spi/spi-at91-usart.c
@@ -485,10 +485,7 @@ static int at91_usart_gpio_setup(struct platform_device *pdev)
 
 	cs_gpios = devm_gpiod_get_array_optional(&pdev->dev, "cs", GPIOD_OUT_LOW);
 
-	if (IS_ERR(cs_gpios))
-		return PTR_ERR(cs_gpios);
-
-	return 0;
+	return PTR_ERR_OR_ZERO(cs_gpios);
 }
 
 static int at91_usart_spi_probe(struct platform_device *pdev)
-- 
2.34.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

             reply	other threads:[~2023-08-22 12:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-22 12:46 Jinjie Ruan [this message]
2023-08-22 12:46 ` [PATCH -next] spi: at91-usart: Use PTR_ERR_OR_ZERO() to simplify code Jinjie Ruan
2023-08-22 13:11 ` Nicolas Ferre
2023-08-22 13:11   ` Nicolas Ferre
2023-08-22 14:15   ` Mark Brown
2023-08-22 14:15     ` Mark Brown
2023-08-22 14:45     ` Alexandre Belloni
2023-08-22 14:45       ` Alexandre Belloni
2023-08-22 15:04       ` Mark Brown
2023-08-22 15:04         ` Mark Brown
2023-08-22 16:33 ` Mark Brown
2023-08-22 16:33   ` 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=20230822124643.987079-1-ruanjinjie@huawei.com \
    --to=ruanjinjie@huawei.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=broonie@kernel.org \
    --cc=claudiu.beznea@tuxon.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=nicolas.ferre@microchip.com \
    --cc=radu_nicolae.pirea@upb.ro \
    /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 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.