mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ASoC: cs48l32: Use PTR_ERR_OR_ZERO() to simplify code
@ 2025-08-05  9:04 Xichao Zhao
  2025-08-08  9:46 ` Richard Fitzgerald
  2025-08-12 11:04 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Xichao Zhao @ 2025-08-05  9:04 UTC (permalink / raw)
  To: david.rhodes, rf, lgirdwood, broonie, perex, tiwai
  Cc: linux-sound, patches, linux-kernel, Xichao Zhao

Use the standard error pointer macro to shorten the code and simplify.

Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
---
 sound/soc/codecs/cs48l32-tables.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/sound/soc/codecs/cs48l32-tables.c b/sound/soc/codecs/cs48l32-tables.c
index 59eaa9a5029f..8ff3652a010e 100644
--- a/sound/soc/codecs/cs48l32-tables.c
+++ b/sound/soc/codecs/cs48l32-tables.c
@@ -533,8 +533,6 @@ static const struct regmap_config cs48l32_regmap = {
 int cs48l32_create_regmap(struct spi_device *spi, struct cs48l32 *cs48l32)
 {
 	cs48l32->regmap = devm_regmap_init_spi(spi, &cs48l32_regmap);
-	if (IS_ERR(cs48l32->regmap))
-		return PTR_ERR(cs48l32->regmap);
 
-	return 0;
+	return PTR_ERR_OR_ZERO(cs48l32->regmap);
 }
-- 
2.34.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-08-12 11:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-08-05  9:04 [PATCH] ASoC: cs48l32: Use PTR_ERR_OR_ZERO() to simplify code Xichao Zhao
2025-08-08  9:46 ` Richard Fitzgerald
2025-08-12 11:04 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®