diff options
author | Rob Herring <rob.herring@calxeda.com> | 2011-12-22 15:07:00 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2012-01-08 19:14:58 -0500 |
commit | d0643aa16688131b4dfbd03797ad73bab4ff29bf (patch) | |
tree | db9e5b3d84358171bc550fe84f71a92f6de2b254 | |
parent | 99c8ea3e57e7b5551ffd9cd401c4bf302b5664e3 (diff) |
pata_of_platform: remove direct dependency on OF_IRQ
CONFIG_OF_IRQ is not available on some platforms and using of_irq_*
breaks the build. Since resources are already populated in the platform
device, get the irq from there instead.
Reported-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
-rw-r--r-- | drivers/ata/Kconfig | 2 | ||||
-rw-r--r-- | drivers/ata/pata_of_platform.c | 15 |
2 files changed, 7 insertions, 10 deletions
diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig index cf047c406d92..6bdedd7cca2c 100644 --- a/drivers/ata/Kconfig +++ b/drivers/ata/Kconfig | |||
@@ -820,7 +820,7 @@ config PATA_PLATFORM | |||
820 | 820 | ||
821 | config PATA_OF_PLATFORM | 821 | config PATA_OF_PLATFORM |
822 | tristate "OpenFirmware platform device PATA support" | 822 | tristate "OpenFirmware platform device PATA support" |
823 | depends on PATA_PLATFORM && OF && OF_IRQ | 823 | depends on PATA_PLATFORM && OF |
824 | help | 824 | help |
825 | This option enables support for generic directly connected ATA | 825 | This option enables support for generic directly connected ATA |
826 | devices commonly found on embedded systems with OpenFirmware | 826 | devices commonly found on embedded systems with OpenFirmware |
diff --git a/drivers/ata/pata_of_platform.c b/drivers/ata/pata_of_platform.c index 9f11c35418c4..1654dc27e7f8 100644 --- a/drivers/ata/pata_of_platform.c +++ b/drivers/ata/pata_of_platform.c | |||
@@ -12,8 +12,7 @@ | |||
12 | #include <linux/kernel.h> | 12 | #include <linux/kernel.h> |
13 | #include <linux/module.h> | 13 | #include <linux/module.h> |
14 | #include <linux/of_address.h> | 14 | #include <linux/of_address.h> |
15 | #include <linux/of_irq.h> | 15 | #include <linux/platform_device.h> |
16 | #include <linux/of_platform.h> | ||
17 | #include <linux/ata_platform.h> | 16 | #include <linux/ata_platform.h> |
18 | 17 | ||
19 | static int __devinit pata_of_platform_probe(struct platform_device *ofdev) | 18 | static int __devinit pata_of_platform_probe(struct platform_device *ofdev) |
@@ -22,7 +21,7 @@ static int __devinit pata_of_platform_probe(struct platform_device *ofdev) | |||
22 | struct device_node *dn = ofdev->dev.of_node; | 21 | struct device_node *dn = ofdev->dev.of_node; |
23 | struct resource io_res; | 22 | struct resource io_res; |
24 | struct resource ctl_res; | 23 | struct resource ctl_res; |
25 | struct resource irq_res; | 24 | struct resource *irq_res; |
26 | unsigned int reg_shift = 0; | 25 | unsigned int reg_shift = 0; |
27 | int pio_mode = 0; | 26 | int pio_mode = 0; |
28 | int pio_mask; | 27 | int pio_mask; |
@@ -51,11 +50,9 @@ static int __devinit pata_of_platform_probe(struct platform_device *ofdev) | |||
51 | } | 50 | } |
52 | } | 51 | } |
53 | 52 | ||
54 | ret = of_irq_to_resource(dn, 0, &irq_res); | 53 | irq_res = platform_get_resource(ofdev, IORESOURCE_IRQ, 0); |
55 | if (!ret) | 54 | if (irq_res) |
56 | irq_res.start = irq_res.end = 0; | 55 | irq_res->flags = 0; |
57 | else | ||
58 | irq_res.flags = 0; | ||
59 | 56 | ||
60 | prop = of_get_property(dn, "reg-shift", NULL); | 57 | prop = of_get_property(dn, "reg-shift", NULL); |
61 | if (prop) | 58 | if (prop) |
@@ -75,7 +72,7 @@ static int __devinit pata_of_platform_probe(struct platform_device *ofdev) | |||
75 | pio_mask = 1 << pio_mode; | 72 | pio_mask = 1 << pio_mode; |
76 | pio_mask |= (1 << pio_mode) - 1; | 73 | pio_mask |= (1 << pio_mode) - 1; |
77 | 74 | ||
78 | return __pata_platform_probe(&ofdev->dev, &io_res, &ctl_res, &irq_res, | 75 | return __pata_platform_probe(&ofdev->dev, &io_res, &ctl_res, irq_res, |
79 | reg_shift, pio_mask); | 76 | reg_shift, pio_mask); |
80 | } | 77 | } |
81 | 78 | ||