]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/i2c/i2c-core.c
slub: Calculate min_objects based on number of processors.
[linux-2.6-omap-h63xx.git] / drivers / i2c / i2c-core.c
index 96da22e9a5a44dbe32b247694a2b72bdea20c0d8..6c7fa8d53c0eeaeccfec0366302cdc37717efecb 100644 (file)
@@ -35,8 +35,8 @@
 #include <linux/completion.h>
 #include <linux/hardirq.h>
 #include <linux/irqflags.h>
+#include <linux/semaphore.h>
 #include <asm/uaccess.h>
-#include <asm/semaphore.h>
 
 #include "i2c-core.h"
 
@@ -90,12 +90,16 @@ static int i2c_device_probe(struct device *dev)
 {
        struct i2c_client       *client = to_i2c_client(dev);
        struct i2c_driver       *driver = to_i2c_driver(dev->driver);
+       int status;
 
        if (!driver->probe)
                return -ENODEV;
        client->driver = driver;
        dev_dbg(dev, "probe\n");
-       return driver->probe(client);
+       status = driver->probe(client);
+       if (status)
+               client->driver = NULL;
+       return status;
 }
 
 static int i2c_device_remove(struct device *dev)
@@ -485,8 +489,8 @@ EXPORT_SYMBOL(i2c_add_adapter);
  * Context: can sleep
  *
  * This routine is used to declare an I2C adapter when its bus number
- * matters.  Example: for I2C adapters from system-on-chip CPUs, or
- * otherwise built in to the system's mainboard, and where i2c_board_info
+ * matters.  For example, use it for I2C adapters from system-on-chip CPUs,
+ * or otherwise built in to the system's mainboard, and where i2c_board_info
  * is used to properly configure I2C devices.
  *
  * If no devices have pre-been declared for this bus, then be sure to
@@ -1502,7 +1506,7 @@ static s32 i2c_smbus_xfer_emulated(struct i2c_adapter * adapter, u16 addr,
                read_write = I2C_SMBUS_READ;
                if (data->block[0] > I2C_SMBUS_BLOCK_MAX) {
                        dev_err(&adapter->dev, "%s called with invalid "
-                               "block proc call size (%d)\n", __FUNCTION__,
+                               "block proc call size (%d)\n", __func__,
                                data->block[0]);
                        return -1;
                }