int result = -ENOMEM;
struct service_processor *sp;
+ if (pci_enable_device(pdev)) {
+ printk(KERN_ERR "%s: can't enable PCI device at %s\n",
+ DRIVER_NAME, pci_name(pdev));
+ return -ENODEV;
+ }
+
sp = kmalloc(sizeof(struct service_processor), GFP_KERNEL);
if (sp == NULL) {
dev_err(&pdev->dev, "Failed to allocate memory\n");
- return result;
+ result = -ENOMEM;
+ goto error_kmalloc;
}
memset(sp, 0, sizeof(struct service_processor));
ibmasm_register_uart(sp);
+ dev_printk(KERN_DEBUG, &pdev->dev, "WARNING: This software may not be supported or function\n");
+ dev_printk(KERN_DEBUG, &pdev->dev, "correctly on your IBM server. Please consult the IBM\n");
+ dev_printk(KERN_DEBUG, &pdev->dev, "ServerProven website\n");
+ dev_printk(KERN_DEBUG, &pdev->dev, "http://www.pc.ibm.com/ww/eserver/xseries/serverproven\n");
+ dev_printk(KERN_DEBUG, &pdev->dev, "for information on the specific driver level and support\n");
+ dev_printk(KERN_DEBUG, &pdev->dev, "statement for your IBM server.\n");
+
return 0;
error_send_message:
ibmasm_event_buffer_exit(sp);
error_eventbuffer:
kfree(sp);
+error_kmalloc:
+ pci_disable_device(pdev);
return result;
}
iounmap(sp->base_address);
ibmasm_event_buffer_exit(sp);
kfree(sp);
+ pci_disable_device(pdev);
}
static struct pci_device_id ibmasm_pci_table[] =