aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-03-12 16:07:12 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-03-12 16:07:12 -0400
commit123d43acd2e55cd7db792d17c7e906db42cada42 (patch)
tree704c222d21fcc9954742f3e3b05ec8e22fe35c01
parent299601cfc0aabbabf82fca50652b7290cce7eb00 (diff)
parent3d706d952cf238a60c5571e33329448b453a2ab9 (diff)
Merge branch 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6
* 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6: i2c: chips subdirectory is deprecated i2c: Keep client->driver and client->dev.driver in sync i2c-amd756: Fix off-by-one
-rw-r--r--drivers/i2c/busses/i2c-amd756.c2
-rw-r--r--drivers/i2c/chips/Makefile7
-rw-r--r--drivers/i2c/i2c-core.c6
3 files changed, 13 insertions, 2 deletions
diff --git a/drivers/i2c/busses/i2c-amd756.c b/drivers/i2c/busses/i2c-amd756.c
index 573abe440842..2fa43183d375 100644
--- a/drivers/i2c/busses/i2c-amd756.c
+++ b/drivers/i2c/busses/i2c-amd756.c
@@ -335,7 +335,7 @@ static int __devinit amd756_probe(struct pci_dev *pdev,
335 u8 temp; 335 u8 temp;
336 336
337 /* driver_data might come from user-space, so check it */ 337 /* driver_data might come from user-space, so check it */
338 if (id->driver_data > ARRAY_SIZE(chipname)) 338 if (id->driver_data >= ARRAY_SIZE(chipname))
339 return -EINVAL; 339 return -EINVAL;
340 340
341 if (amd756_ioport) { 341 if (amd756_ioport) {
diff --git a/drivers/i2c/chips/Makefile b/drivers/i2c/chips/Makefile
index 501f00cea782..e47aca0ca5ae 100644
--- a/drivers/i2c/chips/Makefile
+++ b/drivers/i2c/chips/Makefile
@@ -1,6 +1,13 @@
1# 1#
2# Makefile for miscellaneous I2C chip drivers. 2# Makefile for miscellaneous I2C chip drivers.
3# 3#
4# Think twice before you add a new driver to this directory.
5# Device drivers are better grouped according to the functionality they
6# implement rather than to the bus they are connected to. In particular:
7# * Hardware monitoring chip drivers go to drivers/hwmon
8# * RTC chip drivers go to drivers/rtc
9# * I/O expander drivers go to drivers/gpio
10#
4 11
5obj-$(CONFIG_DS1682) += ds1682.o 12obj-$(CONFIG_DS1682) += ds1682.o
6obj-$(CONFIG_SENSORS_EEPROM) += eeprom.o 13obj-$(CONFIG_SENSORS_EEPROM) += eeprom.o
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 96da22e9a5a4..fd84b2a36338 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -90,12 +90,16 @@ static int i2c_device_probe(struct device *dev)
90{ 90{
91 struct i2c_client *client = to_i2c_client(dev); 91 struct i2c_client *client = to_i2c_client(dev);
92 struct i2c_driver *driver = to_i2c_driver(dev->driver); 92 struct i2c_driver *driver = to_i2c_driver(dev->driver);
93 int status;
93 94
94 if (!driver->probe) 95 if (!driver->probe)
95 return -ENODEV; 96 return -ENODEV;
96 client->driver = driver; 97 client->driver = driver;
97 dev_dbg(dev, "probe\n"); 98 dev_dbg(dev, "probe\n");
98 return driver->probe(client); 99 status = driver->probe(client);
100 if (status)
101 client->driver = NULL;
102 return status;
99} 103}
100 104
101static int i2c_device_remove(struct device *dev) 105static int i2c_device_remove(struct device *dev)