summaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_of_platform.c
diff options
context:
space:
mode:
authorPawel Moll <pawel.moll@arm.com>2011-09-07 13:36:26 +0100
committerJeff Garzik <jgarzik@redhat.com>2011-10-08 00:07:16 -0400
commit37210fbe1ddcd91b0331877fae81645978b5c3b1 (patch)
treebc8aa82fe246f253b256602182ce587aa6349801 /drivers/ata/pata_of_platform.c
parentedc7d12ede4333a1fd7b59cebae970b4953ec9d0 (diff)
downloadlinux-stable-37210fbe1ddcd91b0331877fae81645978b5c3b1.tar.gz
linux-stable-37210fbe1ddcd91b0331877fae81645978b5c3b1.tar.bz2
linux-stable-37210fbe1ddcd91b0331877fae81645978b5c3b1.zip
ata: Make pata_of_platform.c compile again and work on non-PPC platforms
This patch adds missing #includes, makes the driver selectable on non-PPC OF-enabled platforms and fixes property value accesses to be correct in Little Endian system. Cc: Anton Vorontsov <avorontsov@ru.mvista.com> Signed-off-by: Pawel Moll <pawel.moll@arm.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata/pata_of_platform.c')
-rw-r--r--drivers/ata/pata_of_platform.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/ata/pata_of_platform.c b/drivers/ata/pata_of_platform.c
index f3054009bd25..a72ab0dde4e5 100644
--- a/drivers/ata/pata_of_platform.c
+++ b/drivers/ata/pata_of_platform.c
@@ -11,6 +11,8 @@
#include <linux/kernel.h>
#include <linux/module.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
#include <linux/of_platform.h>
#include <linux/ata_platform.h>
@@ -57,11 +59,11 @@ static int __devinit pata_of_platform_probe(struct platform_device *ofdev)
prop = of_get_property(dn, "reg-shift", NULL);
if (prop)
- reg_shift = *prop;
+ reg_shift = be32_to_cpup(prop);
prop = of_get_property(dn, "pio-mode", NULL);
if (prop) {
- pio_mode = *prop;
+ pio_mode = be32_to_cpup(prop);
if (pio_mode > 6) {
dev_err(&ofdev->dev, "invalid pio-mode\n");
return -EINVAL;