[media] Add and use IS_REACHABLE macro
authorArnd Bergmann <arnd@arndb.de>
Wed, 18 Feb 2015 17:12:42 +0000 (14:12 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Wed, 8 Apr 2015 18:02:07 +0000 (15:02 -0300)
commit9b174527e7b756cda9f5d9e541f87b7fec9cfdf0
tree832548b73f17871eff00880b7acef080991aa30a
parenta87a4d34286e5f790d2b495db5f37753ef75a80d
[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 <arnd@arndb.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
116 files changed:
drivers/media/dvb-frontends/a8293.h
drivers/media/dvb-frontends/af9013.h
drivers/media/dvb-frontends/atbm8830.h
drivers/media/dvb-frontends/au8522.h
drivers/media/dvb-frontends/bcm3510.h
drivers/media/dvb-frontends/cx22700.h
drivers/media/dvb-frontends/cx22702.h
drivers/media/dvb-frontends/cx24110.h
drivers/media/dvb-frontends/cx24113.h
drivers/media/dvb-frontends/cx24116.h
drivers/media/dvb-frontends/cx24117.h
drivers/media/dvb-frontends/cx24123.h
drivers/media/dvb-frontends/cxd2820r.h
drivers/media/dvb-frontends/dib0070.h
drivers/media/dvb-frontends/dib0090.h
drivers/media/dvb-frontends/dib3000.h
drivers/media/dvb-frontends/dib3000mc.h
drivers/media/dvb-frontends/dib7000m.h
drivers/media/dvb-frontends/dib7000p.h
drivers/media/dvb-frontends/dib8000.h
drivers/media/dvb-frontends/dib9000.h
drivers/media/dvb-frontends/drxd.h
drivers/media/dvb-frontends/drxk.h
drivers/media/dvb-frontends/ds3000.h
drivers/media/dvb-frontends/dvb-pll.h
drivers/media/dvb-frontends/dvb_dummy_fe.h
drivers/media/dvb-frontends/ec100.h
drivers/media/dvb-frontends/hd29l2.h
drivers/media/dvb-frontends/isl6405.h
drivers/media/dvb-frontends/isl6421.h
drivers/media/dvb-frontends/isl6423.h
drivers/media/dvb-frontends/itd1000.h
drivers/media/dvb-frontends/ix2505v.h
drivers/media/dvb-frontends/l64781.h
drivers/media/dvb-frontends/lg2160.h
drivers/media/dvb-frontends/lgdt3305.h
drivers/media/dvb-frontends/lgdt330x.h
drivers/media/dvb-frontends/lgs8gl5.h
drivers/media/dvb-frontends/lgs8gxx.h
drivers/media/dvb-frontends/lnbh24.h
drivers/media/dvb-frontends/lnbp21.h
drivers/media/dvb-frontends/lnbp22.h
drivers/media/dvb-frontends/m88rs2000.h
drivers/media/dvb-frontends/mb86a16.h
drivers/media/dvb-frontends/mb86a20s.h
drivers/media/dvb-frontends/mt312.h
drivers/media/dvb-frontends/mt352.h
drivers/media/dvb-frontends/nxt200x.h
drivers/media/dvb-frontends/nxt6000.h
drivers/media/dvb-frontends/or51132.h
drivers/media/dvb-frontends/or51211.h
drivers/media/dvb-frontends/s5h1409.h
drivers/media/dvb-frontends/s5h1411.h
drivers/media/dvb-frontends/s5h1420.h
drivers/media/dvb-frontends/s5h1432.h
drivers/media/dvb-frontends/s921.h
drivers/media/dvb-frontends/si21xx.h
drivers/media/dvb-frontends/sp8870.h
drivers/media/dvb-frontends/sp887x.h
drivers/media/dvb-frontends/stb0899_drv.h
drivers/media/dvb-frontends/stb6000.h
drivers/media/dvb-frontends/stb6100.h
drivers/media/dvb-frontends/stv0288.h
drivers/media/dvb-frontends/stv0297.h
drivers/media/dvb-frontends/stv0299.h
drivers/media/dvb-frontends/stv0367.h
drivers/media/dvb-frontends/stv0900.h
drivers/media/dvb-frontends/stv090x.h
drivers/media/dvb-frontends/stv6110.h
drivers/media/dvb-frontends/stv6110x.h
drivers/media/dvb-frontends/tda1002x.h
drivers/media/dvb-frontends/tda10048.h
drivers/media/dvb-frontends/tda1004x.h
drivers/media/dvb-frontends/tda10071.h
drivers/media/dvb-frontends/tda10086.h
drivers/media/dvb-frontends/tda18271c2dd.h
drivers/media/dvb-frontends/tda665x.h
drivers/media/dvb-frontends/tda8083.h
drivers/media/dvb-frontends/tda8261.h
drivers/media/dvb-frontends/tda826x.h
drivers/media/dvb-frontends/ts2020.h
drivers/media/dvb-frontends/tua6100.h
drivers/media/dvb-frontends/ves1820.h
drivers/media/dvb-frontends/ves1x93.h
drivers/media/dvb-frontends/zl10036.h
drivers/media/dvb-frontends/zl10039.h
drivers/media/dvb-frontends/zl10353.h
drivers/media/pci/cx23885/altera-ci.h
drivers/media/tuners/fc0011.h
drivers/media/tuners/fc0012.h
drivers/media/tuners/fc0013.h
drivers/media/tuners/fc2580.h
drivers/media/tuners/max2165.h
drivers/media/tuners/mc44s803.h
drivers/media/tuners/mt2060.h
drivers/media/tuners/mt2063.h
drivers/media/tuners/mt20xx.h
drivers/media/tuners/mt2131.h
drivers/media/tuners/mt2266.h
drivers/media/tuners/mxl5005s.h
drivers/media/tuners/mxl5007t.h
drivers/media/tuners/qt1010.h
drivers/media/tuners/r820t.h
drivers/media/tuners/tda18218.h
drivers/media/tuners/tda18271.h
drivers/media/tuners/tda827x.h
drivers/media/tuners/tda8290.h
drivers/media/tuners/tda9887.h
drivers/media/tuners/tea5761.h
drivers/media/tuners/tea5767.h
drivers/media/tuners/tua9001.h
drivers/media/tuners/tuner-simple.h
drivers/media/tuners/tuner-xc2028.h
drivers/media/tuners/xc4000.h
drivers/media/tuners/xc5000.h
include/linux/kconfig.h