]> git.sur5r.net Git - u-boot/blobdiff - drivers/misc/altera_sysid.c
spi: omap3: fix claim/release bus within DM
[u-boot] / drivers / misc / altera_sysid.c
index 249b273fb3b3f00c0a218fbbe2c5fa164df8b1a2..883b2a35e0793221ef628512ff99652f5e05fa9b 100644 (file)
@@ -1,8 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * (C) Copyright 2004, Psyent Corporation <www.psyent.com>
  * Scott McNutt <smcnutt@psyent.com>
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -32,11 +31,9 @@ void display_sysid(void)
        int ret;
 
        /* the first misc device will be used */
-       ret = uclass_first_device(UCLASS_MISC, &dev);
+       ret = uclass_first_device_err(UCLASS_MISC, &dev);
        if (ret)
                return;
-       if (!dev)
-               return;
        ret = misc_read(dev, 0, &sysid, sizeof(sysid));
        if (ret)
                return;
@@ -76,8 +73,9 @@ static int altera_sysid_ofdata_to_platdata(struct udevice *dev)
 {
        struct altera_sysid_platdata *plat = dev_get_platdata(dev);
 
-       plat->regs = ioremap(dev_get_addr(dev),
-               sizeof(struct altera_sysid_regs));
+       plat->regs = map_physmem(devfdt_get_addr(dev),
+                                sizeof(struct altera_sysid_regs),
+                                MAP_NOCACHE);
 
        return 0;
 }
@@ -87,8 +85,8 @@ static const struct misc_ops altera_sysid_ops = {
 };
 
 static const struct udevice_id altera_sysid_ids[] = {
-       { .compatible = "altr,sysid-1.0", },
-       { }
+       { .compatible = "altr,sysid-1.0" },
+       {}
 };
 
 U_BOOT_DRIVER(altera_sysid) = {