Changeset 9473


Ignore:
Timestamp:
2007-11-01T18:11:16+01:00 (9 years ago)
Author:
florian
Message:

CF driver cleanup

Location:
trunk/target/linux/adm5120/files
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/adm5120/files/arch/mips/adm5120/boards/mikrotik.c

    r9423 r9473  
    5959#define RB150_NAND_WRITE(v) \ 
    6060        writeb((v), (void __iomem *)KSEG1ADDR(RB150_NAND_BASE)) 
     61 
     62#define RB153_GPIO_CF_RDY       ADM5120_GPIO_P1L1 
     63#define RB153_GPIO_CF_WT        ADM5120_GPIO_P0L0 
    6164 
    6265/*--------------------------------------------------------------------------*/ 
     
    234237} 
    235238 
     239static void __init rb153_cf_setup(void) 
     240{ 
     241        gpio_request(RB153_GPIO_CF_RDY, "cf-ready"); 
     242        gpio_direction_input(RB153_GPIO_CF_RDY); 
     243        gpio_request(RB153_GPIO_CF_WT, "cf-wait"); 
     244        gpio_direction_output(RB153_GPIO_CF_WT, 1); 
     245        gpio_direction_input(RB153_GPIO_CF_WT); 
     246} 
     247 
    236248static void __init rb1xx_setup(void) 
    237249{ 
     
    270282} 
    271283 
     284static void __init rb153_setup(void) 
     285{ 
     286        rb150_setup(); 
     287        rb153_cf_setup(); 
     288} 
     289 
    272290/*--------------------------------------------------------------------------*/ 
    273291 
     
    321339 
    322340ADM5120_BOARD_START(RB_153, "Mikrotik RouterBOARD 153") 
    323         .board_setup    = rb1xx_setup, 
     341        .board_setup    = rb153_setup, 
    324342        .eth_num_ports  = 5, 
    325343        .eth_vlans      = rb15x_vlans, 
  • trunk/target/linux/adm5120/files/drivers/block/rb1xx/ata.c

    r9447 r9473  
    1717#include <linux/ioport.h>       /* request_mem_region() */ 
    1818 
    19 #include <asm/unaligned.h>              /* ioremap() */ 
    20 #include <asm/io.h>             /* ioremap() */ 
     19#include <asm/unaligned.h> 
     20#include <asm/io.h> 
     21#include <asm/gpio.h> 
    2122 
    2223#include <gpio.h> 
     
    7071static inline int cfrdy(struct cf_mips_dev *dev) 
    7172{ 
    72         return (SW_READ_REG(GPIO_CONF0) & (1 << 12)); 
     73        return gpio_get_value(12); 
    7374} 
    7475 
     
    9394 
    9495        /* on RB100 WAIT is LOW all the time => read will hang */ 
    95         if (SW_READ_REG(GPIO_CONF0) & (1 << 8)) 
     96        if (gpio_read_value(8)) 
    9697                cmd |= EXTIO_WAIT_EN; 
    9798 
  • trunk/target/linux/adm5120/files/drivers/block/rb1xx/bdev.c

    r9403 r9473  
    9494        } 
    9595 
    96         dev = (struct cf_mips_dev *)kmalloc(sizeof(struct cf_mips_dev),GFP_KERNEL); 
     96        dev = (struct cf_mips_dev *)kzalloc(sizeof(struct cf_mips_dev),GFP_KERNEL); 
    9797        if (!dev) 
    9898                goto out_err; 
    99         memset(dev, 0, sizeof(struct cf_mips_dev)); 
     99 
    100100        cdev->dev = dev; 
    101101         
     
    105105        dev->base = (void *) r->start; 
    106106         
    107         if (cf_init(dev)) goto out_err; 
    108         printk("init done"); 
     107        if (cf_init(dev)) 
     108                goto out_err; 
     109        printk(KERN_INFO "cf-mips: init done"); 
    109110         
    110111        spin_lock_init(&dev->lock); 
     
    126127        cf_gendisk = dev->gd; 
    127128        cdev->gd = dev->gd; 
    128         if (!cf_gendisk) goto out_err; /* Last of these goto's */ 
     129 
     130        if (!cf_gendisk) 
     131                goto out_err; /* Last of these goto's */ 
    129132         
    130133        cf_gendisk->major = MAJOR_NR; 
Note: See TracChangeset for help on using the changeset viewer.