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

i2c-i801: Don't depend on other kernel driver config options

Don't let other driver config options influence us, as it makes the
code more complex and fragile for a small benefit. There's nothing
wrong with instantiating I2C devices even if they don't have a driver.
And we're talking about 835 extra bytes in the binary on x86-64,
that's hardly worth arguing about.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: David Woodhouse <david.woodhouse@intel.com>
Cc: Hans de Goede <hdegoede@redhat.com>

authored by

Jean Delvare and committed by
Jean Delvare
8eacfceb 6aa1464d

+7 -10
+1
drivers/i2c/busses/Kconfig
··· 79 79 config I2C_I801 80 80 tristate "Intel 82801 (ICH/PCH)" 81 81 depends on PCI 82 + select CHECK_SIGNATURE if X86 && DMI 82 83 help 83 84 If you say yes to this option, support will be included for the Intel 84 85 801 family of mainboard I2C interfaces. Specifically, the following
+6 -10
drivers/i2c/busses/i2c-i801.c
··· 638 638 639 639 MODULE_DEVICE_TABLE(pci, i801_ids); 640 640 641 - #if defined CONFIG_INPUT_APANEL || defined CONFIG_INPUT_APANEL_MODULE 641 + #if defined CONFIG_X86 && defined CONFIG_DMI 642 642 static unsigned char apanel_addr; 643 643 644 644 /* Scan the system ROM for the signature "FJKEYINF" */ ··· 668 668 } 669 669 iounmap(bios); 670 670 } 671 - #else 672 - static void __init input_apanel_init(void) {} 673 - #endif 674 671 675 - #if defined CONFIG_SENSORS_FSCHMD || defined CONFIG_SENSORS_FSCHMD_MODULE 676 672 struct dmi_onboard_device_info { 677 673 const char *name; 678 674 u8 type; ··· 734 738 dmi_check_onboard_device(type, name, adap); 735 739 } 736 740 } 737 - #endif 738 741 739 742 /* Register optional slaves */ 740 743 static void __devinit i801_probe_optional_slaves(struct i801_priv *priv) ··· 742 747 if (priv->features & FEATURE_IDF) 743 748 return; 744 749 745 - #if defined CONFIG_INPUT_APANEL || defined CONFIG_INPUT_APANEL_MODULE 746 750 if (apanel_addr) { 747 751 struct i2c_board_info info; 748 752 ··· 750 756 strlcpy(info.type, "fujitsu_apanel", I2C_NAME_SIZE); 751 757 i2c_new_device(&priv->adapter, &info); 752 758 } 753 - #endif 754 - #if defined CONFIG_SENSORS_FSCHMD || defined CONFIG_SENSORS_FSCHMD_MODULE 759 + 755 760 if (dmi_name_in_vendors("FUJITSU")) 756 761 dmi_walk(dmi_check_onboard_devices, &priv->adapter); 757 - #endif 758 762 } 763 + #else 764 + static void __init input_apanel_init(void) {} 765 + static void __devinit i801_probe_optional_slaves(struct i801_priv *priv) {} 766 + #endif /* CONFIG_X86 && CONFIG_DMI */ 759 767 760 768 static int __devinit i801_probe(struct pci_dev *dev, 761 769 const struct pci_device_id *id)