Skip to content

Commit c8892c2

Browse files
Ivanhu5866ij-intel
authored andcommitted
platform/x86: portwell-ec: Move watchdog device under correct platform hierarchy
Without explicitly setting a parent for the watchdog device, the device is registered with a NULL parent. This causes device_add() (called internally by devm_watchdog_register_device()) to register the device under /sys/devices/virtual, since no parent is provided. The result is: DEVPATH=/devices/virtual/watchdog/watchdog0 To fix this, assign &pdev->dev as the parent of the watchdog device before calling devm_watchdog_register_device(). This ensures the device is associated with the Portwell EC platform device and placed correctly in sysfs as: DEVPATH=/devices/platform/portwell-ec/watchdog/watchdog0 This aligns the device hierarchy with expectations and avoids misplacement under the virtual class. Fixes: 8357967 ("platform/x86: portwell-ec: Add GPIO and WDT driver for Portwell EC") Signed-off-by: Ivan Hu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Ilpo Järvinen <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]>
1 parent e2468dc commit c8892c2

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/platform/x86/portwell-ec.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ static int pwec_probe(struct platform_device *pdev)
236236
return ret;
237237
}
238238

239+
ec_wdt_dev.parent = &pdev->dev;
239240
ret = devm_watchdog_register_device(&pdev->dev, &ec_wdt_dev);
240241
if (ret < 0) {
241242
dev_err(&pdev->dev, "failed to register Portwell EC Watchdog\n");

0 commit comments

Comments
 (0)