Commit c407acc1 authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz Committed by Linus Torvalds

[PATCH] ide_init_default_hwifs() -> ide_init_default_irq()

init_ide_data() initializes default IDE interfaces but without default IRQ
(hwif->irq and hwif->hw.irq fields) so introduce ide_init_default_irq() and
remove redundant ide_init_default_hwifs() (except arm26 and arm ones).

As a side-effect it fixes:
- CONFIG_BLK_DEV_HD_IDE if !CONFIG_BLK_DEV_IDEPCI (i386)
- hwif->noprobe shouldn't be 0 if !hwif->io_ports[IDE_DATA_OFFSET]
  (alpha, i386, ia64, mips, sh, x86_64)
parent f9e6dd14
......@@ -307,12 +307,17 @@ static void __init init_ide_data (void)
hwif = &ide_hwifs[index];
init_hwif_data(hwif, index);
init_hwif_default(hwif, index);
hwif->irq = hwif->hw.irq =
ide_init_default_irq(hwif->io_ports[IDE_DATA_OFFSET]);
}
/* OBSOLETE: still needed on arm26 and arm */
#ifdef CONFIG_ARM
/* Add default hw interfaces */
initializing = 1;
ide_init_default_hwifs();
initializing = 0;
#endif
}
/*
......
......@@ -63,23 +63,11 @@ static inline void ide_init_hwif_ports(hw_regs_t *hw, unsigned long data_port,
hw->io_ports[IDE_IRQ_OFFSET] = 0;
}
/*
* This registers the standard ports for this architecture with the IDE
* driver.
*/
static __inline__ void ide_init_default_hwifs(void)
{
#ifndef CONFIG_PCI
hw_regs_t hw;
int index;
for (index = 0; index < MAX_HWIFS; index++) {
ide_init_hwif_ports(&hw, ide_default_io_base(index), 0, NULL);
hw.irq = ide_default_irq(ide_default_io_base(index));
ide_register_hw(&hw, NULL);
}
#ifdef CONFIG_PCI
#define ide_init_default_irq(base) (0)
#else
#define ide_init_default_irq(base) ide_default_irq(base)
#endif
}
#include <asm-generic/ide_iops.h>
......
......@@ -26,6 +26,8 @@
#define ide_default_io_base(i) (0)
#define ide_default_irq(b) (0)
#define ide_init_default_irq(base) (0)
#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_outsw(port,addr,len) writesw(port,addr,len)
......
......@@ -45,6 +45,8 @@ static inline void ide_init_hwif_ports(hw_regs_t *hw, unsigned long data_port,
*irq = 0;
}
#define ide_init_default_irq(base) (0)
/*
* This registers the standard ports for this architecture with the IDE
* driver.
......
......@@ -25,10 +25,7 @@ static __inline__ void ide_init_hwif_ports(hw_regs_t *hw, unsigned long data_por
{
}
static inline void ide_init_default_hwifs(void)
{
}
#define ide_init_default_irq(base) (0)
#define MAX_HWIFS 1
......
......@@ -90,20 +90,11 @@ static __inline__ void ide_init_hwif_ports(hw_regs_t *hw, unsigned long data_por
hw->io_ports[IDE_IRQ_OFFSET] = 0;
}
static __inline__ void ide_init_default_hwifs(void)
{
#ifndef CONFIG_BLK_DEV_IDEPCI
hw_regs_t hw;
int index;
for(index = 0; index < MAX_HWIFS; index++) {
memset(&hw, 0, sizeof hw);
ide_init_hwif_ports(&hw, ide_default_io_base(index), 0, NULL);
hw.irq = ide_default_irq(ide_default_io_base(index));
ide_register_hw(&hw, NULL);
}
#endif /* CONFIG_BLK_DEV_IDEPCI */
}
#ifdef CONFIG_BLK_DEV_IDEPCI
#define ide_init_default_irq(base) (0)
#else
#define ide_init_default_irq(base) ide_default_irq(base)
#endif
#include <asm-generic/ide_iops.h>
......
......@@ -73,21 +73,11 @@ static inline void ide_init_hwif_ports(hw_regs_t *hw, unsigned long data_port,
hw->io_ports[IDE_IRQ_OFFSET] = 0;
}
static __inline__ void
ide_init_default_hwifs (void)
{
#ifndef CONFIG_PCI
hw_regs_t hw;
int index;
for(index = 0; index < MAX_HWIFS; index++) {
memset(&hw, 0, sizeof hw);
ide_init_hwif_ports(&hw, ide_default_io_base(index), 0, NULL);
hw.irq = ide_default_irq(ide_default_io_base(index));
ide_register_hw(&hw, NULL);
}
#ifdef CONFIG_PCI
#define ide_init_default_irq(base) (0)
#else
#define ide_init_default_irq(base) ide_default_irq(base)
#endif
}
#include <asm-generic/ide_iops.h>
......
......@@ -74,13 +74,7 @@ static __inline__ void ide_init_hwif_ports(hw_regs_t *hw,
printk("ide_init_hwif_ports: must not be called\n");
}
/*
* This registers the standard ports for this architecture with the IDE
* driver.
*/
static __inline__ void ide_init_default_hwifs(void)
{
}
#define ide_init_default_irq(base) (0)
/*
* Get rid of defs from io.h - ide has its private and conflicting versions
......
......@@ -139,28 +139,7 @@ static IDE_INLINE void ide_init_hwif_ports(
}
}
/*
* This registers the standard ports for this architecture with the IDE
* driver.
*/
static IDE_INLINE void ide_init_default_hwifs(void)
{
hw_regs_t hw;
ide_ioreg_t base;
int index;
for (index = 0; index < MAX_HWIFS; index++) {
base = ide_default_io_base(index);
if (!base)
continue;
memset(&hw, 0, sizeof(hw));
ide_init_hwif_ports(&hw, base, 0, NULL);
hw.irq = ide_default_irq(base);
ide_register_hw(&hw, NULL);
}
}
#define ide_init_default_irq(base) ide_default_irq(base)
static IDE_INLINE int
ide_request_irq(
......
......@@ -68,19 +68,10 @@ static inline void ide_init_hwif_ports(hw_regs_t *hw, unsigned long data_port,
hw->io_ports[IDE_IRQ_OFFSET] = 0;
}
static inline void ide_init_default_hwifs(void)
{
#ifndef CONFIG_BLK_DEV_IDEPCI
hw_regs_t hw;
int index;
for(index = 0; index < MAX_HWIFS; index++) {
memset(&hw, 0, sizeof hw);
ide_init_hwif_ports(&hw, ide_default_io_base(index), 0, NULL);
hw.irq = ide_default_irq(ide_default_io_base(index));
ide_register_hw(&hw, NULL);
}
#endif /* CONFIG_BLK_DEV_IDEPCI */
}
#ifdef CONFIG_BLK_DEV_IDEPCI
#define ide_init_default_irq(base) (0)
#else
#define ide_init_default_irq(base) ide_default_irq(base)
#endif
#endif /* __ASM_MACH_GENERIC_IDE_H */
......@@ -42,8 +42,7 @@ static inline void ide_init_hwif_ports(hw_regs_t *hw, unsigned long data_port,
hw->io_ports[IDE_IRQ_OFFSET] = 0;
}
/* There are no standard ports. */
static inline void ide_init_default_hwifs(void) { ; }
#define ide_init_default_irq(base) (0)
#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))
......
......@@ -84,23 +84,11 @@ static __inline__ void ide_init_hwif_ports(hw_regs_t *hw,
ppc_ide_md.ide_init_hwif(hw, data_port, ctrl_port, irq);
}
static __inline__ void ide_init_default_hwifs(void)
{
#ifndef CONFIG_PCI
hw_regs_t hw;
int index;
unsigned long base;
for (index = 0; index < MAX_HWIFS; index++) {
base = ide_default_io_base(index);
if (base == 0)
continue;
ide_init_hwif_ports(&hw, base, 0, NULL);
hw.irq = ide_default_irq(base);
ide_register_hw(&hw, NULL);
}
#ifdef CONFIG_PCI
#define ide_init_default_irq(base) (0)
#else
#define ide_init_default_irq(base) ide_default_irq(base)
#endif
}
#if (defined CONFIG_APUS || defined CONFIG_BLK_DEV_MPC8xx_IDE )
#define IDE_ARCH_ACK_INTR 1
......
......@@ -45,9 +45,7 @@ static inline void ide_init_hwif_ports(hw_regs_t *hw, unsigned long data_port,
hw->io_ports[IDE_IRQ_OFFSET] = 0;
}
static __inline__ void ide_init_default_hwifs(void)
{
}
#define ide_init_default_irq(base) (0)
#endif /* __KERNEL__ */
......
......@@ -92,20 +92,11 @@ static inline void ide_init_hwif_ports(hw_regs_t *hw, unsigned long data_port,
hw->io_ports[IDE_IRQ_OFFSET] = 0;
}
static __inline__ void ide_init_default_hwifs(void)
{
#ifndef CONFIG_PCI
hw_regs_t hw;
int index;
for(index = 0; index < MAX_HWIFS; index++) {
memset(&hw, 0, sizeof hw);
ide_init_hwif_ports(&hw, ide_default_io_base(index), 0, NULL);
hw.irq = ide_default_irq(ide_default_io_base(index));
ide_register_hw(&hw, NULL);
}
#endif /* CONFIG_PCI */
}
#ifdef CONFIG_PCI
#define ide_init_default_irq(base) (0)
#else
#define ide_init_default_irq(base) ide_default_irq(base)
#endif
#include <asm-generic/ide_iops.h>
......
......@@ -52,8 +52,7 @@ static __inline__ void ide_init_hwif_ports(hw_regs_t *hw, unsigned long data_por
hw->io_ports[IDE_IRQ_OFFSET] = 0;
}
/* There are no standard ports. */
static inline void ide_init_default_hwifs(void) { ; }
#define ide_init_default_irq(base) (0)
#define __ide_insl(data_reg, buffer, wcount) \
__ide_insw(data_reg, buffer, (wcount)<<1)
......
......@@ -53,8 +53,7 @@ static __inline__ void ide_init_hwif_ports(hw_regs_t *hw, unsigned long data_por
hw->io_ports[IDE_IRQ_OFFSET] = 0;
}
/* There are no standard ports. */
static inline void ide_init_default_hwifs(void) { ; }
#define ide_init_default_irq(base) (0)
#define __ide_insl(data_reg, buffer, wcount) \
__ide_insw(data_reg, buffer, (wcount)<<1)
......
......@@ -71,20 +71,11 @@ static __inline__ void ide_init_hwif_ports(hw_regs_t *hw, unsigned long data_por
hw->io_ports[IDE_IRQ_OFFSET] = 0;
}
static __inline__ void ide_init_default_hwifs(void)
{
#ifndef CONFIG_BLK_DEV_IDEPCI
hw_regs_t hw;
int index;
for(index = 0; index < MAX_HWIFS; index++) {
memset(&hw, 0, sizeof hw);
ide_init_hwif_ports(&hw, ide_default_io_base(index), 0, NULL);
hw.irq = ide_default_irq(ide_default_io_base(index));
ide_register_hw(&hw, NULL);
}
#endif /* CONFIG_BLK_DEV_IDEPCI */
}
#ifdef CONFIG_BLK_DEV_IDEPCI
#define ide_init_default_irq(base) (0)
#else
#define ide_init_default_irq(base) ide_default_irq(base)
#endif
#include <asm-generic/ide_iops.h>
......
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