Re: How do I detect if disconnect is called due to module removal?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Apr 27, 2012 at 07:43:50PM +0200, Hans Verkuil wrote:
> Hi all,
> 
> I'm cleaning up some USB FM radio drivers and I realized that I need to know
> in the disconnect callback whether I'm called due to a module unload or due
> to an unplug event.

You shouldn't care.

> In the first case I need to first mute the audio output of the device, in the
> second case I can skip that.

Why?  The "mute" operation would just fail if the device isn't present,
no problem.

> I can just try and always mute the device but that results in a error message
> in the case the device is unplugged.

Then don't display that error message :)

> Is there a field I can test somewhere to detect what caused the disconnect?

No, sorry, you shouldn't really do anything different here the driver
does not know the difference, nor should it.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux