Skip to contentSkip to conversation

Input: cpcap-pwrbutton - do not set input parent explicitly

PATCH In review Dmitry Torokhov 2 participants 2 messages Oct 16, 2021

Subsystems (2)
lore
Share & tools
lore

Dmitry Torokhov

author maintainer
#0 lore raw

PATCH 1/1 Input: cpcap-pwrbutton - do not set input parent explicitly

We are using devm_input_allocate_device() that already sets parent of the input device, there is no need to do that again.

---
 drivers/input/misc/cpcap-pwrbutton.c | 1 -
 1 file changed, 1 deletion(-)
drivers/input/misc/cpcap-pwrbutton.c +0 -1
index 372cb44d0635..879790bbf9fe 100644
@@ -77,7 +77,6 @@ static int cpcap_power_button_probe(struct platform_device *pdev)
 
 	button->idev->name = "cpcap-pwrbutton";
 	button->idev->phys = "cpcap-pwrbutton/input0";
-	button->idev->dev.parent = button->dev;
 	input_set_capability(button->idev, EV_KEY, KEY_POWER);
 
 	err = devm_request_threaded_irq(&pdev->dev, irq, NULL,
Signature · 5 lines
2.33.0.1079.g6e70778dc9-goog


-- 
Dmitry
Reviewed-by on v1 1/1
#1 lore raw

Hi,

Quoted 5 lines · Dmitry Torokhov

We are using devm_input_allocate_device() that already sets parent of the input device, there is no need to do that again.

---

-- Sebastian

Quoted 21 lines
 drivers/input/misc/cpcap-pwrbutton.c | 1 -
 1 file changed, 1 deletion(-)
drivers/input/misc/cpcap-pwrbutton.c +0 -1
index 372cb44d0635..879790bbf9fe 100644
@@ -77,7 +77,6 @@ static int cpcap_power_button_probe(struct platform_device *pdev)
 
 	button->idev->name = "cpcap-pwrbutton";
 	button->idev->phys = "cpcap-pwrbutton/input0";
-	button->idev->dev.parent = button->dev;
 	input_set_capability(button->idev, EV_KEY, KEY_POWER);
 
 	err = devm_request_threaded_irq(&pdev->dev, irq, NULL,
Signature · 5 lines
2.33.0.1079.g6e70778dc9-goog


-- 
Dmitry