i2c-i801: Rename local variable temp to status
[pandora-kernel.git] / drivers / i2c / busses / i2c-at91.c
index f35156c..73d6194 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/module.h>
 #include <linux/version.h>
 #include <linux/kernel.h>
+#include <linux/err.h>
 #include <linux/slab.h>
 #include <linux/types.h>
 #include <linux/delay.h>
@@ -134,7 +135,7 @@ static int xfer_write(struct i2c_adapter *adap, unsigned char *buf, int length)
  * Generic i2c master transfer entrypoint.
  *
  * Note: We do not use Atmel's feature of storing the "internal device address".
- * Instead the "internal device address" has to be written using a seperate
+ * Instead the "internal device address" has to be written using a separate
  * i2c message.
  * http://lists.arm.linux.org.uk/pipermail/linux-arm-kernel/2004-September/024411.html
  */
@@ -226,13 +227,14 @@ static int __devinit at91_i2c_probe(struct platform_device *pdev)
        adapter->algo = &at91_algorithm;
        adapter->class = I2C_CLASS_HWMON;
        adapter->dev.parent = &pdev->dev;
+       /* adapter->id == 0 ... only one TWI controller for now */
 
        platform_set_drvdata(pdev, adapter);
 
        clk_enable(twi_clk);            /* enable peripheral clock */
        at91_twi_hwinit();              /* initialize TWI controller */
 
-       rc = i2c_add_adapter(adapter);
+       rc = i2c_add_numbered_adapter(adapter);
        if (rc) {
                dev_err(&pdev->dev, "Adapter %s registration failed\n",
                                adapter->name);
@@ -295,6 +297,9 @@ static int at91_i2c_resume(struct platform_device *pdev)
 #define at91_i2c_resume                NULL
 #endif
 
+/* work with "modprobe at91_i2c" from hotplugging or coldplugging */
+MODULE_ALIAS("platform:at91_i2c");
+
 static struct platform_driver at91_i2c_driver = {
        .probe          = at91_i2c_probe,
        .remove         = __devexit_p(at91_i2c_remove),