linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <m.chehab@samsung.com>
To: "Frank Schäfer" <fschaefer.oss@googlemail.com>
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>,
	Mauro Carvalho Chehab <mchehab@infradead.org>
Subject: Re: [PATCH v4 07/22] [media] em28xx: improve extension information messages
Date: Sun, 05 Jan 2014 11:08:22 -0200	[thread overview]
Message-ID: <20140105110822.73fdbcb4@samsung.com> (raw)
In-Reply-To: <52C93A26.1070607@googlemail.com>

Em Sun, 05 Jan 2014 11:55:34 +0100
Frank Schäfer <fschaefer.oss@googlemail.com> escreveu:

> Am 04.01.2014 11:55, schrieb Mauro Carvalho Chehab:
> > Add a message with consistent prints before and after each
> > extension initialization, and provide a better text for module
> > load.
> >
> > While here, add a missing sanity check for extension finish
> > code at em28xx-v4l extension.
> >
> > Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
> > ---
> >  drivers/media/usb/em28xx/em28xx-audio.c |  4 +++-
> >  drivers/media/usb/em28xx/em28xx-core.c  |  2 +-
> >  drivers/media/usb/em28xx/em28xx-dvb.c   |  7 ++++---
> >  drivers/media/usb/em28xx/em28xx-input.c |  4 ++++
> >  drivers/media/usb/em28xx/em28xx-video.c | 10 ++++++++--
> >  5 files changed, 20 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/media/usb/em28xx/em28xx-audio.c b/drivers/media/usb/em28xx/em28xx-audio.c
> > index 2fdb66ee44ab..263886adcf26 100644
> > --- a/drivers/media/usb/em28xx/em28xx-audio.c
> > +++ b/drivers/media/usb/em28xx/em28xx-audio.c
> > @@ -649,7 +649,8 @@ static int em28xx_audio_init(struct em28xx *dev)
> >  		return 0;
> >  	}
> >  
> > -	printk(KERN_INFO "em28xx-audio.c: probing for em28xx Audio Vendor Class\n");
> > +	em28xx_info("Binding audio extension\n");
> > +
> >  	printk(KERN_INFO "em28xx-audio.c: Copyright (C) 2006 Markus "
> >  			 "Rechberger\n");
> >  	printk(KERN_INFO "em28xx-audio.c: Copyright (C) 2007-2011 Mauro Carvalho Chehab\n");
> > @@ -702,6 +703,7 @@ static int em28xx_audio_init(struct em28xx *dev)
> >  	adev->sndcard = card;
> >  	adev->udev = dev->udev;
> >  
> > +	em28xx_info("Audio extension successfully initialized\n");
> >  	return 0;
> >  }
> >  
> > diff --git a/drivers/media/usb/em28xx/em28xx-core.c b/drivers/media/usb/em28xx/em28xx-core.c
> > index 1113d4e107d8..33cf26e106b5 100644
> > --- a/drivers/media/usb/em28xx/em28xx-core.c
> > +++ b/drivers/media/usb/em28xx/em28xx-core.c
> > @@ -1069,7 +1069,7 @@ int em28xx_register_extension(struct em28xx_ops *ops)
> >  		ops->init(dev);
> >  	}
> >  	mutex_unlock(&em28xx_devlist_mutex);
> > -	printk(KERN_INFO "Em28xx: Initialized (%s) extension\n", ops->name);
> > +	printk(KERN_INFO "em28xx: Registered (%s) extension\n", ops->name);
> >  	return 0;
> >  }
> >  EXPORT_SYMBOL(em28xx_register_extension);
> > diff --git a/drivers/media/usb/em28xx/em28xx-dvb.c b/drivers/media/usb/em28xx/em28xx-dvb.c
> > index ddc0e609065d..f72663a9b5c5 100644
> > --- a/drivers/media/usb/em28xx/em28xx-dvb.c
> > +++ b/drivers/media/usb/em28xx/em28xx-dvb.c
> > @@ -274,7 +274,7 @@ static int em28xx_stop_feed(struct dvb_demux_feed *feed)
> >  static int em28xx_dvb_bus_ctrl(struct dvb_frontend *fe, int acquire)
> >  {
> >  	struct em28xx_i2c_bus *i2c_bus = fe->dvb->priv;
> > -        struct em28xx *dev = i2c_bus->dev;
> > +	struct em28xx *dev = i2c_bus->dev;
> >  
> >  	if (acquire)
> >  		return em28xx_set_mode(dev, EM28XX_DIGITAL_MODE);
> > @@ -992,10 +992,11 @@ static int em28xx_dvb_init(struct em28xx *dev)
> >  
> >  	if (!dev->board.has_dvb) {
> >  		/* This device does not support the extension */
> > -		printk(KERN_INFO "em28xx_dvb: This device does not support the extension\n");
> >  		return 0;
> >  	}
> >  
> > +	em28xx_info("Binding DVB extension\n");
> > +
> >  	dvb = kzalloc(sizeof(struct em28xx_dvb), GFP_KERNEL);
> >  
> >  	if (dvb == NULL) {
> > @@ -1407,7 +1408,7 @@ static int em28xx_dvb_init(struct em28xx *dev)
> >  	/* MFE lock */
> >  	dvb->adapter.mfe_shared = mfe_shared;
> >  
> > -	em28xx_info("Successfully loaded em28xx-dvb\n");
> > +	em28xx_info("DVB extension successfully initialized\n");
> >  ret:
> >  	em28xx_set_mode(dev, EM28XX_SUSPEND);
> >  	mutex_unlock(&dev->lock);
> > diff --git a/drivers/media/usb/em28xx/em28xx-input.c b/drivers/media/usb/em28xx/em28xx-input.c
> > index 93a7d02b9cb4..eed7dd79f734 100644
> > --- a/drivers/media/usb/em28xx/em28xx-input.c
> > +++ b/drivers/media/usb/em28xx/em28xx-input.c
> > @@ -692,6 +692,8 @@ static int em28xx_ir_init(struct em28xx *dev)
> >  		return 0;
> >  	}
> >  
> > +	em28xx_info("Registering input extension\n");
> > +
> >  	ir = kzalloc(sizeof(*ir), GFP_KERNEL);
> >  	rc = rc_allocate_device();
> >  	if (!ir || !rc)
> > @@ -785,6 +787,8 @@ static int em28xx_ir_init(struct em28xx *dev)
> >  	if (err)
> >  		goto error;
> >  
> > +	em28xx_info("Input extension successfully initalized\n");
> > +
> >  	return 0;
> >  
> >  error:
> > diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c
> > index 56d1b46164a0..b767262c642b 100644
> > --- a/drivers/media/usb/em28xx/em28xx-video.c
> > +++ b/drivers/media/usb/em28xx/em28xx-video.c
> > @@ -1884,6 +1884,11 @@ static int em28xx_v4l2_fini(struct em28xx *dev)
> >  
> >  	/*FIXME: I2C IR should be disconnected */
> >  
> > +	if (!dev->has_video) {
> > +		/* This device does not support the v4l2 extension */
> > +		return 0;
> > +	}
> > +
> That's a separate change and AFAICS it's not needed.

It is needed. If you plug a device with video first and then a DVB-only device,
as em28xx-v4l will be loaded, it will initialize the extension, if this code got
removed.

I can move it to a separate patch adding the proper description.

> >  	if (dev->radio_dev) {
> >  		if (video_is_registered(dev->radio_dev))
> >  			video_unregister_device(dev->radio_dev);
> > @@ -2215,8 +2220,7 @@ static int em28xx_v4l2_init(struct em28xx *dev)
> >  		return 0;
> >  	}
> >  
> > -	printk(KERN_INFO "%s: v4l2 driver version %s\n",
> > -		dev->name, EM28XX_VERSION);
> > +	em28xx_info("Registering V4L2 extension\n");
> >  
> >  	mutex_lock(&dev->lock);
> >  
> > @@ -2498,6 +2502,8 @@ static int em28xx_v4l2_init(struct em28xx *dev)
> >  	/* initialize videobuf2 stuff */
> >  	em28xx_vb2_setup(dev);
> >  
> > +	em28xx_info("V4L2 extension successfully initialized\n");
> > +
> >  err:
> >  	mutex_unlock(&dev->lock);
> >  	return ret;
> 


-- 

Cheers,
Mauro

  reply	other threads:[~2014-01-05 13:08 UTC|newest]

Thread overview: 80+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-04 10:55 [PATCH v4 00/22] em28xx: split analog part into a separate module Mauro Carvalho Chehab
2014-01-04 10:55 ` [PATCH v4 01/22] [media] em28xx: move some video-specific functions to em28xx-video Mauro Carvalho Chehab
2014-01-05 10:11   ` Frank Schäfer
2014-01-05 13:28     ` Mauro Carvalho Chehab
2014-01-04 10:55 ` [PATCH v4 02/22] [media] em28xx: some cosmetic changes Mauro Carvalho Chehab
2014-01-05 10:13   ` Frank Schäfer
2014-01-04 10:55 ` [PATCH v4 03/22] [media] em28xx: move analog-specific init to em28xx-video Mauro Carvalho Chehab
2014-01-05 10:26   ` Frank Schäfer
2014-01-05 14:40     ` Mauro Carvalho Chehab
2014-01-06 21:28       ` Frank Schäfer
2014-01-04 10:55 ` [PATCH v4 04/22] [media] em28xx: make em28xx-video to be a separate module Mauro Carvalho Chehab
2014-01-05 10:47   ` Frank Schäfer
2014-01-05 12:56     ` Mauro Carvalho Chehab
2014-01-05 15:18       ` Mauro Carvalho Chehab
2014-01-06 21:35         ` Frank Schäfer
2014-01-06 17:38       ` Frank Schäfer
2014-01-04 10:55 ` [PATCH v4 05/22] [media] em28xx: initialize analog I2C devices at the right place Mauro Carvalho Chehab
2014-01-05 10:48   ` Frank Schäfer
2014-01-04 10:55 ` [PATCH v4 06/22] [media] em28xx: add warn messages for timeout Mauro Carvalho Chehab
2014-01-05 10:51   ` Frank Schäfer
2014-01-05 13:05     ` Mauro Carvalho Chehab
2014-01-05 13:25     ` Mauro Carvalho Chehab
2014-01-04 10:55 ` [PATCH v4 07/22] [media] em28xx: improve extension information messages Mauro Carvalho Chehab
2014-01-05 10:55   ` Frank Schäfer
2014-01-05 13:08     ` Mauro Carvalho Chehab [this message]
2014-01-05 15:31       ` Mauro Carvalho Chehab
2014-01-06 17:44       ` Frank Schäfer
2014-01-06 18:17         ` Mauro Carvalho Chehab
2014-01-04 10:55 ` [PATCH v4 08/22] [media] em28xx: convert i2c wait completion logic to use jiffies Mauro Carvalho Chehab
2014-01-05 11:03   ` Frank Schäfer
2014-01-05 13:10     ` Mauro Carvalho Chehab
2014-01-06 17:48       ` Frank Schäfer
2014-01-04 10:55 ` [PATCH v4 09/22] [media] tvp5150: make read operations atomic Mauro Carvalho Chehab
2014-01-05 11:07   ` Frank Schäfer
2014-01-04 10:55 ` [PATCH v4 10/22] [media] tuner-xc2028: remove unused code Mauro Carvalho Chehab
2014-01-05 11:07   ` Frank Schäfer
2014-01-04 10:55 ` [PATCH v4 11/22] [media] em28xx: check if a device has audio earlier Mauro Carvalho Chehab
2014-01-05 11:12   ` Frank Schäfer
2014-01-05 13:22     ` Mauro Carvalho Chehab
2014-01-04 10:55 ` [PATCH v4 12/22] [media] em28xx: properly implement AC97 wait code Mauro Carvalho Chehab
2014-01-05 11:19   ` Frank Schäfer
2014-01-05 13:20     ` Mauro Carvalho Chehab
2014-01-05 15:44       ` Mauro Carvalho Chehab
2014-01-07 16:50         ` Frank Schäfer
2014-01-04 10:55 ` [PATCH v4 13/22] [media] em28xx: initialize audio latter Mauro Carvalho Chehab
2014-01-05 11:29   ` Frank Schäfer
2014-01-05 13:17     ` Mauro Carvalho Chehab
2014-01-07 17:00       ` Frank Schäfer
2014-01-08 14:29         ` Mauro Carvalho Chehab
2014-01-04 10:55 ` [PATCH v4 14/22] [media] em28xx: unify module version Mauro Carvalho Chehab
2014-01-05 11:33   ` Frank Schäfer
2014-01-04 10:55 ` [PATCH v4 15/22] [media] em28xx: Fix em28xx deplock Mauro Carvalho Chehab
2014-01-05 11:38   ` Frank Schäfer
2014-01-04 10:55 ` [PATCH v4 16/22] [media] em28xx: use a better value for I2C timeouts Mauro Carvalho Chehab
2014-01-05 20:38   ` Frank Schäfer
2014-01-05 20:57     ` Mauro Carvalho Chehab
2014-01-07 17:15       ` Frank Schäfer
2014-01-08 14:39         ` Mauro Carvalho Chehab
2014-01-04 10:55 ` [PATCH v4 17/22] [media] em28xx-i2c: Fix error code for I2C error transfers Mauro Carvalho Chehab
2014-01-05 20:40   ` Frank Schäfer
2014-01-06  9:55     ` Mauro Carvalho Chehab
2014-01-07 17:28       ` Frank Schäfer
2014-01-08 11:55         ` Mauro Carvalho Chehab
2014-01-08 19:37           ` Frank Schäfer
2014-01-04 10:55 ` [PATCH v4 18/22] [media] em28xx: don't return -ENODEV for I2C xfer errors Mauro Carvalho Chehab
2014-01-05 20:49   ` Frank Schäfer
2014-01-06 10:37     ` Mauro Carvalho Chehab
2014-01-04 10:55 ` [PATCH v4 19/22] [media] em28xx: cleanup I2C debug messages Mauro Carvalho Chehab
2014-01-05 20:54   ` Frank Schäfer
2014-01-04 10:55 ` [PATCH v4 20/22] [media] em28xx: use usb_alloc_coherent() for audio Mauro Carvalho Chehab
2014-01-05 20:57   ` Frank Schäfer
2014-01-04 10:55 ` [PATCH v4 21/22] [media] em28xx-audio: allocate URBs at device driver init Mauro Carvalho Chehab
2014-01-05 21:02   ` Frank Schäfer
2014-01-05 21:25     ` Mauro Carvalho Chehab
2014-01-06 16:25       ` Mauro Carvalho Chehab
2014-01-07 17:03       ` Frank Schäfer
2014-01-08 14:10         ` Mauro Carvalho Chehab
2014-01-08 19:14           ` Frank Schäfer
2014-01-04 10:55 ` [PATCH v4 22/22] [media] em28xx: retry read operation if it fails Mauro Carvalho Chehab
2014-01-05 21:06   ` Frank Schäfer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140105110822.73fdbcb4@samsung.com \
    --to=m.chehab@samsung.com \
    --cc=fschaefer.oss@googlemail.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).