Messages in this thread Patch in this message |  | | Date | Fri, 9 Feb 2001 21:30:32 +0100 | From | Francois Romieu <> | Subject | Re: [PATCH] drivers/media/radio/radio-maxiradio.c - 2.4.1-ac8 |
| |
Jeff Garzik <jgarzik@mandrakesoft.com> écrit : [...] > Patch looks ok. Further change: move pci_enable_device above the > request_region call. request_region calls pci_resource_start(), which > may not return a proper value if called before pci_enable_device.
--- linux-2.4.1-ac8.orig/drivers/media/radio/radio-maxiradio.c Fri Feb 9 15:01:57 2001 +++ linux-2.4.1-ac8/drivers/media/radio/radio-maxiradio.c Fri Feb 9 16:25:37 2001 @@ -318,15 +318,15 @@ static int __devinit maxiradio_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) { + if (pci_enable_device(pdev)) + goto err_out; + if(!request_region(pci_resource_start(pdev, 0), pci_resource_len(pdev, 0), "Maxi Radio FM 2000")) { printk(KERN_ERR "radio-maxiradio: can't reserve I/O ports\n"); goto err_out; } - if (pci_enable_device(pdev)) - goto err_out_free_region; - radio_unit.io = pci_resource_start(pdev, 0); init_MUTEX(&radio_unit.lock); maxiradio_radio.priv = &radio_unit; @@ -376,9 +376,7 @@ int __init maxiradio_radio_init(void) { - int count = pci_register_driver(&maxiradio_driver); - - if(count > 0) return 0; else return -ENODEV; + return pci_module_init(&maxiradio_driver); } void __exit maxiradio_radio_exit(void) -- Ueimor - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org Please read the FAQ at http://www.tux.org/lkml/
|  |