]> err.no Git - linux-2.6/blobdiff - drivers/s390/cio/device.c
[MIPS] Panic on fp exception in kernel mode.
[linux-2.6] / drivers / s390 / cio / device.c
index afc4e88551ad2ee5437a1622143d95c371522659..585fa04233c34f0325c064af7dc55ce183f696be 100644 (file)
@@ -8,7 +8,6 @@
  *              Cornelia Huck (cornelia.huck@de.ibm.com)
  *              Martin Schwidefsky (schwidefsky@de.ibm.com)
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/spinlock.h>
@@ -101,7 +100,7 @@ ccw_uevent (struct device *dev, char **envp, int num_envp,
        if ((buffer_size - length <= 0) || (i >= num_envp))
                return -ENOMEM;
 
-       envp[i] = 0;
+       envp[i] = NULL;
 
        return 0;
 }
@@ -133,8 +132,8 @@ struct css_driver io_subchannel_driver = {
 
 struct workqueue_struct *ccw_device_work;
 struct workqueue_struct *ccw_device_notify_work;
-static wait_queue_head_t ccw_device_init_wq;
-static atomic_t ccw_device_init_count;
+wait_queue_head_t ccw_device_init_wq;
+atomic_t ccw_device_init_count;
 
 static int __init
 init_ccw_bus_type (void)
@@ -281,7 +280,7 @@ ccw_device_remove_disconnected(struct ccw_device *cdev)
         * 'throw away device'.
         */
        sch = to_subchannel(cdev->dev.parent);
-       device_unregister(&sch->dev);
+       css_sch_device_unregister(sch);
        /* Reset intparm to zeroes. */
        sch->schib.pmcw.intparm = 0;
        cio_modify(sch);
@@ -626,7 +625,7 @@ ccw_device_do_unreg_rereg(void *data)
                                        other_sch->schib.pmcw.intparm = 0;
                                        cio_modify(other_sch);
                                }
-                               device_unregister(&other_sch->dev);
+                               css_sch_device_unregister(other_sch);
                        }
                }
                /* Update ssd info here. */
@@ -710,7 +709,7 @@ ccw_device_call_sch_unregister(void *data)
        struct subchannel *sch;
 
        sch = to_subchannel(cdev->dev.parent);
-       device_unregister(&sch->dev);
+       css_sch_device_unregister(sch);
        /* Reset intparm to zeroes. */
        sch->schib.pmcw.intparm = 0;
        cio_modify(sch);
@@ -826,17 +825,15 @@ io_subchannel_probe (struct subchannel *sch)
                        get_device(&cdev->dev);
                return 0;
        }
-       cdev  = kmalloc (sizeof(*cdev), GFP_KERNEL);
+       cdev = kzalloc (sizeof(*cdev), GFP_KERNEL);
        if (!cdev)
                return -ENOMEM;
-       memset(cdev, 0, sizeof(struct ccw_device));
-       cdev->private = kmalloc(sizeof(struct ccw_device_private), 
+       cdev->private = kzalloc(sizeof(struct ccw_device_private),
                                GFP_KERNEL | GFP_DMA);
        if (!cdev->private) {
                kfree(cdev);
                return -ENOMEM;
        }
-       memset(cdev->private, 0, sizeof(struct ccw_device_private));
        atomic_set(&cdev->private->onoff, 0);
        cdev->dev = (struct device) {
                .parent = &sch->dev,
@@ -1060,7 +1057,7 @@ get_ccwdev_by_busid(struct ccw_driver *cdrv, const char *bus_id)
                                 __ccwdev_check_busid);
        put_driver(drv);
 
-       return dev ? to_ccwdev(dev) : 0;
+       return dev ? to_ccwdev(dev) : NULL;
 }
 
 /************************** device driver handling ************************/
@@ -1085,7 +1082,7 @@ ccw_device_probe (struct device *dev)
        ret = cdrv->probe ? cdrv->probe(cdev) : -ENODEV;
 
        if (ret) {
-               cdev->drv = 0;
+               cdev->drv = NULL;
                return ret;
        }
 
@@ -1116,7 +1113,7 @@ ccw_device_remove (struct device *dev)
                                 ret, cdev->dev.bus_id);
        }
        ccw_device_set_timeout(cdev, 0);
-       cdev->drv = 0;
+       cdev->drv = NULL;
        return 0;
 }