[2.6 patch] MTD: remove some kernel 2.0 and 2.2 #ifdef's

From: Adrian Bunk (bunk_at_fs.tum.de)
Date: 07/18/04

  • Next message: Adrian Sandor: "Re: disabling irq, nobody cared"
    Date:	Sun, 18 Jul 2004 14:00:48 +0200
    To: dwmw2@redhat.com
    
    

    The patch below (applies against 2.6.8-rc2) removes some #ifdef's for
    kernel 2.0 and 2.2 from the MTD code.

    diffstat output:
     drivers/mtd/chips/cfi_cmdset_0020.c | 5 -----
     drivers/mtd/nand/tx4925ndfmc.c | 8 --------
     drivers/mtd/devices/pmc551.c | 12 +++---------
     drivers/mtd/nand/autcpu12.c | 8 --------
     include/linux/mtd/cfi.h | 2 --
     5 files changed, 3 insertions(+), 32 deletions(-)

    Signed-off-by: Adrian Bunk <bunk@fs.tum.de>

    --- linux-2.6.8-rc2-full/drivers/mtd/chips/cfi_cmdset_0020.c.old 2004-07-18 13:49:31.000000000 +0200
    +++ linux-2.6.8-rc2-full/drivers/mtd/chips/cfi_cmdset_0020.c 2004-07-18 13:49:45.000000000 +0200
    @@ -1400,11 +1400,6 @@
             kfree(cfi);
     }
     
    -#if LINUX_VERSION_CODE < 0x20212 && defined(MODULE)
    -#define cfi_staa_init init_module
    -#define cfi_staa_exit cleanup_module
    -#endif
    -
     static char im_name[]="cfi_cmdset_0020";
     
     int __init cfi_staa_init(void)
    --- mtd/drivers/mtd/devices/pmc551.c 24 Jan 2003 13:34:30 -0000 1.22
    +++ mtd/drivers/mtd/devices/pmc551.c 12 Mar 2003 08:57:58 -0000
    @@ -108,12 +108,6 @@
     #include <linux/mtd/pmc551.h>
     #include <linux/mtd/compatmac.h>
     
    -#if LINUX_VERSION_CODE > 0x20300
    -#define PCI_BASE_ADDRESS(dev) (dev->resource[0].start)
    -#else
    -#define PCI_BASE_ADDRESS(dev) (dev->base_address[0])
    -#endif
    -
     static struct mtd_info *pmc551list;
     
     static int pmc551_erase (struct mtd_info *mtd, struct erase_info *instr)
    @@ -563,7 +557,7 @@
                    (size<1024)?size:(size<1048576)?size>>10:size>>20,
                    (size<1024)?'B':(size<1048576)?'K':'M',
                    size, ((dcmd&(0x1<<3)) == 0)?"non-":"",
    - PCI_BASE_ADDRESS(dev)&PCI_BASE_ADDRESS_MEM_MASK );
    + (dev->resource[0].start)&PCI_BASE_ADDRESS_MEM_MASK );
     
             /*
              * Check to see the state of the memory
    @@ -698,7 +692,7 @@
                     }
     
                     printk(KERN_NOTICE "pmc551: Found PCI V370PDC at 0x%lX\n",
    - PCI_BASE_ADDRESS(PCI_Device));
    + PCI_Device->resource[0].start);
     
                     /*
                      * The PMC551 device acts VERY weird if you don't init it
    @@ -752,7 +746,7 @@
                             printk(KERN_NOTICE "pmc551: Using specified aperture size %dM\n", asize>>20);
                             priv->asize = asize;
                     }
    - priv->start = ioremap((PCI_BASE_ADDRESS(PCI_Device)
    + priv->start = ioremap(((PCI_Device->resource[0].start)
                                            & PCI_BASE_ADDRESS_MEM_MASK),
                                           priv->asize);
                     
    --- mtd/drivers/mtd/nand/autcpu12.c 20 Feb 2003 13:39:38 -0000 1.9
    +++ mtd/drivers/mtd/nand/autcpu12.c 12 Mar 2003 08:58:00 -0000
    @@ -42,14 +42,6 @@
      */
     static struct mtd_info *autcpu12_mtd = NULL;
     
    -/*
    - * Module stuff
    - */
    -#if LINUX_VERSION_CODE < 0x20212 && defined(MODULE)
    -#define autcpu12_init init_module
    -#define autcpu12_cleanup cleanup_module
    -#endif
    -
     static int autcpu12_io_base = CS89712_VIRT_BASE;
     static int autcpu12_fio_pbase = AUTCPU12_PHYS_SMC;
     static int autcpu12_fio_ctrl = AUTCPU12_SMC_SELECT_OFFSET;
    --- linux-2.6.8-rc2-full/drivers/mtd/nand/tx4925ndfmc.c.old 2004-07-18 13:53:28.000000000 +0200
    +++ linux-2.6.8-rc2-full/drivers/mtd/nand/tx4925ndfmc.c 2004-07-18 13:53:41.000000000 +0200
    @@ -40,14 +40,6 @@
     static struct mtd_info *tx4925ndfmc_mtd = NULL;
     
     /*
    - * Module stuff
    - */
    -#if LINUX_VERSION_CODE < 0x20212 && defined(MODULE)
    -#define tx4925ndfmc_init init_module
    -#define tx4925ndfmc_cleanup cleanup_module
    -#endif
    -
    -/*
      * Define partitions for flash devices
      */
     
    --- mtd/include/linux/mtd/cfi.h 5 Sep 2002 05:15:32 -0000 1.32
    +++ mtd/include/linux/mtd/cfi.h 12 Mar 2003 08:58:13 -0000
    @@ -457,14 +457,12 @@
     
     static inline void cfi_udelay(int us)
     {
    -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0)
             unsigned long t = us * HZ / 1000000;
             if (t) {
                     set_current_state(TASK_UNINTERRUPTIBLE);
                     schedule_timeout(t);
                     return;
             }
    -#endif
             udelay(us);
             cond_resched();
     }

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: Adrian Sandor: "Re: disabling irq, nobody cared"

    Relevant Pages