linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mfd: kempld: use PTR_ERR_OR_ZERO() to simplify code
@ 2025-08-12  9:31 Xichao Zhao
  2025-09-02 10:22 ` (subset) " Lee Jones
  0 siblings, 1 reply; 2+ messages in thread
From: Xichao Zhao @ 2025-08-12  9:31 UTC (permalink / raw)
  To: lee; +Cc: 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>
---
 drivers/mfd/kempld-core.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/mfd/kempld-core.c b/drivers/mfd/kempld-core.c
index c5bfb6440a93..19c672820c8f 100644
--- a/drivers/mfd/kempld-core.c
+++ b/drivers/mfd/kempld-core.c
@@ -141,10 +141,8 @@ static int kempld_create_platform_device(const struct kempld_platform_data *pdat
 	};
 
 	kempld_pdev = platform_device_register_full(&pdevinfo);
-	if (IS_ERR(kempld_pdev))
-		return PTR_ERR(kempld_pdev);
 
-	return 0;
+	return PTR_ERR_OR_ZERO(kempld_pdev);
 }
 
 /**
-- 
2.34.1


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

* Re: (subset) [PATCH] mfd: kempld: use PTR_ERR_OR_ZERO() to simplify code
  2025-08-12  9:31 [PATCH] mfd: kempld: use PTR_ERR_OR_ZERO() to simplify code Xichao Zhao
@ 2025-09-02 10:22 ` Lee Jones
  0 siblings, 0 replies; 2+ messages in thread
From: Lee Jones @ 2025-09-02 10:22 UTC (permalink / raw)
  To: lee, Xichao Zhao; +Cc: linux-kernel

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

Applied, thanks!

[1/1] mfd: kempld: use PTR_ERR_OR_ZERO() to simplify code
      commit: 36844f47e692214c99a3a46123a29475d73cff2f

--
Lee Jones [李琼斯]


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

end of thread, other threads:[~2025-09-02 10:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-12  9:31 [PATCH] mfd: kempld: use PTR_ERR_OR_ZERO() to simplify code Xichao Zhao
2025-09-02 10:22 ` (subset) " Lee Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).