]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mfd: kempld: Use PTR_ERR_OR_ZERO() to simplify code
authorXichao Zhao <zhao.xichao@vivo.com>
Tue, 12 Aug 2025 09:31:04 +0000 (17:31 +0800)
committerLee Jones <lee@kernel.org>
Wed, 1 Oct 2025 09:28:22 +0000 (10:28 +0100)
Use the standard error pointer macro to shorten the code and simplify.

Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
Link: https://lore.kernel.org/r/20250812093104.103193-1-zhao.xichao@vivo.com
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/mfd/kempld-core.c

index 77980c7fc31f9f150fe4458e4ac8b7dd2629b80f..c2008d2dc95aa9c585a011112eca9ec31b4a0218 100644 (file)
@@ -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);
 }
 
 /**