aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2011-05-24 14:58:49 -0400
committerJean Delvare <khali@endymion.delvare>2011-05-24 14:58:49 -0400
commit8eacfcebf0274310a751924c02c5c31cbdf057b3 (patch)
treec0e6a163da813a4b4b6a84f71d833e732c6e8818 /drivers/i2c
parent6aa1464d5482cc8f6f026ebb12d94b77a58c823b (diff)
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>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/busses/Kconfig1
-rw-r--r--drivers/i2c/busses/i2c-i801.c16
2 files changed, 7 insertions, 10 deletions
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index b24ca4e98ef8..428d098c35ef 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -79,6 +79,7 @@ config I2C_AMD8111
79config I2C_I801 79config I2C_I801
80 tristate "Intel 82801 (ICH/PCH)" 80 tristate "Intel 82801 (ICH/PCH)"
81 depends on PCI 81 depends on PCI
82 select CHECK_SIGNATURE if X86 && DMI
82 help 83 help
83 If you say yes to this option, support will be included for the Intel 84 If you say yes to this option, support will be included for the Intel
84 801 family of mainboard I2C interfaces. Specifically, the following 85 801 family of mainboard I2C interfaces. Specifically, the following
diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
index 1aa5be019cfc..ab26840d0c70 100644
--- a/drivers/i2c/busses/i2c-i801.c
+++ b/drivers/i2c/busses/i2c-i801.c
@@ -638,7 +638,7 @@ static const struct pci_device_id i801_ids[] = {
638 638
639MODULE_DEVICE_TABLE(pci, i801_ids); 639MODULE_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
642static unsigned char apanel_addr; 642static unsigned char apanel_addr;
643 643
644/* Scan the system ROM for the signature "FJKEYINF" */ 644/* Scan the system ROM for the signature "FJKEYINF" */
@@ -668,11 +668,7 @@ static void __init input_apanel_init(void)
668 } 668 }
669 iounmap(bios); 669 iounmap(bios);
670} 670}
671#else
672static void __init input_apanel_init(void) {}
673#endif
674 671
675#if defined CONFIG_SENSORS_FSCHMD || defined CONFIG_SENSORS_FSCHMD_MODULE
676struct dmi_onboard_device_info { 672struct dmi_onboard_device_info {
677 const char *name; 673 const char *name;
678 u8 type; 674 u8 type;
@@ -738,7 +734,6 @@ static void __devinit dmi_check_onboard_devices(const struct dmi_header *dm,
738 dmi_check_onboard_device(type, name, adap); 734 dmi_check_onboard_device(type, name, adap);
739 } 735 }
740} 736}
741#endif
742 737
743/* Register optional slaves */ 738/* Register optional slaves */
744static void __devinit i801_probe_optional_slaves(struct i801_priv *priv) 739static void __devinit i801_probe_optional_slaves(struct i801_priv *priv)
@@ -747,7 +742,6 @@ static void __devinit i801_probe_optional_slaves(struct i801_priv *priv)
747 if (priv->features & FEATURE_IDF) 742 if (priv->features & FEATURE_IDF)
748 return; 743 return;
749 744
750#if defined CONFIG_INPUT_APANEL || defined CONFIG_INPUT_APANEL_MODULE
751 if (apanel_addr) { 745 if (apanel_addr) {
752 struct i2c_board_info info; 746 struct i2c_board_info info;
753 747
@@ -756,12 +750,14 @@ static void __devinit i801_probe_optional_slaves(struct i801_priv *priv)
756 strlcpy(info.type, "fujitsu_apanel", I2C_NAME_SIZE); 750 strlcpy(info.type, "fujitsu_apanel", I2C_NAME_SIZE);
757 i2c_new_device(&priv->adapter, &info); 751 i2c_new_device(&priv->adapter, &info);
758 } 752 }
759#endif 753
760#if defined CONFIG_SENSORS_FSCHMD || defined CONFIG_SENSORS_FSCHMD_MODULE
761 if (dmi_name_in_vendors("FUJITSU")) 754 if (dmi_name_in_vendors("FUJITSU"))
762 dmi_walk(dmi_check_onboard_devices, &priv->adapter); 755 dmi_walk(dmi_check_onboard_devices, &priv->adapter);
763#endif
764} 756}
757#else
758static void __init input_apanel_init(void) {}
759static void __devinit i801_probe_optional_slaves(struct i801_priv *priv) {}
760#endif /* CONFIG_X86 && CONFIG_DMI */
765 761
766static int __devinit i801_probe(struct pci_dev *dev, 762static int __devinit i801_probe(struct pci_dev *dev,
767 const struct pci_device_id *id) 763 const struct pci_device_id *id)