Merge git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb

* git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb:
  V4L/DVB (5472): Isl6421: don't reference freed memory
  V4L/DVB (5441): Saa7146: Fix allocation of clipping memory
  V4L/DVB (5421): Fix suspend/resume in msp3400 and tuner
  V4L/DVB (5415): Msp_attach must return 0 if no msp3400 was found.
  V4L/DVB (5408): Fix SECAM handling on saa7115
  V4L/DVB (5400): Core: fix several locking related problems
  V4L/DVB (5390): Radio: Fix error in Kbuild file
  V4L/DVB (5332): Ir_rc5_timer_end decoder lockup fix
This commit is contained in:
Linus Torvalds 2007-03-27 09:23:59 -07:00
commit d0d87aae79
10 changed files with 32 additions and 48 deletions

View File

@ -310,13 +310,15 @@ void ir_rc5_timer_end(unsigned long data)
tv.tv_usec - ir->base_time.tv_usec;
}
/* Allow some timmer jitter (RC5 is ~24ms anyway so this is ok) */
/* signal we're ready to start a new code */
ir->active = 0;
/* Allow some timer jitter (RC5 is ~24ms anyway so this is ok) */
if (gap < 28000) {
dprintk(1, "ir-common: spurious timer_end\n");
return;
}
ir->active = 0;
if (ir->last_bit < 20) {
/* ignore spurious codes (caused by light/other remotes) */
dprintk(1, "ir-common: short code: %x\n", ir->code);

View File

@ -180,8 +180,7 @@ static int dvb_dvr_release(struct inode *inode, struct file *file)
struct dvb_device *dvbdev = file->private_data;
struct dmxdev *dmxdev = dvbdev->priv;
if (mutex_lock_interruptible(&dmxdev->mutex))
return -ERESTARTSYS;
mutex_lock(&dmxdev->mutex);
if ((file->f_flags & O_ACCMODE) == O_WRONLY) {
dmxdev->demux->disconnect_frontend(dmxdev->demux);
@ -673,13 +672,8 @@ static int dvb_demux_open(struct inode *inode, struct file *file)
static int dvb_dmxdev_filter_free(struct dmxdev *dmxdev,
struct dmxdev_filter *dmxdevfilter)
{
if (mutex_lock_interruptible(&dmxdev->mutex))
return -ERESTARTSYS;
if (mutex_lock_interruptible(&dmxdevfilter->mutex)) {
mutex_unlock(&dmxdev->mutex);
return -ERESTARTSYS;
}
mutex_lock(&dmxdev->mutex);
mutex_lock(&dmxdevfilter->mutex);
dvb_dmxdev_filter_stop(dmxdevfilter);
dvb_dmxdev_filter_reset(dmxdevfilter);

View File

@ -673,8 +673,7 @@ static int dmx_ts_feed_stop_filtering(struct dmx_ts_feed *ts_feed)
struct dvb_demux *demux = feed->demux;
int ret;
if (mutex_lock_interruptible(&demux->mutex))
return -ERESTARTSYS;
mutex_lock(&demux->mutex);
if (feed->state < DMX_STATE_GO) {
mutex_unlock(&demux->mutex);
@ -748,8 +747,7 @@ static int dvbdmx_release_ts_feed(struct dmx_demux *dmx,
struct dvb_demux *demux = (struct dvb_demux *)dmx;
struct dvb_demux_feed *feed = (struct dvb_demux_feed *)ts_feed;
if (mutex_lock_interruptible(&demux->mutex))
return -ERESTARTSYS;
mutex_lock(&demux->mutex);
if (feed->state == DMX_STATE_FREE) {
mutex_unlock(&demux->mutex);
@ -916,8 +914,7 @@ static int dmx_section_feed_stop_filtering(struct dmx_section_feed *feed)
struct dvb_demux *dvbdmx = dvbdmxfeed->demux;
int ret;
if (mutex_lock_interruptible(&dvbdmx->mutex))
return -ERESTARTSYS;
mutex_lock(&dvbdmx->mutex);
if (!dvbdmx->stop_feed) {
mutex_unlock(&dvbdmx->mutex);
@ -942,8 +939,7 @@ static int dmx_section_feed_release_filter(struct dmx_section_feed *feed,
struct dvb_demux_feed *dvbdmxfeed = (struct dvb_demux_feed *)feed;
struct dvb_demux *dvbdmx = dvbdmxfeed->demux;
if (mutex_lock_interruptible(&dvbdmx->mutex))
return -ERESTARTSYS;
mutex_lock(&dvbdmx->mutex);
if (dvbdmxfilter->feed != dvbdmxfeed) {
mutex_unlock(&dvbdmx->mutex);
@ -1016,8 +1012,7 @@ static int dvbdmx_release_section_feed(struct dmx_demux *demux,
struct dvb_demux_feed *dvbdmxfeed = (struct dvb_demux_feed *)feed;
struct dvb_demux *dvbdmx = (struct dvb_demux *)demux;
if (mutex_lock_interruptible(&dvbdmx->mutex))
return -ERESTARTSYS;
mutex_lock(&dvbdmx->mutex);
if (dvbdmxfeed->state == DMX_STATE_FREE) {
mutex_unlock(&dvbdmx->mutex);
@ -1126,8 +1121,7 @@ static int dvbdmx_connect_frontend(struct dmx_demux *demux,
if (demux->frontend)
return -EINVAL;
if (mutex_lock_interruptible(&dvbdemux->mutex))
return -ERESTARTSYS;
mutex_lock(&dvbdemux->mutex);
demux->frontend = frontend;
mutex_unlock(&dvbdemux->mutex);
@ -1138,8 +1132,7 @@ static int dvbdmx_disconnect_frontend(struct dmx_demux *demux)
{
struct dvb_demux *dvbdemux = (struct dvb_demux *)demux;
if (mutex_lock_interruptible(&dvbdemux->mutex))
return -ERESTARTSYS;
mutex_lock(&dvbdemux->mutex);
demux->frontend = NULL;
mutex_unlock(&dvbdemux->mutex);

View File

@ -203,8 +203,7 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev,
int id;
if (mutex_lock_interruptible(&dvbdev_register_lock))
return -ERESTARTSYS;
mutex_lock(&dvbdev_register_lock);
if ((id = dvbdev_get_free_id (adap, type)) < 0){
mutex_unlock(&dvbdev_register_lock);
@ -294,8 +293,7 @@ int dvb_register_adapter(struct dvb_adapter *adap, const char *name, struct modu
{
int num;
if (mutex_lock_interruptible(&dvbdev_register_lock))
return -ERESTARTSYS;
mutex_lock(&dvbdev_register_lock);
if ((num = dvbdev_get_free_adapter_num ()) < 0) {
mutex_unlock(&dvbdev_register_lock);
@ -323,8 +321,7 @@ EXPORT_SYMBOL(dvb_register_adapter);
int dvb_unregister_adapter(struct dvb_adapter *adap)
{
if (mutex_lock_interruptible(&dvbdev_register_lock))
return -ERESTARTSYS;
mutex_lock(&dvbdev_register_lock);
list_del (&adap->list_head);
mutex_unlock(&dvbdev_register_lock);
return 0;

View File

@ -122,6 +122,7 @@ struct dvb_frontend *isl6421_attach(struct dvb_frontend *fe, struct i2c_adapter
/* detect if it is present or not */
if (isl6421_set_voltage(fe, SEC_VOLTAGE_OFF)) {
kfree(isl6421);
fe->sec_priv = NULL;
return NULL;
}

View File

@ -3,7 +3,7 @@
#
menu "Radio Adapters"
depends on VIDEO_DEV!=n
depends on VIDEO_DEV
config RADIO_CADET
tristate "ADS Cadet AM/FM Tuner"

View File

@ -780,18 +780,16 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg)
return 0;
}
static int msp_suspend(struct device * dev, pm_message_t state)
static int msp_suspend(struct i2c_client *client, pm_message_t state)
{
struct i2c_client *client = container_of(dev, struct i2c_client, dev);
v4l_dbg(1, msp_debug, client, "suspend\n");
msp_reset(client);
return 0;
}
static int msp_resume(struct device * dev)
static int msp_resume(struct i2c_client *client)
{
struct i2c_client *client = container_of(dev, struct i2c_client, dev);
v4l_dbg(1, msp_debug, client, "resume\n");
msp_wake_thread(client);
@ -825,7 +823,7 @@ static int msp_attach(struct i2c_adapter *adapter, int address, int kind)
if (msp_reset(client) == -1) {
v4l_dbg(1, msp_debug, client, "msp3400 not found\n");
kfree(client);
return -1;
return 0;
}
state = kmalloc(sizeof(*state), GFP_KERNEL);
@ -859,7 +857,7 @@ static int msp_attach(struct i2c_adapter *adapter, int address, int kind)
v4l_dbg(1, msp_debug, client, "not an msp3400 (cannot read chip version)\n");
kfree(state);
kfree(client);
return -1;
return 0;
}
msp_set_audio(client);
@ -996,11 +994,11 @@ static struct i2c_driver i2c_driver = {
.id = I2C_DRIVERID_MSP3400,
.attach_adapter = msp_probe,
.detach_client = msp_detach,
.suspend = msp_suspend,
.resume = msp_resume,
.command = msp_command,
.driver = {
.name = "msp3400",
.suspend = msp_suspend,
.resume = msp_resume,
},
};

View File

@ -961,7 +961,7 @@ static void saa711x_set_v4lstd(struct i2c_client *client, v4l2_std_id std)
reg |= 0x10;
} else if (std == V4L2_STD_NTSC_M_JP) {
reg |= 0x40;
} else if (std == V4L2_STD_SECAM) {
} else if (std & V4L2_STD_SECAM) {
reg |= 0x50;
}
saa711x_write(client, R_0E_CHROMA_CNTL_1, reg);

View File

@ -804,9 +804,8 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
return 0;
}
static int tuner_suspend(struct device *dev, pm_message_t state)
static int tuner_suspend(struct i2c_client *c, pm_message_t state)
{
struct i2c_client *c = container_of (dev, struct i2c_client, dev);
struct tuner *t = i2c_get_clientdata (c);
tuner_dbg ("suspend\n");
@ -814,9 +813,8 @@ static int tuner_suspend(struct device *dev, pm_message_t state)
return 0;
}
static int tuner_resume(struct device *dev)
static int tuner_resume(struct i2c_client *c)
{
struct i2c_client *c = container_of (dev, struct i2c_client, dev);
struct tuner *t = i2c_get_clientdata (c);
tuner_dbg ("resume\n");
@ -837,10 +835,10 @@ static struct i2c_driver driver = {
.attach_adapter = tuner_probe,
.detach_client = tuner_detach,
.command = tuner_command,
.driver = {
.name = "tuner",
.suspend = tuner_suspend,
.resume = tuner_resume,
.driver = {
.name = "tuner",
},
};
static struct i2c_client client_template = {

View File

@ -239,7 +239,8 @@ void saa7146_res_free(struct saa7146_fh *fh, unsigned int bits);
#define SAA7146_HPS_SYNC_PORT_B 0x01
/* some memory sizes */
#define SAA7146_CLIPPING_MEM (14*PAGE_SIZE)
/* max. 16 clipping rectangles */
#define SAA7146_CLIPPING_MEM (16 * 4 * sizeof(u32))
/* some defines for the various clipping-modes */
#define SAA7146_CLIPPING_RECT 0x4