Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

macintosh/ams: Remove unneeded result variable

Return the value from i2c_add_driver() directly instead of storing it in
another redundant variable.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
Signed-off-by: CGEL ZTE <cgel.zte@gmail.com>
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220118075252.925616-1-chi.minghao@zte.com.cn

authored by

Minghao Chi and committed by
Michael Ellerman
e9bb94cd 9d021a21

+1 -5
+1 -5
drivers/macintosh/ams/ams-i2c.c
··· 256 256 257 257 int __init ams_i2c_init(struct device_node *np) 258 258 { 259 - int result; 260 - 261 259 /* Set implementation stuff */ 262 260 ams_info.of_node = np; 263 261 ams_info.exit = ams_i2c_exit; ··· 264 266 ams_info.clear_irq = ams_i2c_clear_irq; 265 267 ams_info.bustype = BUS_I2C; 266 268 267 - result = i2c_add_driver(&ams_i2c_driver); 268 - 269 - return result; 269 + return i2c_add_driver(&ams_i2c_driver); 270 270 }