Re: [PATCH] ASoC: cs48l32: Use PTR_ERR_OR_ZERO() to simplify code

From: Richard Fitzgerald
Date: Fri Aug 08 2025 - 05:47:17 EST


On 05/08/2025 10:04 am, Xichao Zhao wrote:
Use the standard error pointer macro to shorten the code and simplify.

Signed-off-by: Xichao Zhao <zhao.xichao@xxxxxxxx>
---
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);
}
Reviewed-by: Richard Fitzgerald <rf@xxxxxxxxxxxxxxxxxxxxx>