]> git.hungrycats.org Git - linux/commitdiff
[PATCH] ide io port types
authorJens Axboe <axboe@suse.de>
Mon, 7 Oct 2002 02:27:37 +0000 (19:27 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Mon, 7 Oct 2002 02:27:37 +0000 (19:27 -0700)
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.

drivers/ide/ide-disk.c
drivers/ide/ide-iops.c
include/linux/ide.h

index b5927f2e2787d6e21cb9d9fa413a51246b8ffaf1..4dd29468f9d4b8b91439d0f72ef0a9de90df7fcb 100644 (file)
@@ -1500,7 +1500,7 @@ static int idedisk_suspend(struct device *dev, u32 state, u32 level)
 {
        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
         * already been done...
index 353e71f6eef7520d2c63dd3406e7b0bf169d0ee5..dabb04e4f867d5f062bd5db3587fa1a087188e74 100644 (file)
 #include <asm/bitops.h>
 
 
-static u8 ide_inb (u32 port)
+static u8 ide_inb (ide_ioreg_t port)
 {
        return (u8) inb(port);
 }
 
-static u16 ide_inw (u32 port)
+static u16 ide_inw (ide_ioreg_t 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);
 }
 
-static u32 ide_inl (u32 port)
+static u32 ide_inl (ide_ioreg_t 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);
 }
 
-static void ide_outb (u8 addr, u32 port)
+static void ide_outb (u8 addr, ide_ioreg_t 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);
 }
 
-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);
 }
 
-static void ide_outl (u32 addr, u32 port)
+static void ide_outl (u32 addr, ide_ioreg_t 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);
 }
@@ -98,17 +98,17 @@ void default_hwif_iops (ide_hwif_t *hwif)
 
 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);
 }
 
-static u16 ide_mm_inw (u32 port)
+static u16 ide_mm_inw (ide_ioreg_t 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
        /* Can we move the barrier out of the loop ? */
@@ -118,12 +118,12 @@ static void ide_mm_insw (u32 port, void *addr, u32 count)
 #endif
 }
 
-static u32 ide_mm_inl (u32 port)
+static u32 ide_mm_inl (ide_ioreg_t 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
        /* Can we move the barrier out of the loop ? */
@@ -133,17 +133,17 @@ static void ide_mm_insl (u32 port, void *addr, u32 count)
 #endif
 }
 
-static void ide_mm_outb (u8 value, u32 port)
+static void ide_mm_outb (u8 value, ide_ioreg_t 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);
 }
 
-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
        /* Can we move the barrier out of the loop ? */
@@ -153,12 +153,12 @@ static void ide_mm_outsw (u32 port, void *addr, u32 count)
 #endif
 }
 
-static void ide_mm_outl (u32 value, u32 port)
+static void ide_mm_outl (u32 value, ide_ioreg_t 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
        while (count--) { __raw_writel(*(u32 *)addr, port); iobarrier_w(); addr += 4; }
index 7b8ebfe2c8dd41a9301f07ff7f05b9440bc3e836..18dd00fc7c5811254f1c3eb79a899126e8e43fa4 100644 (file)
@@ -299,17 +299,17 @@ typedef enum {    ide_unknown,    ide_generic,    ide_pci,
 
 typedef struct ide_io_ops_s {
        /* insert io operations here! */
-       void (*OUTB)(u8 addr, u32 port);
-       void (*OUTW)(u16 addr, u32 port);
-       void (*OUTL)(u32 addr, u32 port);
-       void (*OUTSW)(u32 port, void *addr, u32 count);
-       void (*OUTSL)(u32 port, void *addr, u32 count);
-
-       u8  (*INB)(u32 port);
-       u16 (*INW)(u32 port);
-       u32 (*INL)(u32 port);
-       void (*INSW)(u32 port, void *addr, u32 count);
-       void (*INSL)(u32 port, void *addr, u32 count);
+       void (*OUTB)(u8 addr, ide_ioreg_t port);
+       void (*OUTW)(u16 addr, ide_ioreg_t port);
+       void (*OUTL)(u32 addr, ide_ioreg_t port);
+       void (*OUTSW)(ide_ioreg_t port, void *addr, u32 count);
+       void (*OUTSL)(ide_ioreg_t port, void *addr, u32 count);
+
+       u8  (*INB)(ide_ioreg_t port);
+       u16 (*INW)(ide_ioreg_t port);
+       u32 (*INL)(ide_ioreg_t port);
+       void (*INSW)(ide_ioreg_t port, void *addr, u32 count);
+       void (*INSL)(ide_ioreg_t port, void *addr, u32 count);
 } ide_io_ops_t;
 
 /*
@@ -963,17 +963,17 @@ typedef struct hwif_s {
 #if 0
        ide_io_ops_t    *iops;
 #else
-       void (*OUTB)(u8 addr, u32 port);
-       void (*OUTW)(u16 addr, u32 port);
-       void (*OUTL)(u32 addr, u32 port);
-       void (*OUTSW)(u32 port, void *addr, u32 count);
-       void (*OUTSL)(u32 port, void *addr, u32 count);
-
-       u8  (*INB)(u32 port);
-       u16 (*INW)(u32 port);
-       u32 (*INL)(u32 port);
-       void (*INSW)(u32 port, void *addr, u32 count);
-       void (*INSL)(u32 port, void *addr, u32 count);
+       void (*OUTB)(u8 addr, ide_ioreg_t port);
+       void (*OUTW)(u16 addr, ide_ioreg_t port);
+       void (*OUTL)(u32 addr, ide_ioreg_t port);
+       void (*OUTSW)(ide_ioreg_t port, void *addr, u32 count);
+       void (*OUTSL)(ide_ioreg_t port, void *addr, u32 count);
+
+       u8  (*INB)(ide_ioreg_t port);
+       u16 (*INW)(ide_ioreg_t port);
+       u32 (*INL)(ide_ioreg_t port);
+       void (*INSW)(ide_ioreg_t port, void *addr, u32 count);
+       void (*INSL)(ide_ioreg_t port, void *addr, u32 count);
 #endif
 
        /* dma physical region descriptor table (cpu view) */