X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;f=drivers%2Fmisc%2Fibmasm%2Fmodule.c;h=4f9d4a9da983ddfaa58c3c2f99b57e5da9119e4e;hb=dd00cc486ab1c17049a535413d1751ef3482141c;hp=1fdf03fd2da751181c1226d6441de7dab786b6e2;hpb=278d72ae8803ffcd16070c95fe1d53f4466dc741;p=safe%2Fjmp%2Flinux-2.6 diff --git a/drivers/misc/ibmasm/module.c b/drivers/misc/ibmasm/module.c index 1fdf03f..4f9d4a9 100644 --- a/drivers/misc/ibmasm/module.c +++ b/drivers/misc/ibmasm/module.c @@ -18,9 +18,9 @@ * * Copyright (C) IBM Corporation, 2004 * - * Author: Max Asböck + * Author: Max Asböck * - * This driver is based on code originally written by Pete Reynolds + * This driver is based on code originally written by Pete Reynolds * and others. * */ @@ -30,13 +30,13 @@ * * 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,7 +104,7 @@ 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) { dev_err(sp->dev, "Failed to ioremap pci memory\n"); @@ -113,7 +112,7 @@ static int __devinit ibmasm_init_one(struct pci_dev *pdev, const struct pci_devi 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;