From fae119beddb5c102f117f7f4bd59803e0f6637df Mon Sep 17 00:00:00 2001 From: Julia Lawall Date: Wed, 11 Mar 2015 13:56:29 -0300 Subject: [media] media: pci: cx23885: don't export static symbol The semantic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // @r@ type T; identifier f; @@ static T f (...) { ... } @@ identifier r.f; declarer name EXPORT_SYMBOL; @@ -EXPORT_SYMBOL(f); // Signed-off-by: Julia Lawall Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/media/pci/cx23885/altera-ci.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'drivers/media/pci/cx23885') diff --git a/drivers/media/pci/cx23885/altera-ci.c b/drivers/media/pci/cx23885/altera-ci.c index 2bbbf54..0a91df2 100644 --- a/drivers/media/pci/cx23885/altera-ci.c +++ b/drivers/media/pci/cx23885/altera-ci.c @@ -483,7 +483,6 @@ static void altera_hw_filt_release(void *main_dev, int filt_nr) } } -EXPORT_SYMBOL(altera_hw_filt_release); void altera_ci_release(void *dev, int ci_nr) { @@ -598,7 +597,6 @@ static int altera_pid_feed_control(void *demux_dev, int filt_nr, return 0; } -EXPORT_SYMBOL(altera_pid_feed_control); static int altera_ci_start_feed(struct dvb_demux_feed *feed, int num) { @@ -699,7 +697,6 @@ err: return ret; } -EXPORT_SYMBOL(altera_hw_filt_init); int altera_ci_init(struct altera_ci_config *config, int ci_nr) { -- cgit v1.1 From d76e08784cb8c08669613b6c1103452b5e4094c0 Mon Sep 17 00:00:00 2001 From: Antti Palosaari Date: Mon, 23 Mar 2015 18:52:46 -0300 Subject: [media] cx23885: switch ts2022 to ts2020 driver Change ts2022 driver to ts2020 driver. ts2020 driver supports both chip models. Cc: Olli Salonen Cc: Nibble Max Tested-by: David Howells Signed-off-by: Antti Palosaari Signed-off-by: Mauro Carvalho Chehab --- drivers/media/pci/cx23885/Kconfig | 1 - drivers/media/pci/cx23885/cx23885-dvb.c | 30 +++++++++++++----------------- 2 files changed, 13 insertions(+), 18 deletions(-) (limited to 'drivers/media/pci/cx23885') diff --git a/drivers/media/pci/cx23885/Kconfig b/drivers/media/pci/cx23885/Kconfig index 74d774e..2e1b88c 100644 --- a/drivers/media/pci/cx23885/Kconfig +++ b/drivers/media/pci/cx23885/Kconfig @@ -40,7 +40,6 @@ config VIDEO_CX23885 select MEDIA_TUNER_TDA18271 if MEDIA_SUBDRV_AUTOSELECT select MEDIA_TUNER_XC5000 if MEDIA_SUBDRV_AUTOSELECT select MEDIA_TUNER_SI2157 if MEDIA_SUBDRV_AUTOSELECT - select MEDIA_TUNER_M88TS2022 if MEDIA_SUBDRV_AUTOSELECT select MEDIA_TUNER_M88RS6000T if MEDIA_SUBDRV_AUTOSELECT select DVB_TUNER_DIB0070 if MEDIA_SUBDRV_AUTOSELECT ---help--- diff --git a/drivers/media/pci/cx23885/cx23885-dvb.c b/drivers/media/pci/cx23885/cx23885-dvb.c index 45fbe1e..745caab 100644 --- a/drivers/media/pci/cx23885/cx23885-dvb.c +++ b/drivers/media/pci/cx23885/cx23885-dvb.c @@ -73,7 +73,6 @@ #include "si2157.h" #include "sp2.h" #include "m88ds3103.h" -#include "m88ts2022.h" #include "m88rs6000t.h" static unsigned int debug; @@ -1187,7 +1186,7 @@ static int dvb_register(struct cx23885_tsport *port) struct vb2_dvb_frontend *fe0, *fe1 = NULL; struct si2168_config si2168_config; struct si2157_config si2157_config; - struct m88ts2022_config m88ts2022_config; + struct ts2020_config ts2020_config; struct i2c_board_info info; struct i2c_adapter *adapter; struct i2c_client *client_demod = NULL, *client_tuner = NULL; @@ -1856,13 +1855,12 @@ static int dvb_register(struct cx23885_tsport *port) break; /* attach tuner */ - memset(&m88ts2022_config, 0, sizeof(m88ts2022_config)); - m88ts2022_config.fe = fe0->dvb.frontend; - m88ts2022_config.clock = 27000000; + memset(&ts2020_config, 0, sizeof(ts2020_config)); + ts2020_config.fe = fe0->dvb.frontend; memset(&info, 0, sizeof(struct i2c_board_info)); - strlcpy(info.type, "m88ts2022", I2C_NAME_SIZE); + strlcpy(info.type, "ts2020", I2C_NAME_SIZE); info.addr = 0x60; - info.platform_data = &m88ts2022_config; + info.platform_data = &ts2020_config; request_module(info.type); client_tuner = i2c_new_device(adapter, &info); if (client_tuner == NULL || @@ -1986,13 +1984,12 @@ static int dvb_register(struct cx23885_tsport *port) break; /* attach tuner */ - memset(&m88ts2022_config, 0, sizeof(m88ts2022_config)); - m88ts2022_config.fe = fe0->dvb.frontend; - m88ts2022_config.clock = 27000000; + memset(&ts2020_config, 0, sizeof(ts2020_config)); + ts2020_config.fe = fe0->dvb.frontend; memset(&info, 0, sizeof(struct i2c_board_info)); - strlcpy(info.type, "m88ts2022", I2C_NAME_SIZE); + strlcpy(info.type, "ts2020", I2C_NAME_SIZE); info.addr = 0x60; - info.platform_data = &m88ts2022_config; + info.platform_data = &ts2020_config; request_module(info.type); client_tuner = i2c_new_device(adapter, &info); if (client_tuner == NULL || client_tuner->dev.driver == NULL) @@ -2032,13 +2029,12 @@ static int dvb_register(struct cx23885_tsport *port) break; /* attach tuner */ - memset(&m88ts2022_config, 0, sizeof(m88ts2022_config)); - m88ts2022_config.fe = fe0->dvb.frontend; - m88ts2022_config.clock = 27000000; + memset(&ts2020_config, 0, sizeof(ts2020_config)); + ts2020_config.fe = fe0->dvb.frontend; memset(&info, 0, sizeof(struct i2c_board_info)); - strlcpy(info.type, "m88ts2022", I2C_NAME_SIZE); + strlcpy(info.type, "ts2020", I2C_NAME_SIZE); info.addr = 0x60; - info.platform_data = &m88ts2022_config; + info.platform_data = &ts2020_config; request_module(info.type); client_tuner = i2c_new_device(adapter, &info); if (client_tuner == NULL || client_tuner->dev.driver == NULL) -- cgit v1.1 From af7f388e7452e1707f862378f38a0372c6c33728 Mon Sep 17 00:00:00 2001 From: David Howells Date: Thu, 26 Mar 2015 10:06:21 -0300 Subject: [media] cx23885: Always initialise dev->slock spinlock The slock spinlock in the cx23885_dev struct is only initialised if analogue video is being used, but is used in other places too, leading to the attached lockdep complaint. Move the lock initialisation so that it is done unconditionally. INFO: trying to register non-static key. the code is fine but needs lockdep annotation. turning off the locking correctness validator. CPU: 1 PID: 4413 Comm: scandvb Tainted: G W 4.0.0-rc1-fsdevel+ #25 Hardware name: System manufacturer System Product Name/P5Q PRO TURBO, BIOS 0701 10/08/2012 0000000000000000 ffff880129d779d8 ffffffff8162bbdf 0000000000000006 0000000000000000 ffff880129d77aa8 ffffffff810780e3 0000000000000001 0000000000000046 0000000000000004 ffffffff81c3f180 0000000000000000 Call Trace: [] dump_stack+0x4c/0x65 [] __lock_acquire+0x7b5/0x1a0e [] lock_acquire+0x97/0x10c [] ? cx23885_buf_queue+0x69/0x142 [cx23885] [] ? amd_set_subcaches+0x19b/0x19b [] _raw_spin_lock_irqsave+0x36/0x4a [] ? cx23885_buf_queue+0x69/0x142 [cx23885] [] cx23885_buf_queue+0x69/0x142 [cx23885] [] buffer_queue+0x17/0x19 [cx23885] [] __enqueue_in_driver+0x6a/0x6f [videobuf2_core] [] vb2_start_streaming+0x37/0x129 [videobuf2_core] [] vb2_internal_streamon+0xc5/0x105 [videobuf2_core] [] __vb2_init_fileio+0x224/0x286 [videobuf2_core] [] ? vb2_thread_start+0x7b/0x15f [videobuf2_core] [] ? vb2_dvb_start_feed+0x86/0x86 [videobuf2_dvb] [] vb2_thread_start+0xc1/0x15f [videobuf2_core] [] ? dmx_section_feed_start_filtering+0x2f/0x14f [] vb2_dvb_start_feed+0x5b/0x86 [videobuf2_dvb] [] dmx_section_feed_start_filtering+0xfd/0x14f [] dvb_dmxdev_filter_start+0x23f/0x315 [] dvb_demux_do_ioctl+0x1fb/0x556 [] dvb_usercopy+0xb4/0x11c [] ? dvb_dmxdev_ts_callback+0xd0/0xd0 [] dvb_demux_ioctl+0x10/0x14 [] do_vfs_ioctl+0x3c1/0x474 [] ? file_has_perm+0x5b/0x7f [] ? __audit_syscall_entry+0xbc/0xde [] SyS_ioctl+0x55/0x7a [] system_call_fastpath+0x12/0x17 Signed-off-by: David Howells Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/media/pci/cx23885/cx23885-core.c | 1 + drivers/media/pci/cx23885/cx23885-video.c | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/media/pci/cx23885') diff --git a/drivers/media/pci/cx23885/cx23885-core.c b/drivers/media/pci/cx23885/cx23885-core.c index 1ad4994..7aee76a 100644 --- a/drivers/media/pci/cx23885/cx23885-core.c +++ b/drivers/media/pci/cx23885/cx23885-core.c @@ -825,6 +825,7 @@ static int cx23885_dev_setup(struct cx23885_dev *dev) int i; spin_lock_init(&dev->pci_irqmask_lock); + spin_lock_init(&dev->slock); mutex_init(&dev->lock); mutex_init(&dev->gpio_lock); diff --git a/drivers/media/pci/cx23885/cx23885-video.c b/drivers/media/pci/cx23885/cx23885-video.c index 5e93c68..2232b38 100644 --- a/drivers/media/pci/cx23885/cx23885-video.c +++ b/drivers/media/pci/cx23885/cx23885-video.c @@ -1137,7 +1137,6 @@ int cx23885_video_register(struct cx23885_dev *dev) int err; dprintk(1, "%s()\n", __func__); - spin_lock_init(&dev->slock); /* Initialize VBI template */ cx23885_vbi_template = cx23885_video_template; -- cgit v1.1 From 9b174527e7b756cda9f5d9e541f87b7fec9cfdf0 Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Wed, 18 Feb 2015 14:12:42 -0300 Subject: [media] Add and use IS_REACHABLE macro In the media drivers, the v4l2 core knows about all submodules and calls into them from a common function. However this cannot work if the modules that get called are loadable and the core is built-in. In that case we get drivers/built-in.o: In function `set_type': drivers/media/v4l2-core/tuner-core.c:301: undefined reference to `tea5767_attach' drivers/media/v4l2-core/tuner-core.c:307: undefined reference to `tea5761_attach' drivers/media/v4l2-core/tuner-core.c:349: undefined reference to `tda9887_attach' drivers/media/v4l2-core/tuner-core.c:405: undefined reference to `xc4000_attach' This was working previously, until the IS_ENABLED() macro was used to replace the construct like #if defined(CONFIG_DVB_CX24110) || (defined(CONFIG_DVB_CX24110_MODULE) && defined(MODULE)) with the difference that the new code no longer checks whether it is being built as a loadable module itself. To fix this, this new patch adds an 'IS_REACHABLE' macro, which evaluates true in exactly the condition that was used previously. The downside of this is that this trades an obvious link error for a more subtle runtime failure, but it is clear that the change that introduced the link error was unintentional and it seems better to revert it for now. Also, a similar change was originally created by Trent Piepho and then reverted by teh change to the IS_ENABLED macro. Ideally Kconfig would be used to avoid the case of a broken dependency, or the code restructured in a way to turn around the dependency, but either way would require much larger changes here. Fixes: 7b34be71db53 ("[media] use IS_ENABLED() macro") See-also: c5dec9fb248e ("V4L/DVB (4751): Fix DBV_FE_CUSTOMISE for card drivers compiled into kernel") Signed-off-by: Arnd Bergmann Signed-off-by: Mauro Carvalho Chehab --- drivers/media/pci/cx23885/altera-ci.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/media/pci/cx23885') diff --git a/drivers/media/pci/cx23885/altera-ci.h b/drivers/media/pci/cx23885/altera-ci.h index 5028f0c..6c51172 100644 --- a/drivers/media/pci/cx23885/altera-ci.h +++ b/drivers/media/pci/cx23885/altera-ci.h @@ -39,7 +39,7 @@ struct altera_ci_config { int (*fpga_rw) (void *dev, int ad_rg, int val, int rw); }; -#if IS_ENABLED(CONFIG_MEDIA_ALTERA_CI) +#if IS_REACHABLE(CONFIG_MEDIA_ALTERA_CI) extern int altera_ci_init(struct altera_ci_config *config, int ci_nr); extern void altera_ci_release(void *dev, int ci_nr); -- cgit v1.1