diff options
author | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2014-11-03 12:07:38 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2014-11-03 20:59:59 +0300 |
commit | 336fea922936c114f68b8c0bcbff5fcfac3507d9 (patch) | |
tree | e196bb60d2c661f18b805f4e557e7179b08bdc71 /drivers/media/usb/cx231xx/cx231xx-i2c.c | |
parent | ac550faabd7cc63f3726e21063931cb0d286c59d (diff) | |
download | linux-336fea922936c114f68b8c0bcbff5fcfac3507d9.tar.xz |
[media] cx231xx: Improve the log message
Unfortunately, on devices that have multiple interfaces, udev->dev
points to the parent device (usb) instead of the cx231xx specific one.
Due to that the logs don't look too nice, as they'll print messages
as if they were produced by USB core:
usb-1-2: New device Conexant Corporation Polaris AV Capturb @ 480 Mbps (1554:5010) with 7 interfaces
Instead of using the name of the parent device, let's use the name
of the first cx231xx interface for all cx231xx sub-modules.
With this path, the logs will be nicer:
cx231xx 1-2:1.1: New device Conexant Corporation Polaris AV Capturb @ 480 Mbps (1554:5010) with 7 interfaces
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/usb/cx231xx/cx231xx-i2c.c')
-rw-r--r-- | drivers/media/usb/cx231xx/cx231xx-i2c.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/media/usb/cx231xx/cx231xx-i2c.c b/drivers/media/usb/cx231xx/cx231xx-i2c.c index 7ccc33d33664..a29c345b027d 100644 --- a/drivers/media/usb/cx231xx/cx231xx-i2c.c +++ b/drivers/media/usb/cx231xx/cx231xx-i2c.c @@ -507,7 +507,7 @@ void cx231xx_do_i2c_scan(struct cx231xx *dev, int i2c_port) rc = i2c_master_recv(&client, &buf, 0); if (rc < 0) continue; - dev_info(&dev->udev->dev, + dev_info(dev->dev, "i2c scan: found device @ port %d addr 0x%x [%s]\n", i2c_port, i << 1, @@ -528,7 +528,7 @@ int cx231xx_i2c_register(struct cx231xx_i2c *bus) BUG_ON(!dev->cx231xx_send_usb_command); bus->i2c_adap = cx231xx_adap_template; - bus->i2c_adap.dev.parent = &dev->udev->dev; + bus->i2c_adap.dev.parent = dev->dev; snprintf(bus->i2c_adap.name, sizeof(bus->i2c_adap.name), "%s-%d", bus->dev->name, bus->nr); @@ -537,7 +537,7 @@ int cx231xx_i2c_register(struct cx231xx_i2c *bus) i2c_add_adapter(&bus->i2c_adap); if (0 != bus->i2c_rc) - dev_warn(&dev->udev->dev, + dev_warn(dev->dev, "i2c bus %d register FAILED\n", bus->nr); return bus->i2c_rc; @@ -569,7 +569,7 @@ int cx231xx_i2c_mux_register(struct cx231xx *dev, int mux_no) { struct i2c_adapter *i2c_parent = &dev->i2c_bus[1].i2c_adap; /* what is the correct mux_dev? */ - struct device *mux_dev = &dev->udev->dev; + struct device *mux_dev = dev->dev; dev->i2c_mux_adap[mux_no] = i2c_add_mux_adapter(i2c_parent, mux_dev, @@ -581,7 +581,7 @@ int cx231xx_i2c_mux_register(struct cx231xx *dev, int mux_no) NULL); if (!dev->i2c_mux_adap[mux_no]) - dev_warn(&dev->udev->dev, + dev_warn(dev->dev, "i2c mux %d register FAILED\n", mux_no); return 0; |