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

media: rc: clean up Kconfig dependencies

I came across a randconfig build failure from one driver
that only depends on CONFIG_USB_ARCH_HAS_HCD but fails when
built without CONFIG_USB:

ld: drivers/media/rc/ir_toy.o: in function `irtoy_disconnect':
ir_toy.c:(.text+0x24): undefined reference to `usb_kill_urb'
ld: ir_toy.c:(.text+0x2c): undefined reference to `usb_free_urb'
ld: ir_toy.c:(.text+0x34): undefined reference to `usb_kill_urb'
ld: ir_toy.c:(.text+0x3c): undefined reference to `usb_free_urb'

Upon a closer look, I find that a lot of the other drivers
'select USB' rather than stating 'depends on USB' as is common
for most subsystems. I also find that all except one driver
have an extra 'depends on RC_CORE' that is already implied by
the top-level 'if RC_CORE' check.

Clean up both by reducing the dependencies to the required set.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

authored by

Arnd Bergmann and committed by
Mauro Carvalho Chehab
52518e51 58c08df5

+11 -62
+11 -62
drivers/media/rc/Kconfig
··· 19 19 20 20 config LIRC 21 21 bool "LIRC user interface" 22 - depends on RC_CORE 23 22 help 24 23 Enable this option to enable the Linux Infrared Remote 25 24 Control user interface (e.g. /dev/lirc*). This interface ··· 40 41 41 42 menuconfig RC_DECODERS 42 43 bool "Remote controller decoders" 43 - depends on RC_CORE 44 44 45 45 if RC_DECODERS 46 46 config IR_NEC_DECODER 47 47 tristate "Enable IR raw decoder for the NEC protocol" 48 - depends on RC_CORE 49 48 select BITREVERSE 50 49 51 50 help ··· 52 55 53 56 config IR_RC5_DECODER 54 57 tristate "Enable IR raw decoder for the RC-5 protocol" 55 - depends on RC_CORE 56 58 select BITREVERSE 57 59 58 60 help ··· 60 64 61 65 config IR_RC6_DECODER 62 66 tristate "Enable IR raw decoder for the RC6 protocol" 63 - depends on RC_CORE 64 67 select BITREVERSE 65 68 66 69 help ··· 68 73 69 74 config IR_JVC_DECODER 70 75 tristate "Enable IR raw decoder for the JVC protocol" 71 - depends on RC_CORE 72 76 select BITREVERSE 73 77 74 78 help ··· 76 82 77 83 config IR_SONY_DECODER 78 84 tristate "Enable IR raw decoder for the Sony protocol" 79 - depends on RC_CORE 80 85 select BITREVERSE 81 86 82 87 help ··· 84 91 85 92 config IR_SANYO_DECODER 86 93 tristate "Enable IR raw decoder for the Sanyo protocol" 87 - depends on RC_CORE 88 94 select BITREVERSE 89 95 90 96 help ··· 93 101 94 102 config IR_SHARP_DECODER 95 103 tristate "Enable IR raw decoder for the Sharp protocol" 96 - depends on RC_CORE 97 104 select BITREVERSE 98 105 99 106 help ··· 102 111 103 112 config IR_MCE_KBD_DECODER 104 113 tristate "Enable IR raw decoder for the MCE keyboard/mouse protocol" 105 - depends on RC_CORE 106 114 select BITREVERSE 107 115 108 116 help ··· 111 121 112 122 config IR_XMP_DECODER 113 123 tristate "Enable IR raw decoder for the XMP protocol" 114 - depends on RC_CORE 115 124 select BITREVERSE 116 125 117 126 help ··· 119 130 120 131 config IR_IMON_DECODER 121 132 tristate "Enable IR raw decoder for the iMON protocol" 122 - depends on RC_CORE 123 133 help 124 134 Enable this option if you have iMON PAD or Antec Veris infrared 125 135 remote control and you would like to use it with a raw IR ··· 126 138 127 139 config IR_RCMM_DECODER 128 140 tristate "Enable IR raw decoder for the RC-MM protocol" 129 - depends on RC_CORE 130 141 help 131 142 Enable this option when you have IR with RC-MM protocol, and 132 143 you need the software decoder. The driver supports 12, ··· 140 153 141 154 menuconfig RC_DEVICES 142 155 bool "Remote Controller devices" 143 - depends on RC_CORE 144 156 145 157 if RC_DEVICES 146 158 147 159 config RC_ATI_REMOTE 148 160 tristate "ATI / X10 based USB RF remote controls" 149 - depends on USB_ARCH_HAS_HCD 150 - depends on RC_CORE 151 - select USB 161 + depends on USB 152 162 help 153 163 Say Y here if you want to use an X10 based USB remote control. 154 164 These are RF remotes with USB receivers. ··· 163 179 config IR_ENE 164 180 tristate "ENE eHome Receiver/Transceiver (pnp id: ENE0100/ENE02xxx)" 165 181 depends on PNP || COMPILE_TEST 166 - depends on RC_CORE 167 182 help 168 183 Say Y here to enable support for integrated infrared receiver 169 184 /transceiver made by ENE. ··· 175 192 176 193 config IR_HIX5HD2 177 194 tristate "Hisilicon hix5hd2 IR remote control" 178 - depends on RC_CORE 179 195 depends on OF || COMPILE_TEST 180 196 help 181 197 Say Y here if you want to use hisilicon hix5hd2 remote control. ··· 185 203 186 204 config IR_IMON 187 205 tristate "SoundGraph iMON Receiver and Display" 188 - depends on USB_ARCH_HAS_HCD 189 - depends on RC_CORE 190 - select USB 206 + depends on USB 191 207 help 192 208 Say Y here if you want to use a SoundGraph iMON (aka Antec Veris) 193 209 IR Receiver and/or LCD/VFD/VGA display. ··· 195 215 196 216 config IR_IMON_RAW 197 217 tristate "SoundGraph iMON Receiver (early raw IR models)" 198 - depends on USB_ARCH_HAS_HCD 199 - depends on RC_CORE 200 - select USB 218 + depends on USB 201 219 help 202 220 Say Y here if you want to use a SoundGraph iMON IR Receiver, 203 221 early raw models. ··· 205 227 206 228 config IR_MCEUSB 207 229 tristate "Windows Media Center Ed. eHome Infrared Transceiver" 208 - depends on USB_ARCH_HAS_HCD 209 - depends on RC_CORE 210 - select USB 230 + depends on USB 211 231 help 212 232 Say Y here if you want to use a Windows Media Center Edition 213 233 eHome Infrared Transceiver. ··· 216 240 config IR_ITE_CIR 217 241 tristate "ITE Tech Inc. IT8712/IT8512 Consumer Infrared Transceiver" 218 242 depends on PNP || COMPILE_TEST 219 - depends on RC_CORE 220 243 help 221 244 Say Y here to enable support for integrated infrared receivers 222 245 /transceivers made by ITE Tech Inc. These are found in ··· 228 253 config IR_FINTEK 229 254 tristate "Fintek Consumer Infrared Transceiver" 230 255 depends on PNP || COMPILE_TEST 231 - depends on RC_CORE 232 256 help 233 257 Say Y here to enable support for integrated infrared receiver 234 258 /transceiver made by Fintek. This chip is found on assorted ··· 238 264 239 265 config IR_MESON 240 266 tristate "Amlogic Meson IR remote receiver" 241 - depends on RC_CORE 242 267 depends on ARCH_MESON || COMPILE_TEST 243 268 help 244 269 Say Y if you want to use the IR remote receiver available ··· 248 275 249 276 config IR_MTK 250 277 tristate "Mediatek IR remote receiver" 251 - depends on RC_CORE 252 278 depends on ARCH_MEDIATEK || COMPILE_TEST 253 279 help 254 280 Say Y if you want to use the IR remote receiver available ··· 259 287 config IR_NUVOTON 260 288 tristate "Nuvoton w836x7hg Consumer Infrared Transceiver" 261 289 depends on PNP || COMPILE_TEST 262 - depends on RC_CORE 263 290 help 264 291 Say Y here to enable support for integrated infrared receiver 265 292 /transceiver made by Nuvoton (formerly Winbond). This chip is ··· 270 299 271 300 config IR_REDRAT3 272 301 tristate "RedRat3 IR Transceiver" 273 - depends on USB_ARCH_HAS_HCD 274 - depends on RC_CORE 302 + depends on USB 275 303 select NEW_LEDS 276 304 select LEDS_CLASS 277 - select USB 278 305 help 279 306 Say Y here if you want to use a RedRat3 Infrared Transceiver. 280 307 ··· 291 322 292 323 config IR_STREAMZAP 293 324 tristate "Streamzap PC Remote IR Receiver" 294 - depends on USB_ARCH_HAS_HCD 295 - depends on RC_CORE 296 - select USB 325 + depends on USB 297 326 help 298 327 Say Y here if you want to use a Streamzap PC Remote 299 328 Infrared Receiver. ··· 302 335 config IR_WINBOND_CIR 303 336 tristate "Winbond IR remote control" 304 337 depends on (X86 && PNP) || COMPILE_TEST 305 - depends on RC_CORE 306 338 select NEW_LEDS 307 339 select LEDS_CLASS 308 340 select BITREVERSE ··· 316 350 317 351 config IR_IGORPLUGUSB 318 352 tristate "IgorPlug-USB IR Receiver" 319 - depends on USB_ARCH_HAS_HCD 320 - depends on RC_CORE 321 - select USB 353 + depends on USB 322 354 help 323 355 Say Y here if you want to use the IgorPlug-USB IR Receiver by 324 356 Igor Cesko. This device is included on the Fit-PC2. ··· 329 365 330 366 config IR_IGUANA 331 367 tristate "IguanaWorks USB IR Transceiver" 332 - depends on USB_ARCH_HAS_HCD 333 - depends on RC_CORE 334 - select USB 368 + depends on USB 335 369 help 336 370 Say Y here if you want to use the IguanaWorks USB IR Transceiver. 337 371 Both infrared receive and send are supported. If you want to ··· 343 381 344 382 config IR_TTUSBIR 345 383 tristate "TechnoTrend USB IR Receiver" 346 - depends on USB_ARCH_HAS_HCD 347 - depends on RC_CORE 348 - select USB 384 + depends on USB 349 385 select NEW_LEDS 350 386 select LEDS_CLASS 351 387 help ··· 367 407 368 408 config RC_LOOPBACK 369 409 tristate "Remote Control Loopback Driver" 370 - depends on RC_CORE 371 410 help 372 411 Say Y here if you want support for the remote control loopback 373 412 driver which allows TX data to be sent back as RX data. ··· 379 420 380 421 config IR_GPIO_CIR 381 422 tristate "GPIO IR remote control" 382 - depends on RC_CORE 383 423 depends on (OF && GPIOLIB) || COMPILE_TEST 384 424 help 385 425 Say Y if you want to use GPIO based IR Receiver. ··· 388 430 389 431 config IR_GPIO_TX 390 432 tristate "GPIO IR Bit Banging Transmitter" 391 - depends on RC_CORE 392 433 depends on LIRC 393 434 depends on (OF && GPIOLIB) || COMPILE_TEST 394 435 help ··· 399 442 400 443 config IR_PWM_TX 401 444 tristate "PWM IR transmitter" 402 - depends on RC_CORE 403 445 depends on LIRC 404 446 depends on PWM 405 447 depends on OF || COMPILE_TEST ··· 411 455 412 456 config RC_ST 413 457 tristate "ST remote control receiver" 414 - depends on RC_CORE 415 458 depends on ARCH_STI || COMPILE_TEST 416 459 help 417 460 Say Y here if you want support for ST remote control driver ··· 421 466 422 467 config IR_SUNXI 423 468 tristate "SUNXI IR remote control" 424 - depends on RC_CORE 425 469 depends on ARCH_SUNXI || COMPILE_TEST 426 470 help 427 471 Say Y if you want to use sunXi internal IR Controller ··· 430 476 431 477 config IR_SERIAL 432 478 tristate "Homebrew Serial Port Receiver" 433 - depends on RC_CORE 434 479 help 435 480 Say Y if you want to use Homebrew Serial Port Receivers and 436 481 Transceivers. ··· 445 492 446 493 config IR_SIR 447 494 tristate "Built-in SIR IrDA port" 448 - depends on RC_CORE 449 495 help 450 496 Say Y if you want to use a IrDA SIR port Transceivers. 451 497 ··· 453 501 454 502 config RC_XBOX_DVD 455 503 tristate "Xbox DVD Movie Playback Kit" 456 - depends on RC_CORE 457 - depends on USB_ARCH_HAS_HCD 458 - select USB 504 + depends on USB 459 505 help 460 506 Say Y here if you want to use the Xbox DVD Movie Playback Kit. 461 507 These are IR remotes with USB receivers for the Original Xbox (2001). ··· 463 513 464 514 config IR_TOY 465 515 tristate "Infrared Toy and IR Droid" 466 - depends on RC_CORE 467 - depends on USB_ARCH_HAS_HCD 516 + depends on USB 468 517 help 469 518 Say Y here if you want to use the Infrared Toy or IR Droid, USB 470 519 versions.