aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/pata_of_platform.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/drivers/ata/pata_of_platform.c b/drivers/ata/pata_of_platform.c
index a7e95a54c782..6af1c9b9a464 100644
--- a/drivers/ata/pata_of_platform.c
+++ b/drivers/ata/pata_of_platform.c
@@ -35,20 +35,11 @@ static int pata_of_platform_probe(struct platform_device *ofdev)
35 return -EINVAL; 35 return -EINVAL;
36 } 36 }
37 37
38 if (of_device_is_compatible(dn, "electra-ide")) { 38 ret = of_address_to_resource(dn, 1, &ctl_res);
39 /* Altstatus is really at offset 0x3f6 from the primary window 39 if (ret) {
40 * on electra-ide. Adjust ctl_res and io_res accordingly. 40 dev_err(&ofdev->dev, "can't get CTL address from "
41 */ 41 "device tree\n");
42 ctl_res = io_res; 42 return -EINVAL;
43 ctl_res.start = ctl_res.start+0x3f6;
44 io_res.end = ctl_res.start-1;
45 } else {
46 ret = of_address_to_resource(dn, 1, &ctl_res);
47 if (ret) {
48 dev_err(&ofdev->dev, "can't get CTL address from "
49 "device tree\n");
50 return -EINVAL;
51 }
52 } 43 }
53 44
54 irq_res = platform_get_resource(ofdev, IORESOURCE_IRQ, 0); 45 irq_res = platform_get_resource(ofdev, IORESOURCE_IRQ, 0);
@@ -79,8 +70,7 @@ static int pata_of_platform_probe(struct platform_device *ofdev)
79 70
80static struct of_device_id pata_of_platform_match[] = { 71static struct of_device_id pata_of_platform_match[] = {
81 { .compatible = "ata-generic", }, 72 { .compatible = "ata-generic", },
82 { .compatible = "electra-ide", }, 73 { },
83 {},
84}; 74};
85MODULE_DEVICE_TABLE(of, pata_of_platform_match); 75MODULE_DEVICE_TABLE(of, pata_of_platform_match);
86 76