summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorKefeng Wang <wangkefeng.wang@huawei.com>2017-01-24 13:08:29 +0100
committerTejun Heo <tj@kernel.org>2017-01-24 17:15:01 +0100
commit73b2951414f661e22dc4b88e4e6590c9406cf822 (patch)
tree1b9044182dd846786b41b2ec5647aac89ed5a844 /drivers
parentpata_atiixp: Don't use unconnected secondary port on SB600/SB700 (diff)
downloadlinux-73b2951414f661e22dc4b88e4e6590c9406cf822.tar.xz
linux-73b2951414f661e22dc4b88e4e6590c9406cf822.zip
ata: pata_of_platform: using of_property_read_u32() helper
Using better of_property_read_u32() than generic of_get_property(). Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Tejun Heo <tj@kernel.org> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ata/pata_of_platform.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/ata/pata_of_platform.c b/drivers/ata/pata_of_platform.c
index b6b7af894d9d..201a32d0627f 100644
--- a/drivers/ata/pata_of_platform.c
+++ b/drivers/ata/pata_of_platform.c
@@ -32,7 +32,6 @@ static int pata_of_platform_probe(struct platform_device *ofdev)
unsigned int reg_shift = 0;
int pio_mode = 0;
int pio_mask;
- const u32 *prop;
ret = of_address_to_resource(dn, 0, &io_res);
if (ret) {
@@ -50,13 +49,9 @@ static int pata_of_platform_probe(struct platform_device *ofdev)
irq_res = platform_get_resource(ofdev, IORESOURCE_IRQ, 0);
- prop = of_get_property(dn, "reg-shift", NULL);
- if (prop)
- reg_shift = be32_to_cpup(prop);
+ of_property_read_u32(dn, "reg-shift", &reg_shift);
- prop = of_get_property(dn, "pio-mode", NULL);
- if (prop) {
- pio_mode = be32_to_cpup(prop);
+ if (!of_property_read_u32(dn, "pio-mode", &pio_mode)) {
if (pio_mode > 6) {
dev_err(&ofdev->dev, "invalid pio-mode\n");
return -EINVAL;