summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiasheng Jiang <jiasheng@iscas.ac.cn>2022-05-26 17:41:00 +0800
committerWolfram Sang <wsa@kernel.org>2022-06-08 22:15:37 +0200
commit6ba12b56b9b844b83ed54fb7ed59fb0eb41e4045 (patch)
tree09fd000113295bfb27ac5ad015e84dbb284ce17a
parent8c4811e7a5a60443139369a623ca504bad9e3675 (diff)
downloadlinux-stable-6ba12b56b9b844b83ed54fb7ed59fb0eb41e4045.tar.gz
linux-stable-6ba12b56b9b844b83ed54fb7ed59fb0eb41e4045.tar.bz2
linux-stable-6ba12b56b9b844b83ed54fb7ed59fb0eb41e4045.zip
i2c: npcm7xx: Add check for platform_driver_register
As platform_driver_register() could fail, it should be better to deal with the return value in order to maintain the code consisitency. Fixes: 56a1485b102e ("i2c: npcm7xx: Add Nuvoton NPCM I2C controller driver") Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn> Acked-by: Tali Perry <tali.perry1@gmail.com> Signed-off-by: Wolfram Sang <wsa@kernel.org>
-rw-r--r--drivers/i2c/busses/i2c-npcm7xx.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/i2c/busses/i2c-npcm7xx.c b/drivers/i2c/busses/i2c-npcm7xx.c
index 5960ccde6574..aede9d551130 100644
--- a/drivers/i2c/busses/i2c-npcm7xx.c
+++ b/drivers/i2c/busses/i2c-npcm7xx.c
@@ -2372,8 +2372,7 @@ static struct platform_driver npcm_i2c_bus_driver = {
static int __init npcm_i2c_init(void)
{
npcm_i2c_debugfs_dir = debugfs_create_dir("npcm_i2c", NULL);
- platform_driver_register(&npcm_i2c_bus_driver);
- return 0;
+ return platform_driver_register(&npcm_i2c_bus_driver);
}
module_init(npcm_i2c_init);