Commit 2d0dbb4b authored by Jens Axboe's avatar Jens Axboe Committed by Linus Torvalds

[PATCH] ide io port types

IDE uses u32 as being an io port, which is wrong. We even have an arch
type for this, ide_ioreg_t. Use that.

Also fix a bad printk() in ide-disk, introduced with the swsusp stuff.
parent da5dce5c
...@@ -1500,7 +1500,7 @@ static int idedisk_suspend(struct device *dev, u32 state, u32 level) ...@@ -1500,7 +1500,7 @@ static int idedisk_suspend(struct device *dev, u32 state, u32 level)
{ {
ide_drive_t *drive = dev->driver_data; ide_drive_t *drive = dev->driver_data;
printk("Suspending device %lx\n", dev->driver_data); printk("Suspending device %p\n", dev->driver_data);
/* I hope that every freeze operation from the upper levels have /* I hope that every freeze operation from the upper levels have
* already been done... * already been done...
......
...@@ -32,52 +32,52 @@ ...@@ -32,52 +32,52 @@
#include <asm/bitops.h> #include <asm/bitops.h>
static u8 ide_inb (u32 port) static u8 ide_inb (ide_ioreg_t port)
{ {
return (u8) inb(port); return (u8) inb(port);
} }
static u16 ide_inw (u32 port) static u16 ide_inw (ide_ioreg_t port)
{ {
return (u16) inw(port); return (u16) inw(port);
} }
static void ide_insw (u32 port, void *addr, u32 count) static void ide_insw (ide_ioreg_t port, void *addr, u32 count)
{ {
return insw(port, addr, count); return insw(port, addr, count);
} }
static u32 ide_inl (u32 port) static u32 ide_inl (ide_ioreg_t port)
{ {
return (u32) inl(port); return (u32) inl(port);
} }
static void ide_insl (u32 port, void *addr, u32 count) static void ide_insl (ide_ioreg_t port, void *addr, u32 count)
{ {
insl(port, addr, count); insl(port, addr, count);
} }
static void ide_outb (u8 addr, u32 port) static void ide_outb (u8 addr, ide_ioreg_t port)
{ {
outb(addr, port); outb(addr, port);
} }
static void ide_outw (u16 addr, u32 port) static void ide_outw (u16 addr, ide_ioreg_t port)
{ {
outw(addr, port); outw(addr, port);
} }
static void ide_outsw (u32 port, void *addr, u32 count) static void ide_outsw (ide_ioreg_t port, void *addr, u32 count)
{ {
outsw(port, addr, count); outsw(port, addr, count);
} }
static void ide_outl (u32 addr, u32 port) static void ide_outl (u32 addr, ide_ioreg_t port)
{ {
outl(addr, port); outl(addr, port);
} }
static void ide_outsl (u32 port, void *addr, u32 count) static void ide_outsl (ide_ioreg_t port, void *addr, u32 count)
{ {
return outsl(port, addr, count); return outsl(port, addr, count);
} }
...@@ -98,17 +98,17 @@ void default_hwif_iops (ide_hwif_t *hwif) ...@@ -98,17 +98,17 @@ void default_hwif_iops (ide_hwif_t *hwif)
EXPORT_SYMBOL(default_hwif_iops); EXPORT_SYMBOL(default_hwif_iops);
static u8 ide_mm_inb (u32 port) static u8 ide_mm_inb (ide_ioreg_t port)
{ {
return (u8) readb(port); return (u8) readb(port);
} }
static u16 ide_mm_inw (u32 port) static u16 ide_mm_inw (ide_ioreg_t port)
{ {
return (u16) readw(port); return (u16) readw(port);
} }
static void ide_mm_insw (u32 port, void *addr, u32 count) static void ide_mm_insw (ide_ioreg_t port, void *addr, u32 count)
{ {
#ifdef CONFIG_PPC #ifdef CONFIG_PPC
/* Can we move the barrier out of the loop ? */ /* Can we move the barrier out of the loop ? */
...@@ -118,12 +118,12 @@ static void ide_mm_insw (u32 port, void *addr, u32 count) ...@@ -118,12 +118,12 @@ static void ide_mm_insw (u32 port, void *addr, u32 count)
#endif #endif
} }
static u32 ide_mm_inl (u32 port) static u32 ide_mm_inl (ide_ioreg_t port)
{ {
return (u32) readl(port); return (u32) readl(port);
} }
static void ide_mm_insl (u32 port, void *addr, u32 count) static void ide_mm_insl (ide_ioreg_t port, void *addr, u32 count)
{ {
#ifdef CONFIG_PPC #ifdef CONFIG_PPC
/* Can we move the barrier out of the loop ? */ /* Can we move the barrier out of the loop ? */
...@@ -133,17 +133,17 @@ static void ide_mm_insl (u32 port, void *addr, u32 count) ...@@ -133,17 +133,17 @@ static void ide_mm_insl (u32 port, void *addr, u32 count)
#endif #endif
} }
static void ide_mm_outb (u8 value, u32 port) static void ide_mm_outb (u8 value, ide_ioreg_t port)
{ {
writeb(value, port); writeb(value, port);
} }
static void ide_mm_outw (u16 value, u32 port) static void ide_mm_outw (u16 value, ide_ioreg_t port)
{ {
writew(value, port); writew(value, port);
} }
static void ide_mm_outsw (u32 port, void *addr, u32 count) static void ide_mm_outsw (ide_ioreg_t port, void *addr, u32 count)
{ {
#ifdef CONFIG_PPC #ifdef CONFIG_PPC
/* Can we move the barrier out of the loop ? */ /* Can we move the barrier out of the loop ? */
...@@ -153,12 +153,12 @@ static void ide_mm_outsw (u32 port, void *addr, u32 count) ...@@ -153,12 +153,12 @@ static void ide_mm_outsw (u32 port, void *addr, u32 count)
#endif #endif
} }
static void ide_mm_outl (u32 value, u32 port) static void ide_mm_outl (u32 value, ide_ioreg_t port)
{ {
writel(value, port); writel(value, port);
} }
static void ide_mm_outsl (u32 port, void *addr, u32 count) static void ide_mm_outsl (ide_ioreg_t port, void *addr, u32 count)
{ {
#ifdef CONFIG_PPC #ifdef CONFIG_PPC
while (count--) { __raw_writel(*(u32 *)addr, port); iobarrier_w(); addr += 4; } while (count--) { __raw_writel(*(u32 *)addr, port); iobarrier_w(); addr += 4; }
......
...@@ -299,17 +299,17 @@ typedef enum { ide_unknown, ide_generic, ide_pci, ...@@ -299,17 +299,17 @@ typedef enum { ide_unknown, ide_generic, ide_pci,
typedef struct ide_io_ops_s { typedef struct ide_io_ops_s {
/* insert io operations here! */ /* insert io operations here! */
void (*OUTB)(u8 addr, u32 port); void (*OUTB)(u8 addr, ide_ioreg_t port);
void (*OUTW)(u16 addr, u32 port); void (*OUTW)(u16 addr, ide_ioreg_t port);
void (*OUTL)(u32 addr, u32 port); void (*OUTL)(u32 addr, ide_ioreg_t port);
void (*OUTSW)(u32 port, void *addr, u32 count); void (*OUTSW)(ide_ioreg_t port, void *addr, u32 count);
void (*OUTSL)(u32 port, void *addr, u32 count); void (*OUTSL)(ide_ioreg_t port, void *addr, u32 count);
u8 (*INB)(u32 port); u8 (*INB)(ide_ioreg_t port);
u16 (*INW)(u32 port); u16 (*INW)(ide_ioreg_t port);
u32 (*INL)(u32 port); u32 (*INL)(ide_ioreg_t port);
void (*INSW)(u32 port, void *addr, u32 count); void (*INSW)(ide_ioreg_t port, void *addr, u32 count);
void (*INSL)(u32 port, void *addr, u32 count); void (*INSL)(ide_ioreg_t port, void *addr, u32 count);
} ide_io_ops_t; } ide_io_ops_t;
/* /*
...@@ -963,17 +963,17 @@ typedef struct hwif_s { ...@@ -963,17 +963,17 @@ typedef struct hwif_s {
#if 0 #if 0
ide_io_ops_t *iops; ide_io_ops_t *iops;
#else #else
void (*OUTB)(u8 addr, u32 port); void (*OUTB)(u8 addr, ide_ioreg_t port);
void (*OUTW)(u16 addr, u32 port); void (*OUTW)(u16 addr, ide_ioreg_t port);
void (*OUTL)(u32 addr, u32 port); void (*OUTL)(u32 addr, ide_ioreg_t port);
void (*OUTSW)(u32 port, void *addr, u32 count); void (*OUTSW)(ide_ioreg_t port, void *addr, u32 count);
void (*OUTSL)(u32 port, void *addr, u32 count); void (*OUTSL)(ide_ioreg_t port, void *addr, u32 count);
u8 (*INB)(u32 port); u8 (*INB)(ide_ioreg_t port);
u16 (*INW)(u32 port); u16 (*INW)(ide_ioreg_t port);
u32 (*INL)(u32 port); u32 (*INL)(ide_ioreg_t port);
void (*INSW)(u32 port, void *addr, u32 count); void (*INSW)(ide_ioreg_t port, void *addr, u32 count);
void (*INSL)(u32 port, void *addr, u32 count); void (*INSL)(ide_ioreg_t port, void *addr, u32 count);
#endif #endif
/* dma physical region descriptor table (cpu view) */ /* dma physical region descriptor table (cpu view) */
......
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