Re: Check if usb device is suspended

From: Oliver Neukum
Date: Thu Mar 13 2014 - 09:06:11 EST


On Thu, 2014-03-13 at 17:13 +0530, Jagdish Gedia wrote:
> Hi,
> I want to check in my driver if usb device is suspended or not?
> currently i am doing it like
>
> if(udev->state==USB_STATE_SUSPENDED)
>
> Is this the proper way? Is this enough?

This question is near meaningless. Assuming that you
don't check for fun, but want to act on the state,
the meaningful question would be how you know that
a device is still suspended (or not) while you perform
the actions you base on that information.

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/