Skip to content

Commit e3fa89f

Browse files
claudiubezneagregkh
authored andcommitted
serdev: Drop dev_pm_domain_detach() call
Starting with commit f995080 ("PM: domains: Detach on device_unbind_cleanup()"), there is no longer a need to call dev_pm_domain_detach() in the bus remove function. The device_unbind_cleanup() function now handles this to avoid invoking devres cleanup handlers while the PM domain is powered off, which could otherwise lead to failures as described in the above-mentioned commit. Drop the explicit dev_pm_domain_detach() call and rely instead on the flags passed to dev_pm_domain_attach() to power off the domain. Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org> Link: https://lore.kernel.org/r/20250827101747.928265-1-claudiu.beznea.uj@bp.renesas.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent aa1020f commit e3fa89f

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

drivers/tty/serdev/core.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -399,24 +399,19 @@ static int serdev_drv_probe(struct device *dev)
399399
const struct serdev_device_driver *sdrv = to_serdev_device_driver(dev->driver);
400400
int ret;
401401

402-
ret = dev_pm_domain_attach(dev, PD_FLAG_ATTACH_POWER_ON);
402+
ret = dev_pm_domain_attach(dev, PD_FLAG_ATTACH_POWER_ON |
403+
PD_FLAG_DETACH_POWER_OFF);
403404
if (ret)
404405
return ret;
405406

406-
ret = sdrv->probe(to_serdev_device(dev));
407-
if (ret)
408-
dev_pm_domain_detach(dev, true);
409-
410-
return ret;
407+
return sdrv->probe(to_serdev_device(dev));
411408
}
412409

413410
static void serdev_drv_remove(struct device *dev)
414411
{
415412
const struct serdev_device_driver *sdrv = to_serdev_device_driver(dev->driver);
416413
if (sdrv->remove)
417414
sdrv->remove(to_serdev_device(dev));
418-
419-
dev_pm_domain_detach(dev, true);
420415
}
421416

422417
static const struct bus_type serdev_bus_type = {

0 commit comments

Comments
 (0)