From: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
To: Antti Palosaari <crope@iki.fi>
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>,
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: Mon, 3 Nov 2014 06:51:32 -0200 [thread overview]
Message-ID: <20141103065132.15d6498e@recife.lan> (raw)
In-Reply-To: <54566AB5.3020803@iki.fi>
Em Sun, 02 Nov 2014 19:32:37 +0200
Antti Palosaari <crope@iki.fi> escreveu:
>
>
> 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");
I changed the probe to be:
static int cx231xx_usb_probe(struct usb_interface *interface,
const struct usb_device_id *id)
{
struct usb_device *udev;
...
struct usb_interface_assoc_descriptor *assoc_desc;
udev = usb_get_dev(interface_to_usbdev(interface));
ifnum = interface->altsetting[0].desc.bInterfaceNumber;
dev_info(&interface->dev, "intf Hello World\n");
dev_info(&udev->dev, "udev Hello World\n");
The result is:
[54915.036082] cx231xx 1-2:1.2: intf Hello World
[54915.036090] usb 1-2: udev Hello World
[54915.036163] cx231xx 1-2:1.3: intf Hello World
[54915.036171] usb 1-2: udev Hello World
[54915.036197] cx231xx 1-2:1.4: intf Hello World
[54915.036204] usb 1-2: udev Hello World
[54915.036228] cx231xx 1-2:1.5: intf Hello World
[54915.036234] usb 1-2: udev Hello World
[54915.036258] cx231xx 1-2:1.6: intf Hello World
[54915.036264] usb 1-2: udev Hello World
Devices with multiple interfaces seem to have intf->dev filled with
a different device than udev->dev. The cx231xx is likely the most
complex device we have at media, as it has lots of interfaces, each
with lots of alternates, plus its 3 I2C physical buses and one I2C
mux internally.
I may work on a patch that would be storing intf->dev into
cx231xx dev struct. That's probably the easiest way for this
device.
Do you have any other idea?
Regards,
Mauro
next prev parent reply other threads:[~2014-11-03 8:51 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
2014-11-03 8:51 ` Mauro Carvalho Chehab [this message]
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=20141103065132.15d6498e@recife.lan \
--to=mchehab@osg.samsung.com \
--cc=crope@iki.fi \
--cc=hans.verkuil@cisco.com \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@infradead.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.