summaryrefslogtreecommitdiff
path: root/arch/powerpc/sysdev/axonram.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/sysdev/axonram.c')
-rw-r--r--arch/powerpc/sysdev/axonram.c58
1 files changed, 18 insertions, 40 deletions
diff --git a/arch/powerpc/sysdev/axonram.c b/arch/powerpc/sysdev/axonram.c
index 2326d5dc5752..5eaf3e3f4b8b 100644
--- a/arch/powerpc/sysdev/axonram.c
+++ b/arch/powerpc/sysdev/axonram.c
@@ -59,8 +59,7 @@
struct axon_ram_bank {
struct of_device *device;
struct gendisk *disk;
- unsigned int irq_correctable;
- unsigned int irq_uncorrectable;
+ unsigned int irq_id;
unsigned long ph_addr;
unsigned long io_addr;
unsigned long size;
@@ -93,16 +92,9 @@ axon_ram_irq_handler(int irq, void *dev)
BUG_ON(!bank);
- if (irq == bank->irq_correctable) {
- dev_err(&device->dev, "Correctable memory error occured\n");
- bank->ecc_counter++;
- return IRQ_HANDLED;
- } else if (irq == bank->irq_uncorrectable) {
- dev_err(&device->dev, "Uncorrectable memory error occured\n");
- panic("Critical ECC error on %s", device->node->full_name);
- }
-
- return IRQ_NONE;
+ dev_err(&device->dev, "Correctable memory error occured\n");
+ bank->ecc_counter++;
+ return IRQ_HANDLED;
}
/**
@@ -125,7 +117,7 @@ axon_ram_make_request(struct request_queue *queue, struct bio *bio)
transfered = 0;
bio_for_each_segment(vec, bio, idx) {
if (unlikely(phys_mem + vec->bv_len > phys_end)) {
- bio_io_error(bio, bio->bi_size);
+ bio_io_error(bio);
rc = -ERANGE;
break;
}
@@ -139,7 +131,7 @@ axon_ram_make_request(struct request_queue *queue, struct bio *bio)
phys_mem += vec->bv_len;
transfered += vec->bv_len;
}
- bio_endio(bio, transfered, 0);
+ bio_endio(bio, 0);
return rc;
}
@@ -259,28 +251,18 @@ axon_ram_probe(struct of_device *device, const struct of_device_id *device_id)
blk_queue_hardsect_size(bank->disk->queue, AXON_RAM_SECTOR_SIZE);
add_disk(bank->disk);
- bank->irq_correctable = irq_of_parse_and_map(device->node, 0);
- bank->irq_uncorrectable = irq_of_parse_and_map(device->node, 1);
- if ((bank->irq_correctable <= 0) || (bank->irq_uncorrectable <= 0)) {
+ bank->irq_id = irq_of_parse_and_map(device->node, 0);
+ if (bank->irq_id == NO_IRQ) {
dev_err(&device->dev, "Cannot access ECC interrupt ID\n");
rc = -EFAULT;
goto failed;
}
- rc = request_irq(bank->irq_correctable, axon_ram_irq_handler,
+ rc = request_irq(bank->irq_id, axon_ram_irq_handler,
AXON_RAM_IRQ_FLAGS, bank->disk->disk_name, device);
if (rc != 0) {
dev_err(&device->dev, "Cannot register ECC interrupt handler\n");
- bank->irq_correctable = bank->irq_uncorrectable = 0;
- rc = -EFAULT;
- goto failed;
- }
-
- rc = request_irq(bank->irq_uncorrectable, axon_ram_irq_handler,
- AXON_RAM_IRQ_FLAGS, bank->disk->disk_name, device);
- if (rc != 0) {
- dev_err(&device->dev, "Cannot register ECC interrupt handler\n");
- bank->irq_uncorrectable = 0;
+ bank->irq_id = NO_IRQ;
rc = -EFAULT;
goto failed;
}
@@ -296,13 +278,9 @@ axon_ram_probe(struct of_device *device, const struct of_device_id *device_id)
failed:
if (bank != NULL) {
- if (bank->irq_uncorrectable > 0)
- free_irq(bank->irq_uncorrectable, device);
- if (bank->irq_correctable > 0)
- free_irq(bank->irq_correctable, device);
+ if (bank->irq_id != NO_IRQ)
+ free_irq(bank->irq_id, device);
if (bank->disk != NULL) {
- if (bank->disk->queue != NULL)
- blk_cleanup_queue(bank->disk->queue);
if (bank->disk->major > 0)
unregister_blkdev(bank->disk->major,
bank->disk->disk_name);
@@ -329,9 +307,7 @@ axon_ram_remove(struct of_device *device)
BUG_ON(!bank || !bank->disk);
device_remove_file(&device->dev, &dev_attr_ecc);
- free_irq(bank->irq_uncorrectable, device);
- free_irq(bank->irq_correctable, device);
- blk_cleanup_queue(bank->disk->queue);
+ free_irq(bank->irq_id, device);
unregister_blkdev(bank->disk->major, bank->disk->disk_name);
del_gendisk(bank->disk);
iounmap((void __iomem *) bank->io_addr);
@@ -348,11 +324,13 @@ static struct of_device_id axon_ram_device_id[] = {
};
static struct of_platform_driver axon_ram_driver = {
- .owner = THIS_MODULE,
- .name = AXON_RAM_MODULE_NAME,
.match_table = axon_ram_device_id,
.probe = axon_ram_probe,
- .remove = axon_ram_remove
+ .remove = axon_ram_remove,
+ .driver = {
+ .owner = THIS_MODULE,
+ .name = AXON_RAM_MODULE_NAME,
+ },
};
/**