提交 ba966ff9 编写于 作者: J Jiasheng Jiang 提交者: Zheng Zengkai

i2c: npcm7xx: Add check for platform_driver_register

stable inclusion
from stable-v5.10.124
commit 716587a57a284ab1813838fb1c563fa3ed2bf902
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5L6E7

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=716587a57a284ab1813838fb1c563fa3ed2bf902

--------------------------------

[ Upstream commit 6ba12b56 ]

As platform_driver_register() could fail, it should be better
to deal with the return value in order to maintain the code
consisitency.

Fixes: 56a1485b ("i2c: npcm7xx: Add Nuvoton NPCM I2C controller driver")
Signed-off-by: NJiasheng Jiang <jiasheng@iscas.ac.cn>
Acked-by: NTali Perry <tali.perry1@gmail.com>
Signed-off-by: NWolfram Sang <wsa@kernel.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Reviewed-by: NWei Li <liwei391@huawei.com>
上级 e6527aa3
......@@ -2369,8 +2369,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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册