NULL noise: drivers/misc
[sfrench/cifs-2.6.git] / drivers / misc / ibmasm / module.c
index 1fdf03fd2da751181c1226d6441de7dab786b6e2..b5f6add34b0b9b4a39b587c51e3dc7079722c50a 100644 (file)
@@ -18,9 +18,9 @@
  *
  * Copyright (C) IBM Corporation, 2004
  *
- * Author: Max Asböck <amax@us.ibm.com> 
+ * Author: Max Asböck <amax@us.ibm.com>
  *
- * This driver is based on code originally written by Pete Reynolds 
+ * This driver is based on code originally written by Pete Reynolds
  * and others.
  *
  */
  *
  * 1) When loaded it sends a message to the service processor,
  * indicating that an OS is * running. This causes the service processor
- * to send periodic heartbeats to the OS. 
+ * to send periodic heartbeats to the OS.
  *
  * 2) Answers the periodic heartbeats sent by the service processor.
  * Failure to do so would result in system reboot.
  *
  * 3) Acts as a pass through for dot commands sent from user applications.
- * The interface for this is the ibmasmfs file system. 
+ * The interface for this is the ibmasmfs file system.
  *
  * 4) Allows user applications to register for event notification. Events
  * are sent to the driver through interrupts. They can be read from user
@@ -77,15 +77,14 @@ static int __devinit ibmasm_init_one(struct pci_dev *pdev, const struct pci_devi
        /* vnc client won't work without bus-mastering */
        pci_set_master(pdev);
 
-       sp = kmalloc(sizeof(struct service_processor), GFP_KERNEL);
+       sp = kzalloc(sizeof(struct service_processor), GFP_KERNEL);
        if (sp == NULL) {
                dev_err(&pdev->dev, "Failed to allocate memory\n");
                result = -ENOMEM;
                goto error_kmalloc;
        }
-       memset(sp, 0, sizeof(struct service_processor));
 
-       sp->lock = SPIN_LOCK_UNLOCKED;
+       spin_lock_init(&sp->lock);
        INIT_LIST_HEAD(&sp->command_queue);
 
        pci_set_drvdata(pdev, (void *)sp);
@@ -105,15 +104,15 @@ static int __devinit ibmasm_init_one(struct pci_dev *pdev, const struct pci_devi
        }
 
        sp->irq = pdev->irq;
-       sp->base_address = ioremap(pci_resource_start(pdev, 0), 
+       sp->base_address = ioremap(pci_resource_start(pdev, 0),
                                        pci_resource_len(pdev, 0));
-       if (sp->base_address == 0) {
+       if (!sp->base_address) {
                dev_err(sp->dev, "Failed to ioremap pci memory\n");
                result =  -ENODEV;
                goto error_ioremap;
        }
 
-       result = request_irq(sp->irq, ibmasm_interrupt_handler, SA_SHIRQ, sp->devname, (void*)sp);
+       result = request_irq(sp->irq, ibmasm_interrupt_handler, IRQF_SHARED, sp->devname, (void*)sp);
        if (result) {
                dev_err(sp->dev, "Failed to register interrupt handler\n");
                goto error_request_irq;