Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] e4000: make VIDEO_V4L2 dependency optional

That tuner driver is mainly for DVB API, but there is some V4L2 API
controls for SDR usage. Make driver compile conditional so that V4L2
is not mandatory. Without the V4L2 support driver is build as a DVB
only, without SDR controls.

Fixes following errors reported by kbuild test robot:
ERROR: "v4l2_ctrl_auto_cluster" [drivers/media/tuners/e4000.ko] undefined!
ERROR: "v4l2_ctrl_new_std" [drivers/media/tuners/e4000.ko] undefined!
ERROR: "v4l2_ctrl_handler_init_class" [drivers/media/tuners/e4000.ko] undefined!
ERROR: "v4l2_ctrl_handler_free" [drivers/media/tuners/e4000.ko] undefined!

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Cc: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>

authored by

Antti Palosaari and committed by
Mauro Carvalho Chehab
320c6387 ed97a6fe

+7 -1
+1 -1
drivers/media/tuners/Kconfig
··· 203 203 204 204 config MEDIA_TUNER_E4000 205 205 tristate "Elonics E4000 silicon tuner" 206 - depends on MEDIA_SUPPORT && I2C && VIDEO_V4L2 206 + depends on MEDIA_SUPPORT && I2C 207 207 select REGMAP_I2C 208 208 default m if !MEDIA_SUBDRV_AUTOSELECT 209 209 help
+6
drivers/media/tuners/e4000.c
··· 269 269 return 0; 270 270 } 271 271 272 + #if IS_ENABLED(CONFIG_VIDEO_V4L2) 272 273 static int e4000_set_lna_gain(struct dvb_frontend *fe) 273 274 { 274 275 struct e4000 *s = fe->tuner_priv; ··· 457 456 .g_volatile_ctrl = e4000_g_volatile_ctrl, 458 457 .s_ctrl = e4000_s_ctrl, 459 458 }; 459 + #endif 460 460 461 461 static const struct dvb_tuner_ops e4000_tuner_ops = { 462 462 .info = { ··· 524 522 if (ret) 525 523 goto err; 526 524 525 + #if IS_ENABLED(CONFIG_VIDEO_V4L2) 527 526 /* Register controls */ 528 527 v4l2_ctrl_handler_init(&s->hdl, 9); 529 528 s->bandwidth_auto = v4l2_ctrl_new_std(&s->hdl, &e4000_ctrl_ops, ··· 557 554 } 558 555 559 556 s->sd.ctrl_handler = &s->hdl; 557 + #endif 560 558 561 559 dev_info(&s->client->dev, 562 560 "%s: Elonics E4000 successfully identified\n", ··· 588 584 589 585 dev_dbg(&client->dev, "%s:\n", __func__); 590 586 587 + #if IS_ENABLED(CONFIG_VIDEO_V4L2) 591 588 v4l2_ctrl_handler_free(&s->hdl); 589 + #endif 592 590 memset(&fe->ops.tuner_ops, 0, sizeof(struct dvb_tuner_ops)); 593 591 fe->tuner_priv = NULL; 594 592 kfree(s);