From: Pawel Moll Date: Wed, 7 Sep 2011 12:36:26 +0000 (+0100) Subject: ata: Make pata_of_platform.c compile again and work on non-PPC platforms X-Git-Tag: upstream/snapshot3+hdmi~8911^2~37 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=37210fbe1ddcd91b0331877fae81645978b5c3b1;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git 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 Signed-off-by: Pawel Moll Signed-off-by: Jeff Garzik --- diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig index 5987e0b..c6ef9d0 100644 --- a/drivers/ata/Kconfig +++ b/drivers/ata/Kconfig @@ -820,7 +820,7 @@ config PATA_PLATFORM config PATA_OF_PLATFORM tristate "OpenFirmware platform device PATA support" - depends on PATA_PLATFORM && PPC_OF + depends on PATA_PLATFORM && OF help This option enables support for generic directly connected ATA 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 f305400..a72ab0d 100644 --- a/drivers/ata/pata_of_platform.c +++ b/drivers/ata/pata_of_platform.c @@ -11,6 +11,8 @@ #include #include +#include +#include #include #include @@ -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;