diff options
author | florian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2007-11-01 17:11:16 +0000 |
---|---|---|
committer | florian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2007-11-01 17:11:16 +0000 |
commit | a3f3528dd9590bd321122f96e65c935afc5176a7 (patch) | |
tree | 52f82585d91888442e882a14874ef740cf614953 /target/linux/adm5120/files/drivers/block | |
parent | a40177e0b251b982970f3a230945c1f19519aef4 (diff) |
CF driver cleanup
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@9473 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/adm5120/files/drivers/block')
-rw-r--r-- | target/linux/adm5120/files/drivers/block/rb1xx/ata.c | 9 | ||||
-rw-r--r-- | target/linux/adm5120/files/drivers/block/rb1xx/bdev.c | 13 |
2 files changed, 13 insertions, 9 deletions
diff --git a/target/linux/adm5120/files/drivers/block/rb1xx/ata.c b/target/linux/adm5120/files/drivers/block/rb1xx/ata.c index b396317f5..5447be521 100644 --- a/target/linux/adm5120/files/drivers/block/rb1xx/ata.c +++ b/target/linux/adm5120/files/drivers/block/rb1xx/ata.c @@ -16,8 +16,9 @@ #include <linux/pci.h> #include <linux/ioport.h> /* request_mem_region() */ -#include <asm/unaligned.h> /* ioremap() */ -#include <asm/io.h> /* ioremap() */ +#include <asm/unaligned.h> +#include <asm/io.h> +#include <asm/gpio.h> #include <gpio.h> #include <adm5120_defs.h> @@ -69,7 +70,7 @@ static inline u8 rareg(unsigned reg, struct cf_mips_dev* dev) static inline int cfrdy(struct cf_mips_dev *dev) { - return (SW_READ_REG(GPIO_CONF0) & (1 << 12)); + return gpio_get_value(12); } static inline void prepare_cf_irq(struct cf_mips_dev *dev) @@ -92,7 +93,7 @@ static inline int cf_present(struct cf_mips_dev* dev) int i; /* on RB100 WAIT is LOW all the time => read will hang */ - if (SW_READ_REG(GPIO_CONF0) & (1 << 8)) + if (gpio_read_value(8)) cmd |= EXTIO_WAIT_EN; SW_WRITE_REG(GPIO_CONF2, cmd); diff --git a/target/linux/adm5120/files/drivers/block/rb1xx/bdev.c b/target/linux/adm5120/files/drivers/block/rb1xx/bdev.c index 12c938505..bf63d206b 100644 --- a/target/linux/adm5120/files/drivers/block/rb1xx/bdev.c +++ b/target/linux/adm5120/files/drivers/block/rb1xx/bdev.c @@ -93,10 +93,10 @@ int cf_mips_probe(struct platform_device *pdev) return reg_result; } - dev = (struct cf_mips_dev *)kmalloc(sizeof(struct cf_mips_dev),GFP_KERNEL); + dev = (struct cf_mips_dev *)kzalloc(sizeof(struct cf_mips_dev),GFP_KERNEL); if (!dev) goto out_err; - memset(dev, 0, sizeof(struct cf_mips_dev)); + cdev->dev = dev; dev->pin = cdev->gpio_pin; @@ -104,8 +104,9 @@ int cf_mips_probe(struct platform_device *pdev) r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "cf_membase"); dev->base = (void *) r->start; - if (cf_init(dev)) goto out_err; - printk("init done"); + if (cf_init(dev)) + goto out_err; + printk(KERN_INFO "cf-mips: init done"); spin_lock_init(&dev->lock); dev->queue = blk_init_queue(cf_request,&dev->lock); @@ -125,7 +126,9 @@ int cf_mips_probe(struct platform_device *pdev) dev->gd = alloc_disk(CF_MAX_PART); cf_gendisk = dev->gd; cdev->gd = dev->gd; - if (!cf_gendisk) goto out_err; /* Last of these goto's */ + + if (!cf_gendisk) + goto out_err; /* Last of these goto's */ cf_gendisk->major = MAJOR_NR; cf_gendisk->first_minor = 0; |