ide: define MAX_HWIFS in <linux/ide.h>

* Now that ide_hwif_t instances are allocated dynamically
  the difference between MAX_HWIFS == 2 and MAX_HWIFS == 10
  is ~100 bytes (x86-32) so use MAX_HWIFS == 10 on all archs
  except these ones that use MAX_HWIFS == 1.

* Define MAX_HWIFS in <linux/ide.h> instead of <asm/ide.h>.

[ Please note that avr32/cris/v850 have no <asm/ide.h>
  and alpha/ia64/sh always define CONFIG_IDE_MAX_HWIFS. ]
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent 2c9d8643
...@@ -13,10 +13,6 @@ ...@@ -13,10 +13,6 @@
#ifdef __KERNEL__ #ifdef __KERNEL__
#ifndef MAX_HWIFS
#define MAX_HWIFS 4
#endif
#define __ide_mm_insw(port,addr,len) readsw(port,addr,len) #define __ide_mm_insw(port,addr,len) readsw(port,addr,len)
#define __ide_mm_insl(port,addr,len) readsl(port,addr,len) #define __ide_mm_insl(port,addr,len) readsl(port,addr,len)
#define __ide_mm_outsw(port,addr,len) writesw(port,addr,len) #define __ide_mm_outsw(port,addr,len) writesw(port,addr,len)
......
...@@ -17,8 +17,6 @@ ...@@ -17,8 +17,6 @@
#ifdef __KERNEL__ #ifdef __KERNEL__
/****************************************************************************/ /****************************************************************************/
#define MAX_HWIFS 1
#include <asm-generic/ide_iops.h> #include <asm-generic/ide_iops.h>
/****************************************************************************/ /****************************************************************************/
......
...@@ -18,10 +18,6 @@ ...@@ -18,10 +18,6 @@
#include <asm/io.h> #include <asm/io.h>
#include <asm/irq.h> #include <asm/irq.h>
#ifndef MAX_HWIFS
#define MAX_HWIFS 8
#endif
/****************************************************************************/ /****************************************************************************/
/* /*
* some bits needed for parts of the IDE subsystem to compile * some bits needed for parts of the IDE subsystem to compile
......
...@@ -16,8 +16,6 @@ ...@@ -16,8 +16,6 @@
#ifdef __KERNEL__ #ifdef __KERNEL__
/****************************************************************************/ /****************************************************************************/
#define MAX_HWIFS 1
#include <asm-generic/ide_iops.h> #include <asm-generic/ide_iops.h>
/****************************************************************************/ /****************************************************************************/
......
...@@ -15,14 +15,6 @@ ...@@ -15,14 +15,6 @@
#include <asm/m32r.h> #include <asm/m32r.h>
#ifndef MAX_HWIFS
# ifdef CONFIG_BLK_DEV_IDEPCI
#define MAX_HWIFS 10
# else
#define MAX_HWIFS 2
# endif
#endif
static __inline__ int ide_default_irq(unsigned long base) static __inline__ int ide_default_irq(unsigned long base)
{ {
switch (base) { switch (base) {
......
...@@ -45,10 +45,6 @@ ...@@ -45,10 +45,6 @@
#include <asm/macints.h> #include <asm/macints.h>
#endif #endif
#ifndef MAX_HWIFS
#define MAX_HWIFS 4 /* same as the other archs */
#endif
/* /*
* Get rid of defs from io.h - ide has its private and conflicting versions * Get rid of defs from io.h - ide has its private and conflicting versions
* Since so far no single m68k platform uses ISA/PCI I/O space for IDE, we * Since so far no single m68k platform uses ISA/PCI I/O space for IDE, we
......
...@@ -19,14 +19,6 @@ ...@@ -19,14 +19,6 @@
#include <linux/stddef.h> #include <linux/stddef.h>
#include <asm/processor.h> #include <asm/processor.h>
#ifndef MAX_HWIFS
# ifdef CONFIG_BLK_DEV_IDEPCI
#define MAX_HWIFS 10
# else
#define MAX_HWIFS 6
# endif
#endif
static __inline__ int ide_probe_legacy(void) static __inline__ int ide_probe_legacy(void)
{ {
#ifdef CONFIG_PCI #ifdef CONFIG_PCI
......
...@@ -23,10 +23,6 @@ ...@@ -23,10 +23,6 @@
#undef SUPPORT_VLB_SYNC #undef SUPPORT_VLB_SYNC
#define SUPPORT_VLB_SYNC 0 #define SUPPORT_VLB_SYNC 0
#ifndef MAX_HWIFS
#define MAX_HWIFS 8
#endif
/* /*
* some bits needed for parts of the IDE subsystem to compile * some bits needed for parts of the IDE subsystem to compile
*/ */
......
...@@ -13,10 +13,6 @@ ...@@ -13,10 +13,6 @@
#ifdef __KERNEL__ #ifdef __KERNEL__
#ifndef MAX_HWIFS
#define MAX_HWIFS 2
#endif
#define ide_request_irq(irq,hand,flg,dev,id) request_irq((irq),(hand),(flg),(dev),(id)) #define ide_request_irq(irq,hand,flg,dev,id) request_irq((irq),(hand),(flg),(dev),(id))
#define ide_free_irq(irq,dev_id) free_irq((irq), (dev_id)) #define ide_free_irq(irq,dev_id) free_irq((irq), (dev_id))
#define ide_request_region(from,extent,name) request_region((from), (extent), (name)) #define ide_request_region(from,extent,name) request_region((from), (extent), (name))
......
...@@ -14,14 +14,6 @@ ...@@ -14,14 +14,6 @@
#endif #endif
#include <asm/io.h> #include <asm/io.h>
#ifndef MAX_HWIFS
#ifdef __powerpc64__
#define MAX_HWIFS 10
#else
#define MAX_HWIFS 8
#endif
#endif
#define __ide_mm_insw(p, a, c) readsw((void __iomem *)(p), (a), (c)) #define __ide_mm_insw(p, a, c) readsw((void __iomem *)(p), (a), (c))
#define __ide_mm_insl(p, a, c) readsl((void __iomem *)(p), (a), (c)) #define __ide_mm_insl(p, a, c) readsl((void __iomem *)(p), (a), (c))
#define __ide_mm_outsw(p, a, c) writesw((void __iomem *)(p), (a), (c)) #define __ide_mm_outsw(p, a, c) writesw((void __iomem *)(p), (a), (c))
......
...@@ -21,9 +21,6 @@ ...@@ -21,9 +21,6 @@
#include <asm/psr.h> #include <asm/psr.h>
#endif #endif
#undef MAX_HWIFS
#define MAX_HWIFS 2
#define __ide_insl(data_reg, buffer, wcount) \ #define __ide_insl(data_reg, buffer, wcount) \
__ide_insw(data_reg, buffer, (wcount)<<1) __ide_insw(data_reg, buffer, (wcount)<<1)
#define __ide_outsl(data_reg, buffer, wcount) \ #define __ide_outsl(data_reg, buffer, wcount) \
......
...@@ -11,15 +11,6 @@ ...@@ -11,15 +11,6 @@
#ifdef __KERNEL__ #ifdef __KERNEL__
#ifndef MAX_HWIFS
# ifdef CONFIG_BLK_DEV_IDEPCI
#define MAX_HWIFS 10
# else
#define MAX_HWIFS 6
# endif
#endif
static __inline__ int ide_default_irq(unsigned long base) static __inline__ int ide_default_irq(unsigned long base)
{ {
switch (base) { switch (base) {
......
...@@ -14,11 +14,6 @@ ...@@ -14,11 +14,6 @@
#ifdef __KERNEL__ #ifdef __KERNEL__
#ifndef MAX_HWIFS
# define MAX_HWIFS 1
#endif
#include <asm-generic/ide_iops.h> #include <asm-generic/ide_iops.h>
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
......
...@@ -213,6 +213,14 @@ static inline int __ide_default_irq(unsigned long base) ...@@ -213,6 +213,14 @@ static inline int __ide_default_irq(unsigned long base)
#include <asm/ide.h> #include <asm/ide.h>
#ifndef MAX_HWIFS
#if defined(CONFIG_BLACKFIN) || defined(CONFIG_H8300) || defined(CONFIG_XTENSA)
# define MAX_HWIFS 1
#else
# define MAX_HWIFS 10
#endif
#endif
#if !defined(MAX_HWIFS) || defined(CONFIG_EMBEDDED) #if !defined(MAX_HWIFS) || defined(CONFIG_EMBEDDED)
#undef MAX_HWIFS #undef MAX_HWIFS
#define MAX_HWIFS CONFIG_IDE_MAX_HWIFS #define MAX_HWIFS CONFIG_IDE_MAX_HWIFS
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment