source: trunk/target/linux/brcm47xx/patches-3.0/230-flash_linux_3_0.patch @ 27294

Last change on this file since 27294 was 27294, checked in by hauke, 5 years ago

brcm47xx: fix Linux-3.0 and fix clock rate detection.

File size: 1.7 KB
  • drivers/mtd/maps/bcm47xx-flash.c

    a b  
    4444#include <linux/wait.h> 
    4545#include <linux/mtd/mtd.h> 
    4646#include <linux/mtd/map.h> 
    47 #ifdef CONFIG_MTD_PARTITIONS 
    4847#include <linux/mtd/partitions.h> 
    49 #endif 
    5048#include <linux/crc32.h> 
    5149#ifdef CONFIG_SSB 
    5250#include <linux/ssb/ssb.h> 
    static struct map_info bcm47xx_map = { 
    120118        phys: WINDOW_ADDR, 
    121119}; 
    122120 
    123 #ifdef CONFIG_MTD_PARTITIONS 
    124121 
    125122static struct mtd_partition bcm47xx_parts[] = { 
    126123        { name: "cfe",  offset: 0, size: 0, mask_flags: MTD_WRITEABLE, }, 
    init_mtd_partitions(struct mtd_info *mtd 
    552549 
    553550        return bcm47xx_parts; 
    554551} 
    555 #endif 
    556552 
    557553int __init init_bcm47xx_map(void) 
    558554{ 
    int __init init_bcm47xx_map(void) 
    561557#endif 
    562558        size_t size; 
    563559        int ret = 0; 
    564 #ifdef CONFIG_MTD_PARTITIONS 
    565560        struct mtd_partition *parts; 
    566561        int i; 
    567 #endif 
    568562 
    569563#ifdef CONFIG_SSB 
    570564        u32 window = mcore->flash_window; 
    int __init init_bcm47xx_map(void) 
    602596 
    603597        printk(KERN_NOTICE "Flash device: 0x%x at 0x%x\n", size, WINDOW_ADDR); 
    604598 
    605 #ifdef CONFIG_MTD_PARTITIONS 
    606599        parts = init_mtd_partitions(bcm47xx_mtd, size); 
    607600        for (i = 0; parts[i].name; i++); 
    608         ret = add_mtd_partitions(bcm47xx_mtd, parts, i); 
     601        ret = mtd_device_register(bcm47xx_mtd, parts, i); 
    609602        if (ret) { 
    610                 printk(KERN_ERR "Flash: add_mtd_partitions failed\n"); 
     603                printk(KERN_ERR "Flash: mtd_device_register failed\n"); 
    611604                goto fail; 
    612605        } 
    613 #endif 
    614606        return 0; 
    615607 
    616608 fail: 
    int __init init_bcm47xx_map(void) 
    624616 
    625617void __exit cleanup_bcm47xx_map(void) 
    626618{ 
    627 #ifdef CONFIG_MTD_PARTITIONS 
    628         del_mtd_partitions(bcm47xx_mtd); 
    629 #endif 
     619        mtd_device_unregister(bcm47xx_mtd); 
    630620        map_destroy(bcm47xx_mtd); 
    631621        iounmap((void *)bcm47xx_map.virt); 
    632622} 
Note: See TracBrowser for help on using the repository browser.