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.

usb: usb_autopm_get_interface use modern helper

PM core now gives us a primitive that does not touch
the counter in an error case. Use it.

Signed-off-by: Oliver Neukum <oneukum@suse.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Link: https://lore.kernel.org/r/20240118202300.1616-1-oneukum@suse.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Oliver Neukum and committed by
Greg Kroah-Hartman
7626c52b b5584695

+2 -6
+2 -6
drivers/usb/core/driver.c
··· 1710 1710 { 1711 1711 int status; 1712 1712 1713 - status = pm_runtime_get_sync(&udev->dev); 1714 - if (status < 0) 1715 - pm_runtime_put_sync(&udev->dev); 1713 + status = pm_runtime_resume_and_get(&udev->dev); 1716 1714 dev_vdbg(&udev->dev, "%s: cnt %d -> %d\n", 1717 1715 __func__, atomic_read(&udev->dev.power.usage_count), 1718 1716 status); ··· 1816 1818 { 1817 1819 int status; 1818 1820 1819 - status = pm_runtime_get_sync(&intf->dev); 1820 - if (status < 0) 1821 - pm_runtime_put_sync(&intf->dev); 1821 + status = pm_runtime_resume_and_get(&intf->dev); 1822 1822 dev_vdbg(&intf->dev, "%s: cnt %d -> %d\n", 1823 1823 __func__, atomic_read(&intf->dev.power.usage_count), 1824 1824 status);