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

Commit f2d0c1c6 authored by Jarod Wilson's avatar Jarod Wilson Committed by Mauro Carvalho Chehab
Browse files

[media] em28xx: add em28xx_ prefix to functions



Makes it more straight-forward to follow stack traces if the functions
don't have generic names. Using this as a crutch while trying to better
understand the lockdep warnings I get when loading the em28xx driver.

CC: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: default avatarJarod Wilson <jarod@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 2f00e158
Loading
Loading
Loading
Loading
+28 −30
Original line number Original line Diff line number Diff line
@@ -122,7 +122,7 @@ static inline void print_err_status(struct em28xx *dev,
	}
	}
}
}


static inline int dvb_isoc_copy(struct em28xx *dev, struct urb *urb)
static inline int em28xx_dvb_isoc_copy(struct em28xx *dev, struct urb *urb)
{
{
	int i;
	int i;


@@ -155,7 +155,7 @@ static inline int dvb_isoc_copy(struct em28xx *dev, struct urb *urb)
	return 0;
	return 0;
}
}


static int start_streaming(struct em28xx_dvb *dvb)
static int em28xx_start_streaming(struct em28xx_dvb *dvb)
{
{
	int rc;
	int rc;
	struct em28xx *dev = dvb->adapter.priv;
	struct em28xx *dev = dvb->adapter.priv;
@@ -175,10 +175,10 @@ static int start_streaming(struct em28xx_dvb *dvb)


	return em28xx_init_isoc(dev, EM28XX_DVB_MAX_PACKETS,
	return em28xx_init_isoc(dev, EM28XX_DVB_MAX_PACKETS,
				EM28XX_DVB_NUM_BUFS, max_dvb_packet_size,
				EM28XX_DVB_NUM_BUFS, max_dvb_packet_size,
				dvb_isoc_copy);
				em28xx_dvb_isoc_copy);
}
}


static int stop_streaming(struct em28xx_dvb *dvb)
static int em28xx_stop_streaming(struct em28xx_dvb *dvb)
{
{
	struct em28xx *dev = dvb->adapter.priv;
	struct em28xx *dev = dvb->adapter.priv;


@@ -189,7 +189,7 @@ static int stop_streaming(struct em28xx_dvb *dvb)
	return 0;
	return 0;
}
}


static int start_feed(struct dvb_demux_feed *feed)
static int em28xx_start_feed(struct dvb_demux_feed *feed)
{
{
	struct dvb_demux *demux  = feed->demux;
	struct dvb_demux *demux  = feed->demux;
	struct em28xx_dvb *dvb = demux->priv;
	struct em28xx_dvb *dvb = demux->priv;
@@ -203,7 +203,7 @@ static int start_feed(struct dvb_demux_feed *feed)
	rc = dvb->nfeeds;
	rc = dvb->nfeeds;


	if (dvb->nfeeds == 1) {
	if (dvb->nfeeds == 1) {
		ret = start_streaming(dvb);
		ret = em28xx_start_streaming(dvb);
		if (ret < 0)
		if (ret < 0)
			rc = ret;
			rc = ret;
	}
	}
@@ -212,7 +212,7 @@ static int start_feed(struct dvb_demux_feed *feed)
	return rc;
	return rc;
}
}


static int stop_feed(struct dvb_demux_feed *feed)
static int em28xx_stop_feed(struct dvb_demux_feed *feed)
{
{
	struct dvb_demux *demux  = feed->demux;
	struct dvb_demux *demux  = feed->demux;
	struct em28xx_dvb *dvb = demux->priv;
	struct em28xx_dvb *dvb = demux->priv;
@@ -222,7 +222,7 @@ static int stop_feed(struct dvb_demux_feed *feed)
	dvb->nfeeds--;
	dvb->nfeeds--;


	if (0 == dvb->nfeeds)
	if (0 == dvb->nfeeds)
		err = stop_streaming(dvb);
		err = em28xx_stop_streaming(dvb);


	mutex_unlock(&dvb->lock);
	mutex_unlock(&dvb->lock);
	return err;
	return err;
@@ -380,7 +380,7 @@ static void terratec_h5_init(struct em28xx *dev)
	em28xx_gpio_set(dev, terratec_h5_end);
	em28xx_gpio_set(dev, terratec_h5_end);
};
};


static int mt352_terratec_xs_init(struct dvb_frontend *fe)
static int em28xx_mt352_terratec_xs_init(struct dvb_frontend *fe)
{
{
	/* Values extracted from a USB trace of the Terratec Windows driver */
	/* Values extracted from a USB trace of the Terratec Windows driver */
	static u8 clock_config[]   = { CLOCK_CTL,  0x38, 0x2c };
	static u8 clock_config[]   = { CLOCK_CTL,  0x38, 0x2c };
@@ -412,7 +412,7 @@ static struct mt352_config terratec_xs_mt352_cfg = {
	.demod_address = (0x1e >> 1),
	.demod_address = (0x1e >> 1),
	.no_tuner = 1,
	.no_tuner = 1,
	.if2 = 45600,
	.if2 = 45600,
	.demod_init = mt352_terratec_xs_init,
	.demod_init = em28xx_mt352_terratec_xs_init,
};
};


static struct tda10023_config em28xx_tda10023_config = {
static struct tda10023_config em28xx_tda10023_config = {
@@ -442,7 +442,7 @@ static struct tda18271_config em28xx_cxd2820r_tda18271_config = {


/* ------------------------------------------------------------------ */
/* ------------------------------------------------------------------ */


static int attach_xc3028(u8 addr, struct em28xx *dev)
static int em28xx_attach_xc3028(u8 addr, struct em28xx *dev)
{
{
	struct dvb_frontend *fe;
	struct dvb_frontend *fe;
	struct xc2028_config cfg;
	struct xc2028_config cfg;
@@ -472,10 +472,8 @@ static int attach_xc3028(u8 addr, struct em28xx *dev)


/* ------------------------------------------------------------------ */
/* ------------------------------------------------------------------ */


static int register_dvb(struct em28xx_dvb *dvb,
static int em28xx_register_dvb(struct em28xx_dvb *dvb, struct module *module,
		 struct module *module,
			       struct em28xx *dev, struct device *device)
		 struct em28xx *dev,
		 struct device *device)
{
{
	int result;
	int result;


@@ -522,8 +520,8 @@ static int register_dvb(struct em28xx_dvb *dvb,
	dvb->demux.priv       = dvb;
	dvb->demux.priv       = dvb;
	dvb->demux.filternum  = 256;
	dvb->demux.filternum  = 256;
	dvb->demux.feednum    = 256;
	dvb->demux.feednum    = 256;
	dvb->demux.start_feed = start_feed;
	dvb->demux.start_feed = em28xx_start_feed;
	dvb->demux.stop_feed  = stop_feed;
	dvb->demux.stop_feed  = em28xx_stop_feed;


	result = dvb_dmx_init(&dvb->demux);
	result = dvb_dmx_init(&dvb->demux);
	if (result < 0) {
	if (result < 0) {
@@ -591,7 +589,7 @@ static int register_dvb(struct em28xx_dvb *dvb,
	return result;
	return result;
}
}


static void unregister_dvb(struct em28xx_dvb *dvb)
static void em28xx_unregister_dvb(struct em28xx_dvb *dvb)
{
{
	dvb_net_release(&dvb->net);
	dvb_net_release(&dvb->net);
	dvb->demux.dmx.remove_frontend(&dvb->demux.dmx, &dvb->fe_mem);
	dvb->demux.dmx.remove_frontend(&dvb->demux.dmx, &dvb->fe_mem);
@@ -607,7 +605,7 @@ static void unregister_dvb(struct em28xx_dvb *dvb)
	dvb_unregister_adapter(&dvb->adapter);
	dvb_unregister_adapter(&dvb->adapter);
}
}


static int dvb_init(struct em28xx *dev)
static int em28xx_dvb_init(struct em28xx *dev)
{
{
	int result = 0, mfe_shared = 0;
	int result = 0, mfe_shared = 0;
	struct em28xx_dvb *dvb;
	struct em28xx_dvb *dvb;
@@ -648,7 +646,7 @@ static int dvb_init(struct em28xx *dev)
		dvb->fe[0] = dvb_attach(lgdt330x_attach,
		dvb->fe[0] = dvb_attach(lgdt330x_attach,
					   &em2880_lgdt3303_dev,
					   &em2880_lgdt3303_dev,
					   &dev->i2c_adap);
					   &dev->i2c_adap);
		if (attach_xc3028(0x61, dev) < 0) {
		if (em28xx_attach_xc3028(0x61, dev) < 0) {
			result = -EINVAL;
			result = -EINVAL;
			goto out_free;
			goto out_free;
		}
		}
@@ -657,7 +655,7 @@ static int dvb_init(struct em28xx *dev)
		dvb->fe[0] = dvb_attach(zl10353_attach,
		dvb->fe[0] = dvb_attach(zl10353_attach,
					   &em28xx_zl10353_with_xc3028,
					   &em28xx_zl10353_with_xc3028,
					   &dev->i2c_adap);
					   &dev->i2c_adap);
		if (attach_xc3028(0x61, dev) < 0) {
		if (em28xx_attach_xc3028(0x61, dev) < 0) {
			result = -EINVAL;
			result = -EINVAL;
			goto out_free;
			goto out_free;
		}
		}
@@ -668,7 +666,7 @@ static int dvb_init(struct em28xx *dev)
		dvb->fe[0] = dvb_attach(zl10353_attach,
		dvb->fe[0] = dvb_attach(zl10353_attach,
					   &em28xx_zl10353_xc3028_no_i2c_gate,
					   &em28xx_zl10353_xc3028_no_i2c_gate,
					   &dev->i2c_adap);
					   &dev->i2c_adap);
		if (attach_xc3028(0x61, dev) < 0) {
		if (em28xx_attach_xc3028(0x61, dev) < 0) {
			result = -EINVAL;
			result = -EINVAL;
			goto out_free;
			goto out_free;
		}
		}
@@ -689,7 +687,7 @@ static int dvb_init(struct em28xx *dev)
						   &dev->i2c_adap);
						   &dev->i2c_adap);
		}
		}


		if (attach_xc3028(0x61, dev) < 0) {
		if (em28xx_attach_xc3028(0x61, dev) < 0) {
			result = -EINVAL;
			result = -EINVAL;
			goto out_free;
			goto out_free;
		}
		}
@@ -699,7 +697,7 @@ static int dvb_init(struct em28xx *dev)
		dvb->fe[0] = dvb_attach(s5h1409_attach,
		dvb->fe[0] = dvb_attach(s5h1409_attach,
					   &em28xx_s5h1409_with_xc3028,
					   &em28xx_s5h1409_with_xc3028,
					   &dev->i2c_adap);
					   &dev->i2c_adap);
		if (attach_xc3028(0x61, dev) < 0) {
		if (em28xx_attach_xc3028(0x61, dev) < 0) {
			result = -EINVAL;
			result = -EINVAL;
			goto out_free;
			goto out_free;
		}
		}
@@ -720,7 +718,7 @@ static int dvb_init(struct em28xx *dev)
	case EM2882_BOARD_PINNACLE_HYBRID_PRO_330E:
	case EM2882_BOARD_PINNACLE_HYBRID_PRO_330E:
		dvb->fe[0] = dvb_attach(drxd_attach, &em28xx_drxd, NULL,
		dvb->fe[0] = dvb_attach(drxd_attach, &em28xx_drxd, NULL,
					   &dev->i2c_adap, &dev->udev->dev);
					   &dev->i2c_adap, &dev->udev->dev);
		if (attach_xc3028(0x61, dev) < 0) {
		if (em28xx_attach_xc3028(0x61, dev) < 0) {
			result = -EINVAL;
			result = -EINVAL;
			goto out_free;
			goto out_free;
		}
		}
@@ -825,7 +823,7 @@ static int dvb_init(struct em28xx *dev)
	dvb->fe[0]->callback = em28xx_tuner_callback;
	dvb->fe[0]->callback = em28xx_tuner_callback;


	/* register everything */
	/* register everything */
	result = register_dvb(dvb, THIS_MODULE, dev, &dev->udev->dev);
	result = em28xx_register_dvb(dvb, THIS_MODULE, dev, &dev->udev->dev);


	if (result < 0)
	if (result < 0)
		goto out_free;
		goto out_free;
@@ -845,7 +843,7 @@ static int dvb_init(struct em28xx *dev)
	goto ret;
	goto ret;
}
}


static int dvb_fini(struct em28xx *dev)
static int em28xx_dvb_fini(struct em28xx *dev)
{
{
	if (!dev->board.has_dvb) {
	if (!dev->board.has_dvb) {
		/* This device does not support the extension */
		/* This device does not support the extension */
@@ -853,7 +851,7 @@ static int dvb_fini(struct em28xx *dev)
	}
	}


	if (dev->dvb) {
	if (dev->dvb) {
		unregister_dvb(dev->dvb);
		em28xx_unregister_dvb(dev->dvb);
		kfree(dev->dvb);
		kfree(dev->dvb);
		dev->dvb = NULL;
		dev->dvb = NULL;
	}
	}
@@ -864,8 +862,8 @@ static int dvb_fini(struct em28xx *dev)
static struct em28xx_ops dvb_ops = {
static struct em28xx_ops dvb_ops = {
	.id   = EM28XX_DVB,
	.id   = EM28XX_DVB,
	.name = "Em28xx dvb Extension",
	.name = "Em28xx dvb Extension",
	.init = dvb_init,
	.init = em28xx_dvb_init,
	.fini = dvb_fini,
	.fini = em28xx_dvb_fini,
};
};


static int __init em28xx_dvb_register(void)
static int __init em28xx_dvb_register(void)