diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2009-02-07 11:45:08 +0100 |
---|---|---|
committer | Hans Verkuil <hverkuil@xs4all.nl> | 2009-02-07 11:45:08 +0100 |
commit | 735182acc722237aca3cd7c6e5fde27c965d8334 (patch) | |
tree | 33c16ea9a41b95e9aa702f00b25c6e08c2c3df2f /linux/drivers/media/common | |
parent | 730fafde64c1efd147ec7f58edf1bc0cc24ef24b (diff) | |
download | mediapointer-dvb-s2-735182acc722237aca3cd7c6e5fde27c965d8334.tar.gz mediapointer-dvb-s2-735182acc722237aca3cd7c6e5fde27c965d8334.tar.bz2 |
saa7146: the adapter class will be NULL when v4l2_subdev is used.
From: Hans Verkuil <hverkuil@xs4all.nl>
Priority: normal
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Diffstat (limited to 'linux/drivers/media/common')
-rw-r--r-- | linux/drivers/media/common/saa7146_i2c.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/linux/drivers/media/common/saa7146_i2c.c b/linux/drivers/media/common/saa7146_i2c.c index f275846da..68674799b 100644 --- a/linux/drivers/media/common/saa7146_i2c.c +++ b/linux/drivers/media/common/saa7146_i2c.c @@ -422,8 +422,12 @@ int saa7146_i2c_adapter_prepare(struct saa7146_dev *dev, struct i2c_adapter *i2c dev->i2c_bitrate = bitrate; saa7146_i2c_reset(dev); - if( NULL != i2c_adapter ) { + if (i2c_adapter) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22) + /* For kernels > 2.6.22 it can actually be NULL + when v4l2_subdev is used. */ BUG_ON(!i2c_adapter->class); +#endif i2c_set_adapdata(i2c_adapter, &dev->v4l2_dev); i2c_adapter->dev.parent = &dev->pci->dev; i2c_adapter->algo = &saa7146_algo; |