Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

serdev: Drop dev_pm_domain_detach() call

Starting with commit f99508074e78 ("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>

authored by

Claudiu Beznea and committed by
Greg Kroah-Hartman
e3fa89f3 aa1020f5

+3 -8
+3 -8
drivers/tty/serdev/core.c
··· 399 399 const struct serdev_device_driver *sdrv = to_serdev_device_driver(dev->driver); 400 400 int ret; 401 401 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); 403 404 if (ret) 404 405 return ret; 405 406 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)); 411 408 } 412 409 413 410 static void serdev_drv_remove(struct device *dev) ··· 412 415 const struct serdev_device_driver *sdrv = to_serdev_device_driver(dev->driver); 413 416 if (sdrv->remove) 414 417 sdrv->remove(to_serdev_device(dev)); 415 - 416 - dev_pm_domain_detach(dev, true); 417 418 } 418 419 419 420 static const struct bus_type serdev_bus_type = {