Skip to contentSkip to conversation

Input: i8042: remove the modifications to i8042_platform_device

PATCH New Chen Jun 1 participant 1 message Nov 9, 2022

Subsystems (2)
lore
Share & tools
lore

Chen Jun

author
#0 lore raw

PATCH 1/1 Input: i8042: remove the modifications to i8042_platform_device

i8042_platform_device can be changed in i8042_{probe|remove}. This could leave a i8042 device on the platform bus and release resources unexpectedly when i8042.ko is re-probed.

Fixes 9222ba68c3f4 ("Input: i8042 - add deferred probe support")
---
 drivers/input/serio/i8042.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/input/serio/i8042.c +0 -4
index f9486495baef..6dac7c1853a5 100644
@@ -1543,8 +1543,6 @@ static int i8042_probe(struct platform_device *dev)
 {
 	int error;
 
-	i8042_platform_device = dev;
-
 	if (i8042_reset == I8042_RESET_ALWAYS) {
 		error = i8042_controller_selftest();
 		if (error)
@@ -1582,7 +1580,6 @@ static int i8042_probe(struct platform_device *dev)
 	i8042_free_aux_ports();	/* in case KBD failed but AUX not */
 	i8042_free_irqs();
 	i8042_controller_reset(false);
-	i8042_platform_device = NULL;
 
 	return error;
 }
@@ -1592,7 +1589,6 @@ static int i8042_remove(struct platform_device *dev)
 	i8042_unregister_ports();
 	i8042_free_irqs();
 	i8042_controller_reset(false);
-	i8042_platform_device = NULL;
 
 	return 0;
 }
Signature · 1 line
2.17.1