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>
This commit is contained in:
Pawel Moll 2011-09-07 13:36:26 +01:00 committed by Jeff Garzik
parent edc7d12ede
commit 37210fbe1d
2 changed files with 5 additions and 3 deletions

View file

@ -820,7 +820,7 @@ config PATA_PLATFORM
config PATA_OF_PLATFORM config PATA_OF_PLATFORM
tristate "OpenFirmware platform device PATA support" tristate "OpenFirmware platform device PATA support"
depends on PATA_PLATFORM && PPC_OF depends on PATA_PLATFORM && OF
help help
This option enables support for generic directly connected ATA This option enables support for generic directly connected ATA
devices commonly found on embedded systems with OpenFirmware devices commonly found on embedded systems with OpenFirmware

View file

@ -11,6 +11,8 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/of_address.h>
#include <linux/of_irq.h>
#include <linux/of_platform.h> #include <linux/of_platform.h>
#include <linux/ata_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); prop = of_get_property(dn, "reg-shift", NULL);
if (prop) if (prop)
reg_shift = *prop; reg_shift = be32_to_cpup(prop);
prop = of_get_property(dn, "pio-mode", NULL); prop = of_get_property(dn, "pio-mode", NULL);
if (prop) { if (prop) {
pio_mode = *prop; pio_mode = be32_to_cpup(prop);
if (pio_mode > 6) { if (pio_mode > 6) {
dev_err(&ofdev->dev, "invalid pio-mode\n"); dev_err(&ofdev->dev, "invalid pio-mode\n");
return -EINVAL; return -EINVAL;