ide: fix pmac breakage

Fix breakage added in the IDE devel tree.

Add header, then fix

drivers/ide/ppc/pmac.c: In function `pmac_ide_setup_dma':
drivers/ide/ppc/pmac.c:2044: warning: assignment from incompatible pointer type
drivers/ide/ppc/pmac.c: In function `pmac_ide_dma_host_on':
drivers/ide/ppc/pmac.c:1989: warning: control reaches end of non-void function
include/linux/pci.h: In function `pmac_ide_init':
drivers/ide/ppc/pmac.c:1563: warning: ignoring return value of `pci_register_driver', declared with attribute warn_unused_result

Then add some apparently-long-missing error handling.

Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>

authored by Andrew Morton and committed by Bartlomiej Zolnierkiewicz 9e5755bc ed896167

+26 -11
+2 -2
drivers/ide/ide.c
··· 1840 1840 #endif /* CONFIG_BLK_DEV_CMD640 */ 1841 1841 #ifdef CONFIG_BLK_DEV_IDE_PMAC 1842 1842 { 1843 - extern void pmac_ide_probe(void); 1844 - pmac_ide_probe(); 1843 + extern int pmac_ide_probe(void); 1844 + (void)pmac_ide_probe(); 1845 1845 } 1846 1846 #endif /* CONFIG_BLK_DEV_IDE_PMAC */ 1847 1847 #ifdef CONFIG_BLK_DEV_GAYLE
+24 -9
drivers/ide/ppc/pmac.c
··· 48 48 #include <asm/mediabay.h> 49 49 #endif 50 50 51 - #include "ide-timing.h" 51 + #include "../ide-timing.h" 52 52 53 53 #undef IDE_PMAC_DEBUG 54 54 ··· 1551 1551 }; 1552 1552 MODULE_DEVICE_TABLE(pci, pmac_ide_pci_match); 1553 1553 1554 - void __init 1555 - pmac_ide_probe(void) 1554 + int __init pmac_ide_probe(void) 1556 1555 { 1556 + int error; 1557 + 1557 1558 if (!machine_is(powermac)) 1558 - return; 1559 + return -ENODEV; 1559 1560 1560 1561 #ifdef CONFIG_BLK_DEV_IDE_PMAC_ATA100FIRST 1561 - pci_register_driver(&pmac_ide_pci_driver); 1562 - macio_register_driver(&pmac_ide_macio_driver); 1562 + error = pci_register_driver(&pmac_ide_pci_driver); 1563 + if (error) 1564 + goto out; 1565 + error = macio_register_driver(&pmac_ide_macio_driver); 1566 + if (error) { 1567 + pci_unregister_driver(&pmac_ide_pci_driver); 1568 + goto out; 1569 + } 1563 1570 #else 1564 - macio_register_driver(&pmac_ide_macio_driver); 1565 - pci_register_driver(&pmac_ide_pci_driver); 1571 + error = macio_register_driver(&pmac_ide_macio_driver); 1572 + if (error) 1573 + goto out; 1574 + error = pci_register_driver(&pmac_ide_pci_driver); 1575 + if (error) { 1576 + macio_unregister_driver(&pmac_ide_macio_driver); 1577 + goto out; 1578 + } 1566 1579 #endif 1580 + out: 1581 + return error; 1567 1582 } 1568 1583 1569 1584 #ifdef CONFIG_BLK_DEV_IDEDMA_PMAC ··· 1998 1983 { 1999 1984 } 2000 1985 2001 - static int pmac_ide_dma_host_on(ide_drive_t *drive) 1986 + static void pmac_ide_dma_host_on(ide_drive_t *drive) 2002 1987 { 2003 1988 } 2004 1989