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

* Re: [PATCH] ASoC: cs48l32: Use PTR_ERR_OR_ZERO() to simplify code
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Richard Fitzgerald @ 2025-08-08  9:46 UTC (permalink / raw)
  To: Xichao Zhao, david.rhodes, lgirdwood, broonie, perex, tiwai
  Cc: linux-sound, patches, linux-kernel

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@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);
>   }
Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com>

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

* Re: [PATCH] ASoC: cs48l32: Use PTR_ERR_OR_ZERO() to simplify code
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2025-08-12 11:04 UTC (permalink / raw)
  To: david.rhodes, rf, lgirdwood, perex, tiwai, Xichao Zhao
  Cc: linux-sound, patches, linux-kernel

On Tue, 05 Aug 2025 17:04:31 +0800, Xichao Zhao wrote:
> Use the standard error pointer macro to shorten the code and simplify.
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: cs48l32: Use PTR_ERR_OR_ZERO() to simplify code
      commit: 3059067fd3378a5454e7928c08d20bf3ef186760

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


^ 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®