diff options
author | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2016-12-07 13:48:10 -0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-12-12 07:29:08 -0200 |
commit | 29b05e22f5c68c657f5ec30a31023b81124287fb (patch) | |
tree | 3c76e467ae57e57ba1af14837b1f599b838fcf61 /drivers/media/usb/em28xx/em28xx-cards.c | |
parent | ea48c3680829c0c522a799a4a9e0fb6cc5afd0a4 (diff) |
[media] em28xx: use usb_interface for dev_foo() calls
The usb_device->dev is not the right device for dev_foo() calls.
Instead, it should use usb_interface->dev.
Tested-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/usb/em28xx/em28xx-cards.c')
-rw-r--r-- | drivers/media/usb/em28xx/em28xx-cards.c | 61 |
1 files changed, 31 insertions, 30 deletions
diff --git a/drivers/media/usb/em28xx/em28xx-cards.c b/drivers/media/usb/em28xx/em28xx-cards.c index 50e4c6e51ee7..56739ce6ce16 100644 --- a/drivers/media/usb/em28xx/em28xx-cards.c +++ b/drivers/media/usb/em28xx/em28xx-cards.c @@ -2677,7 +2677,7 @@ static int em28xx_wait_until_ac97_features_equals(struct em28xx *dev, msleep(50); } - dev_warn(&dev->udev->dev, "AC97 registers access is not reliable !\n"); + dev_warn(&dev->intf->dev, "AC97 registers access is not reliable !\n"); return -ETIMEDOUT; } @@ -2831,7 +2831,7 @@ static int em28xx_hint_board(struct em28xx *dev) dev->model = em28xx_eeprom_hash[i].model; dev->tuner_type = em28xx_eeprom_hash[i].tuner; - dev_err(&dev->udev->dev, + dev_err(&dev->intf->dev, "Your board has no unique USB ID.\n" "A hint were successfully done, based on eeprom hash.\n" "This method is not 100%% failproof.\n" @@ -2861,7 +2861,7 @@ static int em28xx_hint_board(struct em28xx *dev) if (dev->i2c_hash == em28xx_i2c_hash[i].hash) { dev->model = em28xx_i2c_hash[i].model; dev->tuner_type = em28xx_i2c_hash[i].tuner; - dev_err(&dev->udev->dev, + dev_err(&dev->intf->dev, "Your board has no unique USB ID.\n" "A hint were successfully done, based on i2c devicelist hash.\n" "This method is not 100%% failproof.\n" @@ -2874,7 +2874,7 @@ static int em28xx_hint_board(struct em28xx *dev) } } - dev_err(&dev->udev->dev, + dev_err(&dev->intf->dev, "Your board has no unique USB ID and thus need a hint to be detected.\n" "You may try to use card=<n> insmod option to workaround that.\n" "Please send an email with this log to:\n" @@ -2883,10 +2883,10 @@ static int em28xx_hint_board(struct em28xx *dev) "Board i2c devicelist hash is 0x%08lx\n", dev->hash, dev->i2c_hash); - dev_err(&dev->udev->dev, + dev_err(&dev->intf->dev, "Here is a list of valid choices for the card=<n> insmod option:\n"); for (i = 0; i < em28xx_bcount; i++) { - dev_err(&dev->udev->dev, + dev_err(&dev->intf->dev, " card=%d -> %s\n", i, em28xx_boards[i].name); } return -1; @@ -2921,7 +2921,7 @@ static void em28xx_card_setup(struct em28xx *dev) * hash identities which has not been determined as yet. */ if (em28xx_hint_board(dev) < 0) - dev_err(&dev->udev->dev, "Board not discovered\n"); + dev_err(&dev->intf->dev, "Board not discovered\n"); else { em28xx_set_model(dev); em28xx_pre_card_setup(dev); @@ -2931,7 +2931,7 @@ static void em28xx_card_setup(struct em28xx *dev) em28xx_set_model(dev); } - dev_info(&dev->udev->dev, "Identified as %s (card=%d)\n", + dev_info(&dev->intf->dev, "Identified as %s (card=%d)\n", dev->board.name, dev->model); dev->tuner_type = em28xx_boards[dev->model].tuner_type; @@ -3030,7 +3030,7 @@ static void em28xx_card_setup(struct em28xx *dev) } if (dev->board.valid == EM28XX_BOARD_NOT_VALIDATED) { - dev_err(&dev->udev->dev, + dev_err(&dev->intf->dev, "\n\n" "The support for this board weren't valid yet.\n" "Please send a report of having this working\n" @@ -3161,7 +3161,7 @@ static int em28xx_media_device_init(struct em28xx *dev, else if (udev->manufacturer) media_device_usb_init(mdev, udev, udev->manufacturer); else - media_device_usb_init(mdev, udev, dev_name(&dev->udev->dev)); + media_device_usb_init(mdev, udev, dev_name(&dev->intf->dev)); dev->media_dev = mdev; #endif @@ -3217,7 +3217,7 @@ void em28xx_free_device(struct kref *ref) { struct em28xx *dev = kref_to_dev(ref); - dev_info(&dev->udev->dev, "Freeing device\n"); + dev_info(&dev->intf->dev, "Freeing device\n"); if (!dev->disconnected) em28xx_release_resources(dev); @@ -3239,6 +3239,7 @@ static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev, const char *chip_name = NULL; dev->udev = udev; + dev->intf = interface; mutex_init(&dev->ctrl_urb_lock); spin_lock_init(&dev->slock); @@ -3324,10 +3325,10 @@ static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev, } } if (!chip_name) - dev_info(&dev->udev->dev, + dev_info(&dev->intf->dev, "unknown em28xx chip ID (%d)\n", dev->chip_id); else - dev_info(&dev->udev->dev, "chip ID is %s\n", chip_name); + dev_info(&dev->intf->dev, "chip ID is %s\n", chip_name); em28xx_media_device_init(dev, udev); @@ -3346,7 +3347,7 @@ static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev, /* Resets I2C speed */ retval = em28xx_write_reg(dev, EM28XX_R06_I2C_CLK, dev->board.i2c_speed); if (retval < 0) { - dev_err(&dev->udev->dev, + dev_err(&dev->intf->dev, "%s: em28xx_write_reg failed! retval [%d]\n", __func__, retval); return retval; @@ -3361,7 +3362,7 @@ static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev, else retval = em28xx_i2c_register(dev, 0, EM28XX_I2C_ALGO_EM28XX); if (retval < 0) { - dev_err(&dev->udev->dev, + dev_err(&dev->intf->dev, "%s: em28xx_i2c_register bus 0 - error [%d]!\n", __func__, retval); return retval; @@ -3376,7 +3377,7 @@ static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev, retval = em28xx_i2c_register(dev, 1, EM28XX_I2C_ALGO_EM28XX); if (retval < 0) { - dev_err(&dev->udev->dev, + dev_err(&dev->intf->dev, "%s: em28xx_i2c_register bus 1 - error [%d]!\n", __func__, retval); @@ -3417,7 +3418,7 @@ static int em28xx_usb_probe(struct usb_interface *interface, nr = find_first_zero_bit(em28xx_devused, EM28XX_MAXBOARDS); if (nr >= EM28XX_MAXBOARDS) { /* No free device slots */ - dev_err(&udev->dev, + dev_err(&interface->dev, "Driver supports up to %i em28xx boards.\n", EM28XX_MAXBOARDS); retval = -ENOMEM; @@ -3427,7 +3428,7 @@ static int em28xx_usb_probe(struct usb_interface *interface, /* Don't register audio interfaces */ if (interface->altsetting[0].desc.bInterfaceClass == USB_CLASS_AUDIO) { - dev_err(&udev->dev, + dev_err(&interface->dev, "audio device (%04x:%04x): interface %i, class %i\n", le16_to_cpu(udev->descriptor.idVendor), le16_to_cpu(udev->descriptor.idProduct), @@ -3488,7 +3489,7 @@ static int em28xx_usb_probe(struct usb_interface *interface, if (usb_endpoint_xfer_isoc(e)) { has_vendor_audio = true; } else { - dev_err(&udev->dev, + dev_err(&interface->dev, "error: skipping audio endpoint 0x83, because it uses bulk transfers !\n"); } break; @@ -3562,7 +3563,7 @@ static int em28xx_usb_probe(struct usb_interface *interface, speed = "unknown"; } - dev_err(&udev->dev, + dev_err(&interface->dev, "New device %s %s @ %s Mbps (%04x:%04x, interface %d, class %d)\n", udev->manufacturer ? udev->manufacturer : "", udev->product ? udev->product : "", @@ -3578,8 +3579,8 @@ static int em28xx_usb_probe(struct usb_interface *interface, * not enough even for most Digital TV streams. */ if (udev->speed != USB_SPEED_HIGH && disable_usb_speed_check == 0) { - dev_err(&udev->dev, "Device initialization failed.\n"); - dev_err(&udev->dev, + dev_err(&interface->dev, "Device initialization failed.\n"); + dev_err(&interface->dev, "Device must be connected to a high-speed USB 2.0 port.\n"); retval = -ENODEV; goto err_free; @@ -3593,7 +3594,7 @@ static int em28xx_usb_probe(struct usb_interface *interface, dev->ifnum = ifnum; if (has_vendor_audio) { - dev_err(&udev->dev, + dev_err(&interface->dev, "Audio interface %i found (Vendor Class)\n", ifnum); dev->usb_audio_type = EM28XX_USB_AUDIO_VENDOR; } @@ -3603,7 +3604,7 @@ static int em28xx_usb_probe(struct usb_interface *interface, if (uif->altsetting[0].desc.bInterfaceClass == USB_CLASS_AUDIO) { if (has_vendor_audio) - dev_err(&udev->dev, + dev_err(&interface->dev, "em28xx: device seems to have vendor AND usb audio class interfaces !\n" "\t\tThe vendor interface will be ignored. Please contact the developers <linux-media@vger.kernel.org>\n"); dev->usb_audio_type = EM28XX_USB_AUDIO_CLASS; @@ -3612,12 +3613,12 @@ static int em28xx_usb_probe(struct usb_interface *interface, } if (has_video) - dev_err(&udev->dev, "Video interface %i found:%s%s\n", + dev_err(&interface->dev, "Video interface %i found:%s%s\n", ifnum, dev->analog_ep_bulk ? " bulk" : "", dev->analog_ep_isoc ? " isoc" : ""); if (has_dvb) - dev_err(&udev->dev, "DVB interface %i found:%s%s\n", + dev_err(&interface->dev, "DVB interface %i found:%s%s\n", ifnum, dev->dvb_ep_bulk ? " bulk" : "", dev->dvb_ep_isoc ? " isoc" : ""); @@ -3649,7 +3650,7 @@ static int em28xx_usb_probe(struct usb_interface *interface, /* Disable V4L2 if the device doesn't have a decoder */ if (has_video && dev->board.decoder == EM28XX_NODECODER && !dev->board.is_webcam) { - dev_err(&udev->dev, + dev_err(&interface->dev, "Currently, V4L2 is not supported on this model\n"); has_video = false; dev->has_video = false; @@ -3659,13 +3660,13 @@ static int em28xx_usb_probe(struct usb_interface *interface, if (has_video) { if (!dev->analog_ep_isoc || (try_bulk && dev->analog_ep_bulk)) dev->analog_xfer_bulk = 1; - dev_err(&udev->dev, "analog set to %s mode.\n", + dev_err(&interface->dev, "analog set to %s mode.\n", dev->analog_xfer_bulk ? "bulk" : "isoc"); } if (has_dvb) { if (!dev->dvb_ep_isoc || (try_bulk && dev->dvb_ep_bulk)) dev->dvb_xfer_bulk = 1; - dev_err(&udev->dev, "dvb set to %s mode.\n", + dev_err(&interface->dev, "dvb set to %s mode.\n", dev->dvb_xfer_bulk ? "bulk" : "isoc"); } @@ -3713,7 +3714,7 @@ static void em28xx_usb_disconnect(struct usb_interface *interface) dev->disconnected = 1; - dev_err(&dev->udev->dev, "Disconnecting\n"); + dev_err(&dev->intf->dev, "Disconnecting\n"); flush_request_modules(dev); |