Skip to content

Commit

Permalink
i2c: npcm7xx: Add check for platform_driver_register
Browse files Browse the repository at this point in the history
[ Upstream commit 6ba12b5 ]

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

Fixes: 56a1485 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
JiangJias authored and gregkh committed Jun 22, 2022
1 parent b559ef9 commit 716587a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/i2c/busses/i2c-npcm7xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 716587a

Please sign in to comment.