Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ce8591ff authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab
Browse files

[media] em28xx: convert it from pr_foo() to dev_foo()



Instead of using pr_foo(), use dev_foo(), with provides a
better output. As this device is a multi-interface one,
we'll set the device name to show the chipset and the driver
used.

While here, get rid of printk continuation messages.

Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 39ad799a
Loading
Loading
Loading
Loading
+37 −27
Original line number Original line Diff line number Diff line
@@ -56,8 +56,9 @@ MODULE_PARM_DESC(debug, "activates debug info");


#define dprintk(fmt, arg...) do {					\
#define dprintk(fmt, arg...) do {					\
	if (debug)						\
	if (debug)						\
		printk(KERN_DEBUG pr_fmt("audio: %s: " fmt),		\
		dev_printk(KERN_DEBUG, &dev->udev->dev,			\
			 __func__, ##arg); } while (0)
			   "video: %s: " fmt, __func__, ## arg);	\
} while (0)


static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;


@@ -91,7 +92,8 @@ static void em28xx_audio_isocirq(struct urb *urb)
	struct snd_pcm_runtime   *runtime;
	struct snd_pcm_runtime   *runtime;


	if (dev->disconnected) {
	if (dev->disconnected) {
		dprintk("device disconnected while streaming. URB status=%d.\n", urb->status);
		dprintk("device disconnected while streaming. URB status=%d.\n",
			urb->status);
		atomic_set(&dev->adev.stream_started, 0);
		atomic_set(&dev->adev.stream_started, 0);
		return;
		return;
	}
	}
@@ -164,7 +166,8 @@ static void em28xx_audio_isocirq(struct urb *urb)


	status = usb_submit_urb(urb, GFP_ATOMIC);
	status = usb_submit_urb(urb, GFP_ATOMIC);
	if (status < 0)
	if (status < 0)
		pr_err("resubmit of audio urb failed (error=%i)\n",
		dev_err(&dev->udev->dev,
			"resubmit of audio urb failed (error=%i)\n",
			status);
			status);
	return;
	return;
}
}
@@ -182,7 +185,8 @@ static int em28xx_init_audio_isoc(struct em28xx *dev)


		errCode = usb_submit_urb(dev->adev.urb[i], GFP_ATOMIC);
		errCode = usb_submit_urb(dev->adev.urb[i], GFP_ATOMIC);
		if (errCode) {
		if (errCode) {
			pr_err("submit of audio urb failed (error=%i)\n",
			dev_err(&dev->udev->dev,
				"submit of audio urb failed (error=%i)\n",
				errCode);
				errCode);
			em28xx_deinit_isoc_audio(dev);
			em28xx_deinit_isoc_audio(dev);
			atomic_set(&dev->adev.stream_started, 0);
			atomic_set(&dev->adev.stream_started, 0);
@@ -197,6 +201,7 @@ static int em28xx_init_audio_isoc(struct em28xx *dev)
static int snd_pcm_alloc_vmalloc_buffer(struct snd_pcm_substream *subs,
static int snd_pcm_alloc_vmalloc_buffer(struct snd_pcm_substream *subs,
					size_t size)
					size_t size)
{
{
	struct em28xx *dev = snd_pcm_substream_chip(subs);
	struct snd_pcm_runtime *runtime = subs->runtime;
	struct snd_pcm_runtime *runtime = subs->runtime;


	dprintk("Allocating vbuffer\n");
	dprintk("Allocating vbuffer\n");
@@ -254,7 +259,8 @@ static int snd_em28xx_capture_open(struct snd_pcm_substream *substream)
	int nonblock, ret = 0;
	int nonblock, ret = 0;


	if (!dev) {
	if (!dev) {
		pr_err("BUG: em28xx can't find device struct. Can't proceed with open\n");
		dev_err(&dev->udev->dev,
			"BUG: em28xx can't find device struct. Can't proceed with open\n");
		return -ENODEV;
		return -ENODEV;
	}
	}


@@ -317,7 +323,8 @@ static int snd_em28xx_capture_open(struct snd_pcm_substream *substream)
err:
err:
	mutex_unlock(&dev->lock);
	mutex_unlock(&dev->lock);


	pr_err("Error while configuring em28xx mixer\n");
	dev_err(&dev->udev->dev,
		"Error while configuring em28xx mixer\n");
	return ret;
	return ret;
}
}


@@ -755,7 +762,7 @@ static int em28xx_audio_urb_init(struct em28xx *dev)
	intf = usb_ifnum_to_if(dev->udev, dev->ifnum);
	intf = usb_ifnum_to_if(dev->udev, dev->ifnum);


	if (intf->num_altsetting <= alt) {
	if (intf->num_altsetting <= alt) {
		pr_err("alt %d doesn't exist on interface %d\n",
		dev_err(&dev->udev->dev, "alt %d doesn't exist on interface %d\n",
			      dev->ifnum, alt);
			      dev->ifnum, alt);
		return -ENODEV;
		return -ENODEV;
	}
	}
@@ -771,18 +778,17 @@ static int em28xx_audio_urb_init(struct em28xx *dev)
	}
	}


	if (!ep) {
	if (!ep) {
		pr_err("Couldn't find an audio endpoint");
		dev_err(&dev->udev->dev, "Couldn't find an audio endpoint");
		return -ENODEV;
		return -ENODEV;
	}
	}


	ep_size = em28xx_audio_ep_packet_size(dev->udev, ep);
	ep_size = em28xx_audio_ep_packet_size(dev->udev, ep);
	interval = 1 << (ep->bInterval - 1);
	interval = 1 << (ep->bInterval - 1);


	pr_info("Endpoint 0x%02x %s on intf %d alt %d interval = %d, size %d\n",
	dev_info(&dev->udev->dev,
		 "Endpoint 0x%02x %s on intf %d alt %d interval = %d, size %d\n",
		 EM28XX_EP_AUDIO, usb_speed_string(dev->udev->speed),
		 EM28XX_EP_AUDIO, usb_speed_string(dev->udev->speed),
		     dev->ifnum, alt,
		 dev->ifnum, alt, interval, ep_size);
		     interval,
		     ep_size);


	/* Calculate the number and size of URBs to better fit the audio samples */
	/* Calculate the number and size of URBs to better fit the audio samples */


@@ -819,7 +825,8 @@ static int em28xx_audio_urb_init(struct em28xx *dev)
	if (urb_size > ep_size * npackets)
	if (urb_size > ep_size * npackets)
		npackets = DIV_ROUND_UP(urb_size, ep_size);
		npackets = DIV_ROUND_UP(urb_size, ep_size);


	pr_info("Number of URBs: %d, with %d packets and %d size\n",
	dev_info(&dev->udev->dev,
		 "Number of URBs: %d, with %d packets and %d size\n",
		 num_urb, npackets, urb_size);
		 num_urb, npackets, urb_size);


	/* Estimate the bytes per period */
	/* Estimate the bytes per period */
@@ -857,7 +864,8 @@ static int em28xx_audio_urb_init(struct em28xx *dev)
		buf = usb_alloc_coherent(dev->udev, npackets * ep_size, GFP_ATOMIC,
		buf = usb_alloc_coherent(dev->udev, npackets * ep_size, GFP_ATOMIC,
					 &urb->transfer_dma);
					 &urb->transfer_dma);
		if (!buf) {
		if (!buf) {
			pr_err("usb_alloc_coherent failed!\n");
			dev_err(&dev->udev->dev,
				"usb_alloc_coherent failed!\n");
			em28xx_audio_free_urb(dev);
			em28xx_audio_free_urb(dev);
			return -ENOMEM;
			return -ENOMEM;
		}
		}
@@ -897,12 +905,14 @@ static int em28xx_audio_init(struct em28xx *dev)
		return 0;
		return 0;
	}
	}


	pr_info("Binding audio extension\n");
	dev_info(&dev->udev->dev, "Binding audio extension\n");


	kref_get(&dev->ref);
	kref_get(&dev->ref);


	pr_info("em28xx-audio.c: Copyright (C) 2006 Markus Rechberger\n");
	dev_info(&dev->udev->dev,
	pr_info("em28xx-audio.c: Copyright (C) 2007-2016 Mauro Carvalho Chehab\n");
		 "em28xx-audio.c: Copyright (C) 2006 Markus Rechberger\n");
	dev_info(&dev->udev->dev,
		 "em28xx-audio.c: Copyright (C) 2007-2016 Mauro Carvalho Chehab\n");


	err = snd_card_new(&dev->udev->dev, index[devnr], "Em28xx Audio",
	err = snd_card_new(&dev->udev->dev, index[devnr], "Em28xx Audio",
			   THIS_MODULE, 0, &card);
			   THIS_MODULE, 0, &card);
@@ -952,7 +962,7 @@ static int em28xx_audio_init(struct em28xx *dev)
	if (err < 0)
	if (err < 0)
		goto urb_free;
		goto urb_free;


	pr_info("Audio extension successfully initialized\n");
	dev_info(&dev->udev->dev, "Audio extension successfully initialized\n");
	return 0;
	return 0;


urb_free:
urb_free:
@@ -977,7 +987,7 @@ static int em28xx_audio_fini(struct em28xx *dev)
		return 0;
		return 0;
	}
	}


	pr_info("Closing audio extension\n");
	dev_info(&dev->udev->dev, "Closing audio extension\n");


	if (dev->adev.sndcard) {
	if (dev->adev.sndcard) {
		snd_card_disconnect(dev->adev.sndcard);
		snd_card_disconnect(dev->adev.sndcard);
@@ -1001,7 +1011,7 @@ static int em28xx_audio_suspend(struct em28xx *dev)
	if (dev->usb_audio_type != EM28XX_USB_AUDIO_VENDOR)
	if (dev->usb_audio_type != EM28XX_USB_AUDIO_VENDOR)
		return 0;
		return 0;


	pr_info("Suspending audio extension\n");
	dev_info(&dev->udev->dev, "Suspending audio extension\n");
	em28xx_deinit_isoc_audio(dev);
	em28xx_deinit_isoc_audio(dev);
	atomic_set(&dev->adev.stream_started, 0);
	atomic_set(&dev->adev.stream_started, 0);
	return 0;
	return 0;
@@ -1015,7 +1025,7 @@ static int em28xx_audio_resume(struct em28xx *dev)
	if (dev->usb_audio_type != EM28XX_USB_AUDIO_VENDOR)
	if (dev->usb_audio_type != EM28XX_USB_AUDIO_VENDOR)
		return 0;
		return 0;


	pr_info("Resuming audio extension\n");
	dev_info(&dev->udev->dev, "Resuming audio extension\n");
	/* Nothing to do other than schedule_work() ?? */
	/* Nothing to do other than schedule_work() ?? */
	schedule_work(&dev->adev.wq_trigger);
	schedule_work(&dev->adev.wq_trigger);
	return 0;
	return 0;
+38 −22
Original line number Original line Diff line number Diff line
@@ -22,6 +22,7 @@
#include "em28xx.h"
#include "em28xx.h"


#include <linux/i2c.h>
#include <linux/i2c.h>
#include <linux/usb.h>
#include <media/soc_camera.h>
#include <media/soc_camera.h>
#include <media/i2c/mt9v011.h>
#include <media/i2c/mt9v011.h>
#include <media/v4l2-clk.h>
#include <media/v4l2-clk.h>
@@ -120,13 +121,15 @@ static int em28xx_probe_sensor_micron(struct em28xx *dev)
		ret = i2c_master_send(&client, &reg, 1);
		ret = i2c_master_send(&client, &reg, 1);
		if (ret < 0) {
		if (ret < 0) {
			if (ret != -ENXIO)
			if (ret != -ENXIO)
				pr_err("couldn't read from i2c device 0x%02x: error %i\n",
				dev_err(&dev->udev->dev,
					"couldn't read from i2c device 0x%02x: error %i\n",
				       client.addr << 1, ret);
				       client.addr << 1, ret);
			continue;
			continue;
		}
		}
		ret = i2c_master_recv(&client, (u8 *)&id_be, 2);
		ret = i2c_master_recv(&client, (u8 *)&id_be, 2);
		if (ret < 0) {
		if (ret < 0) {
			pr_err("couldn't read from i2c device 0x%02x: error %i\n",
			dev_err(&dev->udev->dev,
				"couldn't read from i2c device 0x%02x: error %i\n",
				client.addr << 1, ret);
				client.addr << 1, ret);
			continue;
			continue;
		}
		}
@@ -135,13 +138,15 @@ static int em28xx_probe_sensor_micron(struct em28xx *dev)
		reg = 0xff;
		reg = 0xff;
		ret = i2c_master_send(&client, &reg, 1);
		ret = i2c_master_send(&client, &reg, 1);
		if (ret < 0) {
		if (ret < 0) {
			pr_err("couldn't read from i2c device 0x%02x: error %i\n",
			dev_err(&dev->udev->dev,
				"couldn't read from i2c device 0x%02x: error %i\n",
				client.addr << 1, ret);
				client.addr << 1, ret);
			continue;
			continue;
		}
		}
		ret = i2c_master_recv(&client, (u8 *)&id_be, 2);
		ret = i2c_master_recv(&client, (u8 *)&id_be, 2);
		if (ret < 0) {
		if (ret < 0) {
			pr_err("couldn't read from i2c device 0x%02x: error %i\n",
			dev_err(&dev->udev->dev,
				"couldn't read from i2c device 0x%02x: error %i\n",
				client.addr << 1, ret);
				client.addr << 1, ret);
			continue;
			continue;
		}
		}
@@ -180,14 +185,17 @@ static int em28xx_probe_sensor_micron(struct em28xx *dev)
			dev->em28xx_sensor = EM28XX_MT9M001;
			dev->em28xx_sensor = EM28XX_MT9M001;
			break;
			break;
		default:
		default:
			pr_info("unknown Micron sensor detected: 0x%04x\n", id);
			dev_info(&dev->udev->dev,
				 "unknown Micron sensor detected: 0x%04x\n", id);
			return 0;
			return 0;
		}
		}


		if (dev->em28xx_sensor == EM28XX_NOSENSOR)
		if (dev->em28xx_sensor == EM28XX_NOSENSOR)
			pr_info("unsupported sensor detected: %s\n", name);
			dev_info(&dev->udev->dev,
				 "unsupported sensor detected: %s\n", name);
		else
		else
			pr_info("sensor %s detected\n", name);
			dev_info(&dev->udev->dev,
				 "sensor %s detected\n", name);


		dev->i2c_client[dev->def_i2c_bus].addr = client.addr;
		dev->i2c_client[dev->def_i2c_bus].addr = client.addr;
		return 0;
		return 0;
@@ -217,7 +225,8 @@ static int em28xx_probe_sensor_omnivision(struct em28xx *dev)
		ret = i2c_smbus_read_byte_data(&client, reg);
		ret = i2c_smbus_read_byte_data(&client, reg);
		if (ret < 0) {
		if (ret < 0) {
			if (ret != -ENXIO)
			if (ret != -ENXIO)
				pr_err("couldn't read from i2c device 0x%02x: error %i\n",
				dev_err(&dev->udev->dev,
					"couldn't read from i2c device 0x%02x: error %i\n",
					client.addr << 1, ret);
					client.addr << 1, ret);
			continue;
			continue;
		}
		}
@@ -225,7 +234,8 @@ static int em28xx_probe_sensor_omnivision(struct em28xx *dev)
		reg = 0x1d;
		reg = 0x1d;
		ret = i2c_smbus_read_byte_data(&client, reg);
		ret = i2c_smbus_read_byte_data(&client, reg);
		if (ret < 0) {
		if (ret < 0) {
			pr_err("couldn't read from i2c device 0x%02x: error %i\n",
			dev_err(&dev->udev->dev,
				"couldn't read from i2c device 0x%02x: error %i\n",
				client.addr << 1, ret);
				client.addr << 1, ret);
			continue;
			continue;
		}
		}
@@ -237,7 +247,8 @@ static int em28xx_probe_sensor_omnivision(struct em28xx *dev)
		reg = 0x0a;
		reg = 0x0a;
		ret = i2c_smbus_read_byte_data(&client, reg);
		ret = i2c_smbus_read_byte_data(&client, reg);
		if (ret < 0) {
		if (ret < 0) {
			pr_err("couldn't read from i2c device 0x%02x: error %i\n",
			dev_err(&dev->udev->dev,
				"couldn't read from i2c device 0x%02x: error %i\n",
				client.addr << 1, ret);
				client.addr << 1, ret);
			continue;
			continue;
		}
		}
@@ -245,7 +256,8 @@ static int em28xx_probe_sensor_omnivision(struct em28xx *dev)
		reg = 0x0b;
		reg = 0x0b;
		ret = i2c_smbus_read_byte_data(&client, reg);
		ret = i2c_smbus_read_byte_data(&client, reg);
		if (ret < 0) {
		if (ret < 0) {
			pr_err("couldn't read from i2c device 0x%02x: error %i\n",
			dev_err(&dev->udev->dev,
				"couldn't read from i2c device 0x%02x: error %i\n",
				client.addr << 1, ret);
				client.addr << 1, ret);
			continue;
			continue;
		}
		}
@@ -284,15 +296,18 @@ static int em28xx_probe_sensor_omnivision(struct em28xx *dev)
			name = "OV9655";
			name = "OV9655";
			break;
			break;
		default:
		default:
			pr_info("unknown OmniVision sensor detected: 0x%04x\n",
			dev_info(&dev->udev->dev,
				 "unknown OmniVision sensor detected: 0x%04x\n",
				id);
				id);
			return 0;
			return 0;
		}
		}


		if (dev->em28xx_sensor == EM28XX_NOSENSOR)
		if (dev->em28xx_sensor == EM28XX_NOSENSOR)
			pr_info("unsupported sensor detected: %s\n", name);
			dev_info(&dev->udev->dev,
				 "unsupported sensor detected: %s\n", name);
		else
		else
			pr_info("sensor %s detected\n", name);
			dev_info(&dev->udev->dev,
				 "sensor %s detected\n", name);


		dev->i2c_client[dev->def_i2c_bus].addr = client.addr;
		dev->i2c_client[dev->def_i2c_bus].addr = client.addr;
		return 0;
		return 0;
@@ -316,7 +331,8 @@ int em28xx_detect_sensor(struct em28xx *dev)
	 */
	 */


	if (dev->em28xx_sensor == EM28XX_NOSENSOR && ret < 0) {
	if (dev->em28xx_sensor == EM28XX_NOSENSOR && ret < 0) {
		pr_info("No sensor detected\n");
		dev_info(&dev->udev->dev,
			 "No sensor detected\n");
		return -ENODEV;
		return -ENODEV;
	}
	}


+74 −57
Original line number Original line Diff line number Diff line
@@ -2677,7 +2677,7 @@ static int em28xx_wait_until_ac97_features_equals(struct em28xx *dev,
		msleep(50);
		msleep(50);
	}
	}


	pr_warn("AC97 registers access is not reliable !\n");
	dev_warn(&dev->udev->dev, "AC97 registers access is not reliable !\n");
	return -ETIMEDOUT;
	return -ETIMEDOUT;
}
}


@@ -2831,12 +2831,13 @@ static int em28xx_hint_board(struct em28xx *dev)
			dev->model = em28xx_eeprom_hash[i].model;
			dev->model = em28xx_eeprom_hash[i].model;
			dev->tuner_type = em28xx_eeprom_hash[i].tuner;
			dev->tuner_type = em28xx_eeprom_hash[i].tuner;


			pr_err("Your board has no unique USB ID.\n");
			dev_err(&dev->udev->dev,
			pr_err("A hint were successfully done, based on eeprom hash.\n");
				"Your board has no unique USB ID.\n"
			pr_err("This method is not 100%% failproof.\n");
				"A hint were successfully done, based on eeprom hash.\n"
			pr_err("If the board were missdetected, please email this log to:\n");
				"This method is not 100%% failproof.\n"
			pr_err("\tV4L Mailing List  <linux-media@vger.kernel.org>\n");
				"If the board were missdetected, please email this log to:\n"
			pr_err("Board detected as %s\n",
				"\tV4L Mailing List  <linux-media@vger.kernel.org>\n"
				"Board detected as %s\n",
			       em28xx_boards[dev->model].name);
			       em28xx_boards[dev->model].name);


			return 0;
			return 0;
@@ -2860,28 +2861,33 @@ static int em28xx_hint_board(struct em28xx *dev)
		if (dev->i2c_hash == em28xx_i2c_hash[i].hash) {
		if (dev->i2c_hash == em28xx_i2c_hash[i].hash) {
			dev->model = em28xx_i2c_hash[i].model;
			dev->model = em28xx_i2c_hash[i].model;
			dev->tuner_type = em28xx_i2c_hash[i].tuner;
			dev->tuner_type = em28xx_i2c_hash[i].tuner;
			pr_err("Your board has no unique USB ID.\n");
			dev_err(&dev->udev->dev,
			pr_err("A hint were successfully done, based on i2c devicelist hash.\n");
				"Your board has no unique USB ID.\n"
			pr_err("This method is not 100%% failproof.\n");
				"A hint were successfully done, based on i2c devicelist hash.\n"
			pr_err("If the board were missdetected, please email this log to:\n");
				"This method is not 100%% failproof.\n"
			pr_err("\tV4L Mailing List  <linux-media@vger.kernel.org>\n");
				"If the board were missdetected, please email this log to:\n"
			pr_err("Board detected as %s\n",
				"\tV4L Mailing List  <linux-media@vger.kernel.org>\n"
				"Board detected as %s\n",
				em28xx_boards[dev->model].name);
				em28xx_boards[dev->model].name);


			return 0;
			return 0;
		}
		}
	}
	}


	pr_err("Your board has no unique USB ID and thus need a hint to be detected.\n");
	dev_err(&dev->udev->dev,
	pr_err("You may try to use card=<n> insmod option to workaround that.\n");
		"Your board has no unique USB ID and thus need a hint to be detected.\n"
	pr_err("Please send an email with this log to:\n");
		"You may try to use card=<n> insmod option to workaround that.\n"
	pr_err("\tV4L Mailing List <linux-media@vger.kernel.org>\n");
		"Please send an email with this log to:\n"
	pr_err("Board eeprom hash is 0x%08lx\n", dev->hash);
		"\tV4L Mailing List <linux-media@vger.kernel.org>\n"
	pr_err("Board i2c devicelist hash is 0x%08lx\n", dev->i2c_hash);
		"Board eeprom hash is 0x%08lx\n"
		"Board i2c devicelist hash is 0x%08lx\n",
		dev->hash, dev->i2c_hash);


	pr_err("Here is a list of valid choices for the card=<n> insmod option:\n");
	dev_err(&dev->udev->dev,
		"Here is a list of valid choices for the card=<n> insmod option:\n");
	for (i = 0; i < em28xx_bcount; i++) {
	for (i = 0; i < em28xx_bcount; i++) {
		pr_err("    card=%d -> %s\n", i, em28xx_boards[i].name);
		dev_err(&dev->udev->dev,
			"    card=%d -> %s\n", i, em28xx_boards[i].name);
	}
	}
	return -1;
	return -1;
}
}
@@ -2915,7 +2921,7 @@ static void em28xx_card_setup(struct em28xx *dev)
		 * hash identities which has not been determined as yet.
		 * hash identities which has not been determined as yet.
		 */
		 */
		if (em28xx_hint_board(dev) < 0)
		if (em28xx_hint_board(dev) < 0)
			pr_err("Board not discovered\n");
			dev_err(&dev->udev->dev, "Board not discovered\n");
		else {
		else {
			em28xx_set_model(dev);
			em28xx_set_model(dev);
			em28xx_pre_card_setup(dev);
			em28xx_pre_card_setup(dev);
@@ -2925,7 +2931,7 @@ static void em28xx_card_setup(struct em28xx *dev)
		em28xx_set_model(dev);
		em28xx_set_model(dev);
	}
	}


	pr_info("Identified as %s (card=%d)\n",
	dev_info(&dev->udev->dev, "Identified as %s (card=%d)\n",
		dev->board.name, dev->model);
		dev->board.name, dev->model);


	dev->tuner_type = em28xx_boards[dev->model].tuner_type;
	dev->tuner_type = em28xx_boards[dev->model].tuner_type;
@@ -3024,10 +3030,11 @@ static void em28xx_card_setup(struct em28xx *dev)
	}
	}


	if (dev->board.valid == EM28XX_BOARD_NOT_VALIDATED) {
	if (dev->board.valid == EM28XX_BOARD_NOT_VALIDATED) {
		pr_err("\n\n");
		dev_err(&dev->udev->dev,
		pr_err("The support for this board weren't valid yet.\n");
			"\n\n"
		pr_err("Please send a report of having this working\n");
			"The support for this board weren't valid yet.\n"
		pr_err("not to V4L mailing list (and/or to other addresses)\n\n");
			"Please send a report of having this working\n"
			"not to V4L mailing list (and/or to other addresses)\n\n");
	}
	}


	/* Free eeprom data memory */
	/* Free eeprom data memory */
@@ -3154,7 +3161,7 @@ static int em28xx_media_device_init(struct em28xx *dev,
	else if (udev->manufacturer)
	else if (udev->manufacturer)
		media_device_usb_init(mdev, udev, udev->manufacturer);
		media_device_usb_init(mdev, udev, udev->manufacturer);
	else
	else
		media_device_usb_init(mdev, udev, dev->name);
		media_device_usb_init(mdev, udev, dev_name(&dev->udev->dev));


	dev->media_dev = mdev;
	dev->media_dev = mdev;
#endif
#endif
@@ -3210,7 +3217,7 @@ void em28xx_free_device(struct kref *ref)
{
{
	struct em28xx *dev = kref_to_dev(ref);
	struct em28xx *dev = kref_to_dev(ref);


	pr_info("Freeing device\n");
	dev_info(&dev->udev->dev, "Freeing device\n");


	if (!dev->disconnected)
	if (!dev->disconnected)
		em28xx_release_resources(dev);
		em28xx_release_resources(dev);
@@ -3315,19 +3322,18 @@ static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev,
			dev->wait_after_write = 0;
			dev->wait_after_write = 0;
			dev->eeprom_addrwidth_16bit = 1;
			dev->eeprom_addrwidth_16bit = 1;
			break;
			break;
		default:
			pr_info("unknown em28xx chip ID (%d)\n", dev->chip_id);
		}
		}
	}
	}


	if (chip_name != default_chip_name)
	dev_set_name(&dev->udev->dev, "%d-%s: %s#%d",
		pr_info("chip ID is %s\n", chip_name);
		     dev->udev->bus->busnum, dev->udev->devpath,
		     chip_name, dev->devno);


	/*
	if (chip_name == default_chip_name)
	 * For em2820/em2710, the name may change latter, after checking
			dev_info(&dev->udev->dev,
	 * if the device has a sensor (so, it is em2710) or not.
				 "unknown em28xx chip ID (%d)\n", dev->chip_id);
	 */
	else
	snprintf(dev->name, sizeof(dev->name), "%s #%d", chip_name, dev->devno);
		dev_info(&dev->udev->dev, "chip ID is %s\n", chip_name);


	em28xx_media_device_init(dev, udev);
	em28xx_media_device_init(dev, udev);


@@ -3346,7 +3352,8 @@ static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev,
		/* Resets I2C speed */
		/* Resets I2C speed */
		retval = em28xx_write_reg(dev, EM28XX_R06_I2C_CLK, dev->board.i2c_speed);
		retval = em28xx_write_reg(dev, EM28XX_R06_I2C_CLK, dev->board.i2c_speed);
		if (retval < 0) {
		if (retval < 0) {
			pr_err("%s: em28xx_write_reg failed! retval [%d]\n",
			dev_err(&dev->udev->dev,
			       "%s: em28xx_write_reg failed! retval [%d]\n",
			       __func__, retval);
			       __func__, retval);
			return retval;
			return retval;
		}
		}
@@ -3360,7 +3367,8 @@ static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev,
	else
	else
		retval = em28xx_i2c_register(dev, 0, EM28XX_I2C_ALGO_EM28XX);
		retval = em28xx_i2c_register(dev, 0, EM28XX_I2C_ALGO_EM28XX);
	if (retval < 0) {
	if (retval < 0) {
		pr_err("%s: em28xx_i2c_register bus 0 - error [%d]!\n",
		dev_err(&dev->udev->dev,
			"%s: em28xx_i2c_register bus 0 - error [%d]!\n",
		       __func__, retval);
		       __func__, retval);
		return retval;
		return retval;
	}
	}
@@ -3374,7 +3382,8 @@ static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev,
			retval = em28xx_i2c_register(dev, 1,
			retval = em28xx_i2c_register(dev, 1,
						     EM28XX_I2C_ALGO_EM28XX);
						     EM28XX_I2C_ALGO_EM28XX);
		if (retval < 0) {
		if (retval < 0) {
			pr_err("%s: em28xx_i2c_register bus 1 - error [%d]!\n",
			dev_err(&dev->udev->dev,
			       "%s: em28xx_i2c_register bus 1 - error [%d]!\n",
			       __func__, retval);
			       __func__, retval);


			em28xx_i2c_unregister(dev, 0);
			em28xx_i2c_unregister(dev, 0);
@@ -3414,7 +3423,8 @@ static int em28xx_usb_probe(struct usb_interface *interface,
		nr = find_first_zero_bit(em28xx_devused, EM28XX_MAXBOARDS);
		nr = find_first_zero_bit(em28xx_devused, EM28XX_MAXBOARDS);
		if (nr >= EM28XX_MAXBOARDS) {
		if (nr >= EM28XX_MAXBOARDS) {
			/* No free device slots */
			/* No free device slots */
			pr_err("Driver supports up to %i em28xx boards.\n",
			dev_err(&udev->dev,
				"Driver supports up to %i em28xx boards.\n",
			       EM28XX_MAXBOARDS);
			       EM28XX_MAXBOARDS);
			retval = -ENOMEM;
			retval = -ENOMEM;
			goto err_no_slot;
			goto err_no_slot;
@@ -3423,7 +3433,8 @@ static int em28xx_usb_probe(struct usb_interface *interface,


	/* Don't register audio interfaces */
	/* Don't register audio interfaces */
	if (interface->altsetting[0].desc.bInterfaceClass == USB_CLASS_AUDIO) {
	if (interface->altsetting[0].desc.bInterfaceClass == USB_CLASS_AUDIO) {
		pr_err("audio device (%04x:%04x): interface %i, class %i\n",
		dev_err(&udev->dev,
			"audio device (%04x:%04x): interface %i, class %i\n",
			le16_to_cpu(udev->descriptor.idVendor),
			le16_to_cpu(udev->descriptor.idVendor),
			le16_to_cpu(udev->descriptor.idProduct),
			le16_to_cpu(udev->descriptor.idProduct),
			ifnum,
			ifnum,
@@ -3483,7 +3494,8 @@ static int em28xx_usb_probe(struct usb_interface *interface,
					if (usb_endpoint_xfer_isoc(e)) {
					if (usb_endpoint_xfer_isoc(e)) {
						has_vendor_audio = true;
						has_vendor_audio = true;
					} else {
					} else {
						pr_err("error: skipping audio endpoint 0x83, because it uses bulk transfers !\n");
						dev_err(&udev->dev,
							"error: skipping audio endpoint 0x83, because it uses bulk transfers !\n");
					}
					}
					break;
					break;
				case 0x84:
				case 0x84:
@@ -3556,7 +3568,8 @@ static int em28xx_usb_probe(struct usb_interface *interface,
		speed = "unknown";
		speed = "unknown";
	}
	}


	pr_info("New device %s %s @ %s Mbps (%04x:%04x, interface %d, class %d)\n",
	dev_err(&udev->dev,
		"New device %s %s @ %s Mbps (%04x:%04x, interface %d, class %d)\n",
		udev->manufacturer ? udev->manufacturer : "",
		udev->manufacturer ? udev->manufacturer : "",
		udev->product ? udev->product : "",
		udev->product ? udev->product : "",
		speed,
		speed,
@@ -3571,8 +3584,9 @@ static int em28xx_usb_probe(struct usb_interface *interface,
	 * not enough even for most Digital TV streams.
	 * not enough even for most Digital TV streams.
	 */
	 */
	if (udev->speed != USB_SPEED_HIGH && disable_usb_speed_check == 0) {
	if (udev->speed != USB_SPEED_HIGH && disable_usb_speed_check == 0) {
		pr_err("Device initialization failed.\n");
		dev_err(&udev->dev, "Device initialization failed.\n");
		pr_err("Device must be connected to a high-speed USB 2.0 port.\n");
		dev_err(&udev->dev,
			"Device must be connected to a high-speed USB 2.0 port.\n");
		retval = -ENODEV;
		retval = -ENODEV;
		goto err_free;
		goto err_free;
	}
	}
@@ -3585,7 +3599,8 @@ static int em28xx_usb_probe(struct usb_interface *interface,
	dev->ifnum = ifnum;
	dev->ifnum = ifnum;


	if (has_vendor_audio) {
	if (has_vendor_audio) {
		pr_info("Audio interface %i found (Vendor Class)\n", ifnum);
		dev_err(&udev->dev,
			"Audio interface %i found (Vendor Class)\n", ifnum);
		dev->usb_audio_type = EM28XX_USB_AUDIO_VENDOR;
		dev->usb_audio_type = EM28XX_USB_AUDIO_VENDOR;
	}
	}
	/* Checks if audio is provided by a USB Audio Class interface */
	/* Checks if audio is provided by a USB Audio Class interface */
@@ -3594,7 +3609,8 @@ static int em28xx_usb_probe(struct usb_interface *interface,


		if (uif->altsetting[0].desc.bInterfaceClass == USB_CLASS_AUDIO) {
		if (uif->altsetting[0].desc.bInterfaceClass == USB_CLASS_AUDIO) {
			if (has_vendor_audio)
			if (has_vendor_audio)
				pr_err("em28xx: device seems to have vendor AND usb audio class interfaces !\n"
				dev_err(&udev->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");
				       "\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;
			dev->usb_audio_type = EM28XX_USB_AUDIO_CLASS;
			break;
			break;
@@ -3602,12 +3618,12 @@ static int em28xx_usb_probe(struct usb_interface *interface,
	}
	}


	if (has_video)
	if (has_video)
		pr_info("Video interface %i found:%s%s\n",
		dev_err(&udev->dev, "Video interface %i found:%s%s\n",
			ifnum,
			ifnum,
			dev->analog_ep_bulk ? " bulk" : "",
			dev->analog_ep_bulk ? " bulk" : "",
			dev->analog_ep_isoc ? " isoc" : "");
			dev->analog_ep_isoc ? " isoc" : "");
	if (has_dvb)
	if (has_dvb)
		pr_info("DVB interface %i found:%s%s\n",
		dev_err(&udev->dev, "DVB interface %i found:%s%s\n",
			ifnum,
			ifnum,
			dev->dvb_ep_bulk ? " bulk" : "",
			dev->dvb_ep_bulk ? " bulk" : "",
			dev->dvb_ep_isoc ? " isoc" : "");
			dev->dvb_ep_isoc ? " isoc" : "");
@@ -3639,7 +3655,8 @@ static int em28xx_usb_probe(struct usb_interface *interface,
	/* Disable V4L2 if the device doesn't have a decoder */
	/* Disable V4L2 if the device doesn't have a decoder */
	if (has_video &&
	if (has_video &&
	    dev->board.decoder == EM28XX_NODECODER && !dev->board.is_webcam) {
	    dev->board.decoder == EM28XX_NODECODER && !dev->board.is_webcam) {
		pr_err("Currently, V4L2 is not supported on this model\n");
		dev_err(&udev->dev,
			"Currently, V4L2 is not supported on this model\n");
		has_video = false;
		has_video = false;
		dev->has_video = false;
		dev->has_video = false;
	}
	}
@@ -3648,13 +3665,13 @@ static int em28xx_usb_probe(struct usb_interface *interface,
	if (has_video) {
	if (has_video) {
		if (!dev->analog_ep_isoc || (try_bulk && dev->analog_ep_bulk))
		if (!dev->analog_ep_isoc || (try_bulk && dev->analog_ep_bulk))
			dev->analog_xfer_bulk = 1;
			dev->analog_xfer_bulk = 1;
		pr_info("analog set to %s mode.\n",
		dev_err(&udev->dev, "analog set to %s mode.\n",
			dev->analog_xfer_bulk ? "bulk" : "isoc");
			dev->analog_xfer_bulk ? "bulk" : "isoc");
	}
	}
	if (has_dvb) {
	if (has_dvb) {
		if (!dev->dvb_ep_isoc || (try_bulk && dev->dvb_ep_bulk))
		if (!dev->dvb_ep_isoc || (try_bulk && dev->dvb_ep_bulk))
			dev->dvb_xfer_bulk = 1;
			dev->dvb_xfer_bulk = 1;
		pr_info("dvb set to %s mode.\n",
		dev_err(&udev->dev, "dvb set to %s mode.\n",
			dev->dvb_xfer_bulk ? "bulk" : "isoc");
			dev->dvb_xfer_bulk ? "bulk" : "isoc");
	}
	}


@@ -3702,7 +3719,7 @@ static void em28xx_usb_disconnect(struct usb_interface *interface)


	dev->disconnected = 1;
	dev->disconnected = 1;


	pr_info("Disconnecting %s\n", dev->name);
	dev_err(&dev->udev->dev, "Disconnecting\n");


	flush_request_modules(dev);
	flush_request_modules(dev);


+79 −75

File changed.

Preview size limit exceeded, changes collapsed.

+53 −36
Original line number Original line Diff line number Diff line
@@ -75,7 +75,8 @@ DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);


#define dprintk(level, fmt, arg...) do {				\
#define dprintk(level, fmt, arg...) do {				\
	if (debug >= level)						\
	if (debug >= level)						\
	printk(KERN_DEBUG "%s/2-dvb: " fmt, dev->name, ## arg);	\
		dev_printk(KERN_DEBUG, &dev->udev->dev,			\
			   "dvb: " fmt, ## arg);			\
} while (0)
} while (0)


struct em28xx_dvb {
struct em28xx_dvb {
@@ -735,7 +736,7 @@ static int em28xx_pctv_290e_set_lna(struct dvb_frontend *fe)


	ret = gpio_request_one(dvb->lna_gpio, flags, NULL);
	ret = gpio_request_one(dvb->lna_gpio, flags, NULL);
	if (ret)
	if (ret)
		pr_err("gpio request failed %d\n", ret);
		dev_err(&dev->udev->dev, "gpio request failed %d\n", ret);
	else
	else
		gpio_free(dvb->lna_gpio);
		gpio_free(dvb->lna_gpio);


@@ -935,19 +936,20 @@ static int em28xx_attach_xc3028(u8 addr, struct em28xx *dev)
	cfg.ctrl  = &ctl;
	cfg.ctrl  = &ctl;


	if (!dev->dvb->fe[0]) {
	if (!dev->dvb->fe[0]) {
		pr_err("dvb frontend not attached. Can't attach xc3028\n");
		dev_err(&dev->udev->dev,
			"dvb frontend not attached. Can't attach xc3028\n");
		return -EINVAL;
		return -EINVAL;
	}
	}


	fe = dvb_attach(xc2028_attach, dev->dvb->fe[0], &cfg);
	fe = dvb_attach(xc2028_attach, dev->dvb->fe[0], &cfg);
	if (!fe) {
	if (!fe) {
		pr_err("xc3028 attach failed\n");
		dev_err(&dev->udev->dev, "xc3028 attach failed\n");
		dvb_frontend_detach(dev->dvb->fe[0]);
		dvb_frontend_detach(dev->dvb->fe[0]);
		dev->dvb->fe[0] = NULL;
		dev->dvb->fe[0] = NULL;
		return -EINVAL;
		return -EINVAL;
	}
	}


	pr_info("xc3028 attached\n");
	dev_info(&dev->udev->dev, "xc3028 attached\n");


	return 0;
	return 0;
}
}
@@ -963,10 +965,12 @@ static int em28xx_register_dvb(struct em28xx_dvb *dvb, struct module *module,
	mutex_init(&dvb->lock);
	mutex_init(&dvb->lock);


	/* register adapter */
	/* register adapter */
	result = dvb_register_adapter(&dvb->adapter, dev->name, module, device,
	result = dvb_register_adapter(&dvb->adapter,
				      adapter_nr);
				      dev_name(&dev->udev->dev), module,
				      device, adapter_nr);
	if (result < 0) {
	if (result < 0) {
		pr_warn("dvb_register_adapter failed (errno = %d)\n",
		dev_warn(&dev->udev->dev,
			 "dvb_register_adapter failed (errno = %d)\n",
			 result);
			 result);
		goto fail_adapter;
		goto fail_adapter;
	}
	}
@@ -984,7 +988,8 @@ static int em28xx_register_dvb(struct em28xx_dvb *dvb, struct module *module,
	/* register frontend */
	/* register frontend */
	result = dvb_register_frontend(&dvb->adapter, dvb->fe[0]);
	result = dvb_register_frontend(&dvb->adapter, dvb->fe[0]);
	if (result < 0) {
	if (result < 0) {
		pr_warn("dvb_register_frontend failed (errno = %d)\n",
		dev_warn(&dev->udev->dev,
			 "dvb_register_frontend failed (errno = %d)\n",
			 result);
			 result);
		goto fail_frontend0;
		goto fail_frontend0;
	}
	}
@@ -993,7 +998,8 @@ static int em28xx_register_dvb(struct em28xx_dvb *dvb, struct module *module,
	if (dvb->fe[1]) {
	if (dvb->fe[1]) {
		result = dvb_register_frontend(&dvb->adapter, dvb->fe[1]);
		result = dvb_register_frontend(&dvb->adapter, dvb->fe[1]);
		if (result < 0) {
		if (result < 0) {
			pr_warn("2nd dvb_register_frontend failed (errno = %d)\n",
			dev_warn(&dev->udev->dev,
				 "2nd dvb_register_frontend failed (errno = %d)\n",
				 result);
				 result);
			goto fail_frontend1;
			goto fail_frontend1;
		}
		}
@@ -1011,7 +1017,9 @@ static int em28xx_register_dvb(struct em28xx_dvb *dvb, struct module *module,


	result = dvb_dmx_init(&dvb->demux);
	result = dvb_dmx_init(&dvb->demux);
	if (result < 0) {
	if (result < 0) {
		pr_warn("dvb_dmx_init failed (errno = %d)\n", result);
		dev_warn(&dev->udev->dev,
			 "dvb_dmx_init failed (errno = %d)\n",
			 result);
		goto fail_dmx;
		goto fail_dmx;
	}
	}


@@ -1020,14 +1028,17 @@ static int em28xx_register_dvb(struct em28xx_dvb *dvb, struct module *module,
	dvb->dmxdev.capabilities = 0;
	dvb->dmxdev.capabilities = 0;
	result = dvb_dmxdev_init(&dvb->dmxdev, &dvb->adapter);
	result = dvb_dmxdev_init(&dvb->dmxdev, &dvb->adapter);
	if (result < 0) {
	if (result < 0) {
		pr_warn("dvb_dmxdev_init failed (errno = %d)\n", result);
		dev_warn(&dev->udev->dev,
			 "dvb_dmxdev_init failed (errno = %d)\n",
			 result);
		goto fail_dmxdev;
		goto fail_dmxdev;
	}
	}


	dvb->fe_hw.source = DMX_FRONTEND_0;
	dvb->fe_hw.source = DMX_FRONTEND_0;
	result = dvb->demux.dmx.add_frontend(&dvb->demux.dmx, &dvb->fe_hw);
	result = dvb->demux.dmx.add_frontend(&dvb->demux.dmx, &dvb->fe_hw);
	if (result < 0) {
	if (result < 0) {
		pr_warn("add_frontend failed (DMX_FRONTEND_0, errno = %d)\n",
		dev_warn(&dev->udev->dev,
			 "add_frontend failed (DMX_FRONTEND_0, errno = %d)\n",
			 result);
			 result);
		goto fail_fe_hw;
		goto fail_fe_hw;
	}
	}
@@ -1035,14 +1046,17 @@ static int em28xx_register_dvb(struct em28xx_dvb *dvb, struct module *module,
	dvb->fe_mem.source = DMX_MEMORY_FE;
	dvb->fe_mem.source = DMX_MEMORY_FE;
	result = dvb->demux.dmx.add_frontend(&dvb->demux.dmx, &dvb->fe_mem);
	result = dvb->demux.dmx.add_frontend(&dvb->demux.dmx, &dvb->fe_mem);
	if (result < 0) {
	if (result < 0) {
		pr_warn("add_frontend failed (DMX_MEMORY_FE, errno = %d)\n",
		dev_warn(&dev->udev->dev,
			 "add_frontend failed (DMX_MEMORY_FE, errno = %d)\n",
			 result);
			 result);
		goto fail_fe_mem;
		goto fail_fe_mem;
	}
	}


	result = dvb->demux.dmx.connect_frontend(&dvb->demux.dmx, &dvb->fe_hw);
	result = dvb->demux.dmx.connect_frontend(&dvb->demux.dmx, &dvb->fe_hw);
	if (result < 0) {
	if (result < 0) {
		pr_warn("connect_frontend failed (errno = %d)\n", result);
		dev_warn(&dev->udev->dev,
			 "connect_frontend failed (errno = %d)\n",
			 result);
		goto fail_fe_conn;
		goto fail_fe_conn;
	}
	}


@@ -1114,7 +1128,7 @@ static int em28xx_dvb_init(struct em28xx *dev)
		return 0;
		return 0;
	}
	}


	pr_info("Binding DVB extension\n");
	dev_info(&dev->udev->dev, "Binding DVB extension\n");


	dvb = kzalloc(sizeof(struct em28xx_dvb), GFP_KERNEL);
	dvb = kzalloc(sizeof(struct em28xx_dvb), GFP_KERNEL);
	if (!dvb)
	if (!dvb)
@@ -1138,7 +1152,8 @@ static int em28xx_dvb_init(struct em28xx *dev)
					   EM28XX_DVB_NUM_ISOC_PACKETS);
					   EM28XX_DVB_NUM_ISOC_PACKETS);
	}
	}
	if (result) {
	if (result) {
		pr_err("em28xx_dvb: failed to pre-allocate USB transfer buffers for DVB.\n");
		dev_err(&dev->udev->dev,
			"failed to pre-allocate USB transfer buffers for DVB.\n");
		kfree(dvb);
		kfree(dvb);
		dev->dvb = NULL;
		dev->dvb = NULL;
		return result;
		return result;
@@ -1317,7 +1332,8 @@ static int em28xx_dvb_init(struct em28xx *dev)
			result = gpio_request_one(dvb->lna_gpio,
			result = gpio_request_one(dvb->lna_gpio,
						  GPIOF_OUT_INIT_LOW, NULL);
						  GPIOF_OUT_INIT_LOW, NULL);
			if (result)
			if (result)
				pr_err("gpio request failed %d\n",
				dev_err(&dev->udev->dev,
					"gpio request failed %d\n",
					result);
					result);
			else
			else
				gpio_free(dvb->lna_gpio);
				gpio_free(dvb->lna_gpio);
@@ -1933,11 +1949,12 @@ static int em28xx_dvb_init(struct em28xx *dev)
		}
		}
		break;
		break;
	default:
	default:
		pr_err("The frontend of your DVB/ATSC card isn't supported yet\n");
		dev_err(&dev->udev->dev,
			"The frontend of your DVB/ATSC card isn't supported yet\n");
		break;
		break;
	}
	}
	if (NULL == dvb->fe[0]) {
	if (NULL == dvb->fe[0]) {
		pr_err("frontend initialization failed\n");
		dev_err(&dev->udev->dev, "frontend initialization failed\n");
		result = -EINVAL;
		result = -EINVAL;
		goto out_free;
		goto out_free;
	}
	}
@@ -1952,7 +1969,7 @@ static int em28xx_dvb_init(struct em28xx *dev)
	if (result < 0)
	if (result < 0)
		goto out_free;
		goto out_free;


	pr_info("DVB extension successfully initialized\n");
	dev_info(&dev->udev->dev, "DVB extension successfully initialized\n");


	kref_get(&dev->ref);
	kref_get(&dev->ref);


@@ -1992,7 +2009,7 @@ static int em28xx_dvb_fini(struct em28xx *dev)
	if (!dev->dvb)
	if (!dev->dvb)
		return 0;
		return 0;


	pr_info("Closing DVB extension\n");
	dev_info(&dev->udev->dev, "Closing DVB extension\n");


	dvb = dev->dvb;
	dvb = dev->dvb;


@@ -2050,17 +2067,17 @@ static int em28xx_dvb_suspend(struct em28xx *dev)
	if (!dev->board.has_dvb)
	if (!dev->board.has_dvb)
		return 0;
		return 0;


	pr_info("Suspending DVB extension\n");
	dev_info(&dev->udev->dev, "Suspending DVB extension\n");
	if (dev->dvb) {
	if (dev->dvb) {
		struct em28xx_dvb *dvb = dev->dvb;
		struct em28xx_dvb *dvb = dev->dvb;


		if (dvb->fe[0]) {
		if (dvb->fe[0]) {
			ret = dvb_frontend_suspend(dvb->fe[0]);
			ret = dvb_frontend_suspend(dvb->fe[0]);
			pr_info("fe0 suspend %d\n", ret);
			dev_info(&dev->udev->dev, "fe0 suspend %d\n", ret);
		}
		}
		if (dvb->fe[1]) {
		if (dvb->fe[1]) {
			dvb_frontend_suspend(dvb->fe[1]);
			dvb_frontend_suspend(dvb->fe[1]);
			pr_info("fe1 suspend %d\n", ret);
			dev_info(&dev->udev->dev, "fe1 suspend %d\n", ret);
		}
		}
	}
	}


@@ -2077,18 +2094,18 @@ static int em28xx_dvb_resume(struct em28xx *dev)
	if (!dev->board.has_dvb)
	if (!dev->board.has_dvb)
		return 0;
		return 0;


	pr_info("Resuming DVB extension\n");
	dev_info(&dev->udev->dev, "Resuming DVB extension\n");
	if (dev->dvb) {
	if (dev->dvb) {
		struct em28xx_dvb *dvb = dev->dvb;
		struct em28xx_dvb *dvb = dev->dvb;


		if (dvb->fe[0]) {
		if (dvb->fe[0]) {
			ret = dvb_frontend_resume(dvb->fe[0]);
			ret = dvb_frontend_resume(dvb->fe[0]);
			pr_info("fe0 resume %d\n", ret);
			dev_info(&dev->udev->dev, "fe0 resume %d\n", ret);
		}
		}


		if (dvb->fe[1]) {
		if (dvb->fe[1]) {
			ret = dvb_frontend_resume(dvb->fe[1]);
			ret = dvb_frontend_resume(dvb->fe[1]);
			pr_info("fe1 resume %d\n", ret);
			dev_info(&dev->udev->dev, "fe1 resume %d\n", ret);
		}
		}
	}
	}


Loading