From: Antti Palosaari <crope@iki.fi>
To: Mauro Carvalho Chehab <mchehab@osg.samsung.com>,
Linux Media Mailing List <linux-media@vger.kernel.org>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>,
Matthias Schwarzott <zzam@gentoo.org>,
Hans Verkuil <hans.verkuil@cisco.com>
Subject: Re: [PATCHv2 12/14] [media] cx231xx: use dev_info() for extension load/unload
Date: Sun, 02 Nov 2014 19:32:37 +0200 [thread overview]
Message-ID: <54566AB5.3020803@iki.fi> (raw)
In-Reply-To: <58369096f1fee7d71942eae7a40db6d7c1c368bf.1414929816.git.mchehab@osg.samsung.com>
On 11/02/2014 02:32 PM, Mauro Carvalho Chehab wrote:
> Now that we're using dev_foo, the logs become like:
>
> usb 1-2: DVB: registering adapter 0 frontend 0 (Fujitsu mb86A20s)...
> usb 1-2: Successfully loaded cx231xx-dvb
> cx231xx: Cx231xx dvb Extension initialized
>
> It is not clear, by the logs, that usb 1-2 name is an alias for
> cx231xx. So, we also need to use dvb_info() at extension load/unload.
>
> After the patch, it will print:
> usb 1-2: Cx231xx dvb Extension initialized
>
> With is coherent with the other logs.
That is not correct as wrong device pointer passed to dev_. Go cx231xx
usb driver probe function and add following test log to see how is
should look like:
dev_info(&intf->dev, "Hello World\n");
It prints something like
cx231xx 1-2-1: Hello World
regards
Antti
>
> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
>
> diff --git a/drivers/media/usb/cx231xx/cx231xx-core.c b/drivers/media/usb/cx231xx/cx231xx-core.c
> index 36c3ecf204c1..64e907f02a02 100644
> --- a/drivers/media/usb/cx231xx/cx231xx-core.c
> +++ b/drivers/media/usb/cx231xx/cx231xx-core.c
> @@ -98,10 +98,10 @@ int cx231xx_register_extension(struct cx231xx_ops *ops)
>
> mutex_lock(&cx231xx_devlist_mutex);
> list_add_tail(&ops->next, &cx231xx_extension_devlist);
> - list_for_each_entry(dev, &cx231xx_devlist, devlist)
> + list_for_each_entry(dev, &cx231xx_devlist, devlist) {
> ops->init(dev);
> -
> - printk(KERN_INFO DRIVER_NAME ": %s initialized\n", ops->name);
> + dev_info(&dev->udev->dev, "%s initialized\n", ops->name);
> + }
> mutex_unlock(&cx231xx_devlist_mutex);
> return 0;
> }
> @@ -112,11 +112,11 @@ void cx231xx_unregister_extension(struct cx231xx_ops *ops)
> struct cx231xx *dev = NULL;
>
> mutex_lock(&cx231xx_devlist_mutex);
> - list_for_each_entry(dev, &cx231xx_devlist, devlist)
> + list_for_each_entry(dev, &cx231xx_devlist, devlist) {
> ops->fini(dev);
> + dev_info(&dev->udev->dev, "%s removed\n", ops->name);
> + }
>
> -
> - printk(KERN_INFO DRIVER_NAME ": %s removed\n", ops->name);
> list_del(&ops->next);
> mutex_unlock(&cx231xx_devlist_mutex);
> }
>
--
http://palosaari.fi/
next prev parent reply other threads:[~2014-11-02 17:32 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-02 12:32 [PATCHv2 00/14] Reduce cx231xx verbosity and do some cleanups Mauro Carvalho Chehab
2014-11-02 12:32 ` [PATCHv2 01/14] [media] cx231xx: get rid of driver-defined printk macros Mauro Carvalho Chehab
2014-11-02 12:32 ` [PATCHv2 02/14] [media] cx231xx: Fix identation Mauro Carvalho Chehab
2014-11-02 12:32 ` [PATCHv2 03/14] [media] cx231xx: Cleanup printk at the driver Mauro Carvalho Chehab
2014-11-02 12:32 ` [PATCHv2 04/14] [media] cx25840: Don't report an error if max size is adjusted Mauro Carvalho Chehab
2014-11-02 12:32 ` [PATCHv2 05/14] [media] cx25840: convert max_buf_size var to lowercase Mauro Carvalho Chehab
2014-11-02 12:32 ` [PATCHv2 06/14] [media] cx231xx: use 1 byte read for i2c scan Mauro Carvalho Chehab
2014-11-02 12:32 ` [PATCHv2 07/14] [media] cx231xx: disable I2C errors during i2c_scan Mauro Carvalho Chehab
2014-11-02 12:32 ` [PATCHv2 08/14] [media] cx231xx: convert from pr_foo to dev_foo Mauro Carvalho Chehab
2014-11-02 12:32 ` [PATCHv2 09/14] [media] cx231xx: get rid of audio debug parameter Mauro Carvalho Chehab
2014-11-02 12:32 ` [PATCHv2 10/14] [media] cx231xx: use dev_foo instead of printk Mauro Carvalho Chehab
2014-11-02 12:32 ` [PATCHv2 11/14] [media] cx231xx: add addr for demod and make i2c_devs const Mauro Carvalho Chehab
2014-11-02 12:32 ` [PATCHv2 12/14] [media] cx231xx: use dev_info() for extension load/unload Mauro Carvalho Chehab
2014-11-02 17:32 ` Antti Palosaari [this message]
2014-11-03 8:51 ` Mauro Carvalho Chehab
2014-11-02 12:32 ` [PATCHv2 13/14] [media] cx231xx: too much changes. Bump version number Mauro Carvalho Chehab
2014-11-02 12:32 ` [PATCHv2 14/14] [media] cx231xx: simplify I2C scan debug messages Mauro Carvalho Chehab
2014-11-02 12:37 ` [PATCHv2 00/14] Reduce cx231xx verbosity and do some cleanups Mauro Carvalho Chehab
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=54566AB5.3020803@iki.fi \
--to=crope@iki.fi \
--cc=hans.verkuil@cisco.com \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@infradead.org \
--cc=mchehab@osg.samsung.com \
--cc=zzam@gentoo.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