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

USB: cdc_subset: only build when one driver is enabled

This avoids a harmless randconfig warning I get when USB_NET_CDC_SUBSET
is enabled, but all of the more specific drivers are not:

drivers/net/usb/cdc_subset.c:241:2: #warning You need to configure some hardware for this driver

The current behavior is clearly intentional, giving a warning when
a user picks a configuration that won't do anything good. The only
reason for even addressing this is that I'm getting close to
eliminating all 'randconfig' warnings on ARM, and this came up
a couple of times.

My workaround is to not even build the module when none of the
configurations are enable.

Alternatively we could simply remove the #warning (nothing wrong
for compile-testing), turn it into a runtime warning, or
change the Kconfig options into a menu to hide CONFIG_USB_NET_CDC_SUBSET.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Arnd Bergmann and committed by
David S. Miller
f3bb2376 f468a729

+11 -1
+10
drivers/net/usb/Kconfig
··· 395 395 The protocol specification is incomplete, and is controlled by 396 396 (and for) Microsoft; it isn't an "Open" ecosystem or market. 397 397 398 + config USB_NET_CDC_SUBSET_ENABLE 399 + tristate 400 + depends on USB_NET_CDC_SUBSET 401 + 398 402 config USB_NET_CDC_SUBSET 399 403 tristate "Simple USB Network Links (CDC Ethernet subset)" 400 404 depends on USB_USBNET ··· 417 413 config USB_ALI_M5632 418 414 bool "ALi M5632 based 'USB 2.0 Data Link' cables" 419 415 depends on USB_NET_CDC_SUBSET 416 + select USB_NET_CDC_SUBSET_ENABLE 420 417 help 421 418 Choose this option if you're using a host-to-host cable 422 419 based on this design, which supports USB 2.0 high speed. ··· 425 420 config USB_AN2720 426 421 bool "AnchorChips 2720 based cables (Xircom PGUNET, ...)" 427 422 depends on USB_NET_CDC_SUBSET 423 + select USB_NET_CDC_SUBSET_ENABLE 428 424 help 429 425 Choose this option if you're using a host-to-host cable 430 426 based on this design. Note that AnchorChips is now a ··· 434 428 config USB_BELKIN 435 429 bool "eTEK based host-to-host cables (Advance, Belkin, ...)" 436 430 depends on USB_NET_CDC_SUBSET 431 + select USB_NET_CDC_SUBSET_ENABLE 437 432 default y 438 433 help 439 434 Choose this option if you're using a host-to-host cable ··· 444 437 config USB_ARMLINUX 445 438 bool "Embedded ARM Linux links (iPaq, ...)" 446 439 depends on USB_NET_CDC_SUBSET 440 + select USB_NET_CDC_SUBSET_ENABLE 447 441 default y 448 442 help 449 443 Choose this option to support the "usb-eth" networking driver ··· 462 454 config USB_EPSON2888 463 455 bool "Epson 2888 based firmware (DEVELOPMENT)" 464 456 depends on USB_NET_CDC_SUBSET 457 + select USB_NET_CDC_SUBSET_ENABLE 465 458 help 466 459 Choose this option to support the usb networking links used 467 460 by some sample firmware from Epson. ··· 470 461 config USB_KC2190 471 462 bool "KT Technology KC2190 based cables (InstaNet)" 472 463 depends on USB_NET_CDC_SUBSET 464 + select USB_NET_CDC_SUBSET_ENABLE 473 465 help 474 466 Choose this option if you're using a host-to-host cable 475 467 with one of these chips.
+1 -1
drivers/net/usb/Makefile
··· 23 23 obj-$(CONFIG_USB_NET_NET1080) += net1080.o 24 24 obj-$(CONFIG_USB_NET_PLUSB) += plusb.o 25 25 obj-$(CONFIG_USB_NET_RNDIS_HOST) += rndis_host.o 26 - obj-$(CONFIG_USB_NET_CDC_SUBSET) += cdc_subset.o 26 + obj-$(CONFIG_USB_NET_CDC_SUBSET_ENABLE) += cdc_subset.o 27 27 obj-$(CONFIG_USB_NET_ZAURUS) += zaurus.o 28 28 obj-$(CONFIG_USB_NET_MCS7830) += mcs7830.o 29 29 obj-$(CONFIG_USB_USBNET) += usbnet.o