diff mbox

[6/7] em28xx: print a message at disconnect

Message ID 1389567649-26838-7-git-send-email-m.chehab@samsung.com (mailing list archive)
State New, archived
Headers show

Commit Message

Mauro Carvalho Chehab Jan. 12, 2014, 11 p.m. UTC
That helps to identify if something fails and explain why em28xx
struct is not freed (if it ever happens).

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
---
 drivers/media/usb/em28xx/em28xx-audio.c | 2 ++
 drivers/media/usb/em28xx/em28xx-dvb.c   | 2 ++
 drivers/media/usb/em28xx/em28xx-input.c | 2 ++
 drivers/media/usb/em28xx/em28xx-video.c | 2 ++
 4 files changed, 8 insertions(+)

Comments

Frank Schäfer Jan. 13, 2014, 6:51 p.m. UTC | #1
On 13.01.2014 00:00, Mauro Carvalho Chehab wrote:
> That helps to identify if something fails and explain why em28xx
> struct is not freed (if it ever happens).
>
> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
> ---
>   drivers/media/usb/em28xx/em28xx-audio.c | 2 ++
>   drivers/media/usb/em28xx/em28xx-dvb.c   | 2 ++
>   drivers/media/usb/em28xx/em28xx-input.c | 2 ++
>   drivers/media/usb/em28xx/em28xx-video.c | 2 ++
>   4 files changed, 8 insertions(+)
>
> diff --git a/drivers/media/usb/em28xx/em28xx-audio.c b/drivers/media/usb/em28xx/em28xx-audio.c
> index 5e16fcf18cac..0ec4742c3ab0 100644
> --- a/drivers/media/usb/em28xx/em28xx-audio.c
> +++ b/drivers/media/usb/em28xx/em28xx-audio.c
> @@ -962,6 +962,8 @@ static int em28xx_audio_fini(struct em28xx *dev)
>   		return 0;
>   	}
>   
> +	em28xx_info("Disconnecting audio extension");
> +
>   	snd_card_disconnect(dev->adev.sndcard);
>   	em28xx_audio_free_urb(dev);
>   
> diff --git a/drivers/media/usb/em28xx/em28xx-dvb.c b/drivers/media/usb/em28xx/em28xx-dvb.c
> index 8674ae5fce06..7ba209de57dd 100644
> --- a/drivers/media/usb/em28xx/em28xx-dvb.c
> +++ b/drivers/media/usb/em28xx/em28xx-dvb.c
> @@ -1473,6 +1473,8 @@ static int em28xx_dvb_fini(struct em28xx *dev)
>   		return 0;
>   	}
>   
> +	em28xx_info("Disconnecting DVB extension");
> +
>   	if (dev->dvb) {
>   		struct em28xx_dvb *dvb = dev->dvb;
>   
> diff --git a/drivers/media/usb/em28xx/em28xx-input.c b/drivers/media/usb/em28xx/em28xx-input.c
> index 33388b5922a0..bf04c5e1bd2a 100644
> --- a/drivers/media/usb/em28xx/em28xx-input.c
> +++ b/drivers/media/usb/em28xx/em28xx-input.c
> @@ -812,6 +812,8 @@ static int em28xx_ir_fini(struct em28xx *dev)
>   		return 0;
>   	}
>   
> +	em28xx_info("Disconnecting input extension");
> +
>   	em28xx_shutdown_buttons(dev);
>   
>   	/* skip detach on non attached boards */
> diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c
> index dc10cec772ba..004fe12ceec7 100644
> --- a/drivers/media/usb/em28xx/em28xx-video.c
> +++ b/drivers/media/usb/em28xx/em28xx-video.c
> @@ -1894,6 +1894,8 @@ static int em28xx_v4l2_fini(struct em28xx *dev)
>   		return 0;
>   	}
>   
> +	em28xx_info("Disconnecting video extension");
> +
>   	v4l2_device_disconnect(&dev->v4l2_dev);
>   
>   	em28xx_uninit_usb_xfer(dev, EM28XX_ANALOG_MODE);

I would say "Closing" instead of "Disconnecting". That's also how we 
call the function that calls the extensions fini() methods.

Reviewed-by: Frank Schäfer <fschaefer.oss@googlemail.com>


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

Patch

diff --git a/drivers/media/usb/em28xx/em28xx-audio.c b/drivers/media/usb/em28xx/em28xx-audio.c
index 5e16fcf18cac..0ec4742c3ab0 100644
--- a/drivers/media/usb/em28xx/em28xx-audio.c
+++ b/drivers/media/usb/em28xx/em28xx-audio.c
@@ -962,6 +962,8 @@  static int em28xx_audio_fini(struct em28xx *dev)
 		return 0;
 	}
 
+	em28xx_info("Disconnecting audio extension");
+
 	snd_card_disconnect(dev->adev.sndcard);
 	em28xx_audio_free_urb(dev);
 
diff --git a/drivers/media/usb/em28xx/em28xx-dvb.c b/drivers/media/usb/em28xx/em28xx-dvb.c
index 8674ae5fce06..7ba209de57dd 100644
--- a/drivers/media/usb/em28xx/em28xx-dvb.c
+++ b/drivers/media/usb/em28xx/em28xx-dvb.c
@@ -1473,6 +1473,8 @@  static int em28xx_dvb_fini(struct em28xx *dev)
 		return 0;
 	}
 
+	em28xx_info("Disconnecting DVB extension");
+
 	if (dev->dvb) {
 		struct em28xx_dvb *dvb = dev->dvb;
 
diff --git a/drivers/media/usb/em28xx/em28xx-input.c b/drivers/media/usb/em28xx/em28xx-input.c
index 33388b5922a0..bf04c5e1bd2a 100644
--- a/drivers/media/usb/em28xx/em28xx-input.c
+++ b/drivers/media/usb/em28xx/em28xx-input.c
@@ -812,6 +812,8 @@  static int em28xx_ir_fini(struct em28xx *dev)
 		return 0;
 	}
 
+	em28xx_info("Disconnecting input extension");
+
 	em28xx_shutdown_buttons(dev);
 
 	/* skip detach on non attached boards */
diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c
index dc10cec772ba..004fe12ceec7 100644
--- a/drivers/media/usb/em28xx/em28xx-video.c
+++ b/drivers/media/usb/em28xx/em28xx-video.c
@@ -1894,6 +1894,8 @@  static int em28xx_v4l2_fini(struct em28xx *dev)
 		return 0;
 	}
 
+	em28xx_info("Disconnecting video extension");
+
 	v4l2_device_disconnect(&dev->v4l2_dev);
 
 	em28xx_uninit_usb_xfer(dev, EM28XX_ANALOG_MODE);