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

mfd: twl4030: Make twl4030_exit_irq() return void

If twl4030_exit_irq() returns an error, the effect is that the caller
(twl_remove()) forwards the error to the i2c core without unregistering
its dummy slave devices. This only makes the i2c core emit another
error message and then it still removes the device.

In this situation it doesn't make sense to abort the remove cleanup and not
unregister the slave devices. So do that. Then return value is actually
unused and twl4030_exit_irq() can better be changed to return no value at
all.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220113101430.12869-3-u.kleine-koenig@pengutronix.de

authored by

Uwe Kleine-König and committed by
Lee Jones
724c3be3 b6f29431

+4 -11
+1 -5
drivers/mfd/twl-core.c
··· 1036 1036 static int twl_remove(struct i2c_client *client) 1037 1037 { 1038 1038 unsigned i, num_slaves; 1039 - int status = 0; 1040 1039 1041 1040 if (twl_class_is_4030()) 1042 - status = twl4030_exit_irq(); 1041 + twl4030_exit_irq(); 1043 1042 else 1044 1043 twl6030_exit_irq(); 1045 - 1046 - if (status < 0) 1047 - return status; 1048 1044 1049 1045 num_slaves = twl_get_num_slaves(); 1050 1046 for (i = 0; i < num_slaves; i++) {
+1 -1
drivers/mfd/twl-core.h
··· 5 5 extern int twl6030_init_irq(struct device *dev, int irq_num); 6 6 extern void twl6030_exit_irq(void); 7 7 extern int twl4030_init_irq(struct device *dev, int irq_num); 8 - extern int twl4030_exit_irq(void); 8 + extern void twl4030_exit_irq(void); 9 9 extern int twl4030_init_chip_irq(const char *chip); 10 10 11 11 #endif /* __TWL_CORE_H__ */
+2 -5
drivers/mfd/twl4030-irq.c
··· 753 753 return status; 754 754 } 755 755 756 - int twl4030_exit_irq(void) 756 + void twl4030_exit_irq(void) 757 757 { 758 758 /* FIXME undo twl_init_irq() */ 759 - if (twl4030_irq_base) { 759 + if (twl4030_irq_base) 760 760 pr_err("twl4030: can't yet clean up IRQs?\n"); 761 - return -ENOSYS; 762 - } 763 - return 0; 764 761 } 765 762 766 763 int twl4030_init_chip_irq(const char *chip)