Commit 6ba12b56 authored by Jiasheng Jiang's avatar Jiasheng Jiang Committed by Wolfram Sang

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: 56a1485b ("i2c: npcm7xx: Add Nuvoton NPCM I2C controller driver")
Signed-off-by: default avatarJiasheng Jiang <jiasheng@iscas.ac.cn>
Acked-by: default avatarTali Perry <tali.perry1@gmail.com>
Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
parent 8c4811e7
...@@ -2372,8 +2372,7 @@ static struct platform_driver npcm_i2c_bus_driver = { ...@@ -2372,8 +2372,7 @@ static struct platform_driver npcm_i2c_bus_driver = {
static int __init npcm_i2c_init(void) static int __init npcm_i2c_init(void)
{ {
npcm_i2c_debugfs_dir = debugfs_create_dir("npcm_i2c", NULL); npcm_i2c_debugfs_dir = debugfs_create_dir("npcm_i2c", NULL);
platform_driver_register(&npcm_i2c_bus_driver); return platform_driver_register(&npcm_i2c_bus_driver);
return 0;
} }
module_init(npcm_i2c_init); module_init(npcm_i2c_init);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment