]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/i2c/busses/i2c-keywest.c
Merge master.kernel.org:/home/rmk/linux-2.6-drvmodel
[linux-2.6-omap-h63xx.git] / drivers / i2c / busses / i2c-keywest.c
index 94ae808314f75905bf3dfb00d8ac075fce1c08f9..d61f748278fc47de6e2e9a889b443cc308cbcd35 100644 (file)
@@ -87,12 +87,9 @@ static const char *__kw_state_names[] = {
 };
 #endif /* DEBUG */
 
-static int probe;
-
 MODULE_AUTHOR("Benjamin Herrenschmidt <benh@kernel.crashing.org>");
 MODULE_DESCRIPTION("I2C driver for Apple's Keywest");
 MODULE_LICENSE("GPL");
-module_param(probe, bool, 0);
 
 #ifdef POLLED_MODE
 /* Don't schedule, the g5 fan controller is too
@@ -498,8 +495,6 @@ keywest_func(struct i2c_adapter * adapter)
 
 /* For now, we only handle combined mode (smbus) */
 static struct i2c_algorithm keywest_algorithm = {
-       .name           = "Keywest i2c",
-       .id             = I2C_ALGO_SMBUS,
        .smbus_xfer     = keywest_smbus_xfer,
        .master_xfer    = keywest_xfer,
        .functionality  = keywest_func,
@@ -540,13 +535,12 @@ create_iface(struct device_node *np, struct device *dev)
 
        tsize = sizeof(struct keywest_iface) +
                (sizeof(struct keywest_chan) + 4) * nchan;
-       iface = (struct keywest_iface *) kmalloc(tsize, GFP_KERNEL);
+       iface = kzalloc(tsize, GFP_KERNEL);
        if (iface == NULL) {
                printk(KERN_ERR "i2c-keywest: can't allocate inteface !\n");
                pmac_low_i2c_unlock(np);
                return -ENOMEM;
        }
-       memset(iface, 0, tsize);
        spin_lock_init(&iface->lock);
        init_completion(&iface->complete);
        iface->node = of_node_get(np);
@@ -616,12 +610,10 @@ create_iface(struct device_node *np, struct device *dev)
        
        for (i=0; i<nchan; i++) {
                struct keywest_chan* chan = &iface->channels[i];
-               u8 addr;
                
                sprintf(chan->adapter.name, "%s %d", np->parent->name, i);
                chan->iface = iface;
                chan->chan_no = i;
-               chan->adapter.id = I2C_ALGO_SMBUS;
                chan->adapter.algo = &keywest_algorithm;
                chan->adapter.algo_data = NULL;
                chan->adapter.client_register = NULL;
@@ -635,15 +627,6 @@ create_iface(struct device_node *np, struct device *dev)
                                chan->adapter.name);
                        i2c_set_adapdata(&chan->adapter, NULL);
                }
-               if (probe) {
-                       printk("Probe: ");
-                       for (addr = 0x00; addr <= 0x7f; addr++) {
-                               if (i2c_smbus_xfer(&chan->adapter,addr,
-                                   0,0,0,I2C_SMBUS_QUICK,NULL) >= 0)
-                                       printk("%02x ", addr);
-                       }
-                       printk("\n");
-               }
        }
 
        printk(KERN_INFO "Found KeyWest i2c on \"%s\", %d channel%s, stepping: %d bits\n",
@@ -732,6 +715,7 @@ static struct of_device_id i2c_keywest_match[] =
 
 static struct macio_driver i2c_keywest_macio_driver = 
 {
+       .owner          = THIS_MODULE,
        .name           = "i2c-keywest",
        .match_table    = i2c_keywest_match,
        .probe          = create_iface_macio,
@@ -740,6 +724,7 @@ static struct macio_driver i2c_keywest_macio_driver =
 
 static struct of_platform_driver i2c_keywest_of_platform_driver = 
 {
+       .owner          = THIS_MODULE,
        .name           = "i2c-keywest",
        .match_table    = i2c_keywest_match,
        .probe          = create_iface_of_platform,