[PATCH] mfd: kempld: use PTR_ERR_OR_ZERO() to simplify code

Xichao Zhao posted 1 patch 1 month, 3 weeks ago
drivers/mfd/kempld-core.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
[PATCH] mfd: kempld: use PTR_ERR_OR_ZERO() to simplify code
Posted by Xichao Zhao 1 month, 3 weeks ago
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
Re: (subset) [PATCH] mfd: kempld: use PTR_ERR_OR_ZERO() to simplify code
Posted by Lee Jones 1 month ago
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 [李琼斯]