Skip to contentSkip to conversation

Input: arizona-haptic - Don't assign input_dev parent

PATCH Applied Charles Keepax 2 participants 2 messages Apr 15, 2016 – Apr 17, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Input: arizona-haptic - Don't assign input_dev parent

We shouldn't assign the parent device of the input_dev to be the parent MFD device, because this will be used for devres which causes input_unregister_device to run after the haptics device has been removed, since it is itself a child of the MFD device. The default of using the haptics device itself as the parent is correct.

---
 drivers/input/misc/arizona-haptics.c | 1 -
 1 file changed, 1 deletion(-)
drivers/input/misc/arizona-haptics.c +0 -1
index d5994a7..9829363 100644
@@ -178,7 +178,6 @@ static int arizona_haptics_probe(struct platform_device *pdev)
 	input_set_drvdata(haptics->input_dev, haptics);
 
 	haptics->input_dev->name = "arizona:haptics";
-	haptics->input_dev->dev.parent = pdev->dev.parent;
 	haptics->input_dev->close = arizona_haptics_close;
 	__set_bit(FF_RUMBLE, haptics->input_dev->ffbit);
 
Signature · 1 line
2.1.4
maintainer Applied
#1 lore raw
Quoted 7 lines · Charles Keepax

We shouldn't assign the parent device of the input_dev to be the parent MFD device, because this will be used for devres which causes input_unregister_device to run after the haptics device has been removed, since it is itself a child of the MFD device. The default of using the haptics device itself as the parent is correct.

Applied, thank you.

Quoted 19 lines
---
 drivers/input/misc/arizona-haptics.c | 1 -
 1 file changed, 1 deletion(-)
drivers/input/misc/arizona-haptics.c +0 -1
index d5994a7..9829363 100644
@@ -178,7 +178,6 @@ static int arizona_haptics_probe(struct platform_device *pdev)
 	input_set_drvdata(haptics->input_dev, haptics);
 
 	haptics->input_dev->name = "arizona:haptics";
-	haptics->input_dev->dev.parent = pdev->dev.parent;
 	haptics->input_dev->close = arizona_haptics_close;
 	__set_bit(FF_RUMBLE, haptics->input_dev->ffbit);
 
Signature · 1 line
2.1.4
Signature · 1 line
Dmitry