# \[PATCH\] Input: synaptics-rmi4 - Fix device hierarchy

- Subsystems: INPUT (KEYBOARD, MOUSE, JOYSTICK, TOUCHSCREEN) DRIVERS, THE REST
- Maintainers: Dmitry Torokhov, Linus Torvalds
- Status: LANDED (6e4860410b82 · 2021-11-06 02:46)
- Landed in mainline as 6e4860410b82 on 2021-11-06.
- List: linux-input
- 2 messages, 2 authors
- Page: https://ratatoskr.run/linux-input/2021/10/8933543/t

## \[PATCH\] Input: synaptics-rmi4 - Fix device hierarchy

- From: Loic Poulain \<hidden\>
- Date: 2021-10-29 13:31:32 
- Message: https://ratatoskr.run/linux-input/2021/10/8933543.md

```text
The created rmi device is orphan, which breaks the real device
hierarchy, and can cause some trouble, especially during suspend
and resume sequences. E.g. in case of I2C, rmi dev should be child
of the I2C client device.

Fix this, assigning the transport device as parent of the rmi device.

Signed-off-by: Loic Poulain <redacted>
---
 drivers/input/rmi4/rmi_bus.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/input/rmi4/rmi_bus.c b/drivers/input/rmi4/rmi_bus.c
index af706a58..a16c1dd 100644
--- a/drivers/input/rmi4/rmi_bus.c
+++ b/drivers/input/rmi4/rmi_bus.c
@@ -90,6 +90,7 @@ int rmi_register_transport_device(struct rmi_transport_dev *xport)
 
 	rmi_dev->dev.bus = &rmi_bus_type;
 	rmi_dev->dev.type = &rmi_device_type;
+	rmi_dev->dev.parent = xport->dev;
 
 	xport->rmi_dev = rmi_dev;
 
-- 
2.7.4

```

## Re: \[PATCH\] Input: synaptics-rmi4 - Fix device hierarchy

- From: Dmitry Torokhov \<dmitry.torokhov@gmail.com\>
- Date: 2021-11-06 02:46:52 
- Message: https://ratatoskr.run/linux-input/2021/11/8933552.md

```text
On Fri, Oct 29, 2021 at 03:42:51PM +0200, Loic Poulain wrote:
> The created rmi device is orphan, which breaks the real device
> hierarchy, and can cause some trouble, especially during suspend
> and resume sequences. E.g. in case of I2C, rmi dev should be child
> of the I2C client device.
> 
> Fix this, assigning the transport device as parent of the rmi device.
> 
> Signed-off-by: Loic Poulain <redacted>

Applied, thank you.

-- 
Dmitry
```
