ide: add CONFIG_IDE_ARCH_OBSOLETE_DEFAULTS (take 2)

* Add CONFIG_IDE_ARCH_OBSOLETE_DEFAULTS to drivers/ide/Kconfig and use
  it instead of defining IDE_ARCH_OBSOLETE_DEFAULTS in <arch/ide.h>.

v2:
* Define ide_default_irq() in ide-probe.c/ns87415.c if not already defined
  and drop defining ide_default_irq() for CONFIG_IDE_ARCH_OBSOLETE_DEFAULTS=n.

  [ Thanks to Stephen Rothwell and David Miller for noticing the problem. ]

Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: David Miller <davem@davemloft.net>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig
index 4dc2761..a57893c 100644
--- a/drivers/ide/Kconfig
+++ b/drivers/ide/Kconfig
@@ -1092,6 +1092,9 @@
 config IDE_ARCH_OBSOLETE_INIT
 	def_bool ALPHA || (ARM && !ARCH_L7200) || BLACKFIN || X86 || IA64 || M32R || MIPS || PARISC || PPC || (SUPERH64 && BLK_DEV_IDEPCI) || SPARC
 
+config IDE_ARCH_OBSOLETE_DEFAULTS
+	def_bool ALPHA || X86 || IA64 || M32R || MIPS || PPC32
+
 endif
 
 config BLK_DEV_HD_ONLY
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index 10ccf27..6a196c2 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -1233,6 +1233,10 @@
 	complete(&drive->gendev_rel_comp);
 }
 
+#ifndef ide_default_irq
+#define ide_default_irq(irq) 0
+#endif
+
 static int hwif_init(ide_hwif_t *hwif)
 {
 	int old_irq;
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index c2fb5c9..a1a02c7 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -165,6 +165,10 @@
 	}
 }
 
+#ifndef CONFIG_IDE_ARCH_OBSOLETE_DEFAULTS
+# define ide_default_io_base(index)	(0)
+# define ide_init_default_irq(base)	(0)
+#endif
 
 /*
  * init_ide_data() sets reasonable default values into all fields
diff --git a/drivers/ide/pci/ns87415.c b/drivers/ide/pci/ns87415.c
index bf0d3b2..7551332 100644
--- a/drivers/ide/pci/ns87415.c
+++ b/drivers/ide/pci/ns87415.c
@@ -181,6 +181,10 @@
 	return 1;
 }
 
+#ifndef ide_default_irq
+#define ide_default_irq(irq) 0
+#endif
+
 static void __devinit init_hwif_ns87415 (ide_hwif_t *hwif)
 {
 	struct pci_dev *dev = to_pci_dev(hwif->dev);
diff --git a/include/asm-alpha/ide.h b/include/asm-alpha/ide.h
index b7bf68d..a2feed3 100644
--- a/include/asm-alpha/ide.h
+++ b/include/asm-alpha/ide.h
@@ -13,9 +13,6 @@
 
 #ifdef __KERNEL__
 
-
-#define IDE_ARCH_OBSOLETE_DEFAULTS
-
 static inline int ide_default_irq(unsigned long base)
 {
 	switch (base) {
diff --git a/include/asm-ia64/ide.h b/include/asm-ia64/ide.h
index 1ccf238..09c2a05 100644
--- a/include/asm-ia64/ide.h
+++ b/include/asm-ia64/ide.h
@@ -16,8 +16,6 @@
 
 #include <linux/irq.h>
 
-#define IDE_ARCH_OBSOLETE_DEFAULTS
-
 static inline int ide_default_irq(unsigned long base)
 {
 	switch (base) {
diff --git a/include/asm-m32r/ide.h b/include/asm-m32r/ide.h
index 5d2044e..feb7f0d 100644
--- a/include/asm-m32r/ide.h
+++ b/include/asm-m32r/ide.h
@@ -23,8 +23,6 @@
 # endif
 #endif
 
-#define IDE_ARCH_OBSOLETE_DEFAULTS
-
 static __inline__ int ide_default_irq(unsigned long base)
 {
 	switch (base) {
diff --git a/include/asm-mips/mach-generic/ide.h b/include/asm-mips/mach-generic/ide.h
index 4ec2b93..45e2447 100644
--- a/include/asm-mips/mach-generic/ide.h
+++ b/include/asm-mips/mach-generic/ide.h
@@ -27,8 +27,6 @@
 # endif
 #endif
 
-#define IDE_ARCH_OBSOLETE_DEFAULTS
-
 static __inline__ int ide_probe_legacy(void)
 {
 #ifdef CONFIG_PCI
diff --git a/include/asm-powerpc/ide.h b/include/asm-powerpc/ide.h
index 0654945..fef2ef1 100644
--- a/include/asm-powerpc/ide.h
+++ b/include/asm-powerpc/ide.h
@@ -31,8 +31,6 @@
 #include <linux/hdreg.h>
 #include <linux/ioport.h>
 
-#define IDE_ARCH_OBSOLETE_DEFAULTS
-
 /* FIXME: use ide_platform host driver */
 static __inline__ int ide_default_irq(unsigned long base)
 {
diff --git a/include/asm-x86/ide.h b/include/asm-x86/ide.h
index c2552d8..58080a7 100644
--- a/include/asm-x86/ide.h
+++ b/include/asm-x86/ide.h
@@ -20,8 +20,6 @@
 # endif
 #endif
 
-#define IDE_ARCH_OBSOLETE_DEFAULTS
-
 static __inline__ int ide_default_irq(unsigned long base)
 {
 	switch (base) {
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 65445b7..6c39482 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -194,13 +194,6 @@
 #define MAX_HWIFS	CONFIG_IDE_MAX_HWIFS
 #endif
 
-/* needed on alpha, x86/x86_64, ia64, mips, ppc32 and sh */
-#ifndef IDE_ARCH_OBSOLETE_DEFAULTS
-# define ide_default_io_base(index)	(0)
-# define ide_default_irq(base)		(0)
-# define ide_init_default_irq(base)	(0)
-#endif
-
 /* Currently only m68k, apus and m8xx need it */
 #ifndef IDE_ARCH_ACK_INTR
 # define ide_ack_intr(hwif) (1)