Re: Check if usb device is suspended

From: Oliver Neukum
Date: Fri Mar 21 2014 - 09:22:32 EST


On Fri, 2014-03-21 at 17:17 +0530, Jagdish Gedia wrote:
> I want to resume the usb device on some event, so i want to check if
> it is suspended. I think by above method i can check if the device is
> already suspended, but may be i will miss to resume the device if it
> is suspending. Is there any way through which i can check if device is
> suspending?

Just don't do that. If a device needs to be awake for some operation,
call usb_autopm_get(). If the device is already awake, it is a nop
besides keeping the device awake.
Checking is not a sensible strategy.

Regards
Oliver


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/