]> git.sur5r.net Git - u-boot/blobdiff - drivers/sysreset/sysreset_sandbox.c
dm: core: Add ofnode function to read a 64-bit int
[u-boot] / drivers / sysreset / sysreset_sandbox.c
index 0c4e2e1a93a696903cee0c8fb8f6e7e303854155..f12c4e841989f6f84461a434170be1539c8fa012 100644 (file)
@@ -1,8 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright (c) 2015 Google, Inc
  * Written by Simon Glass <sjg@chromium.org>
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -12,8 +11,6 @@
 #include <asm/state.h>
 #include <asm/test.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 static int sandbox_warm_sysreset_request(struct udevice *dev,
                                         enum sysreset_t type)
 {
@@ -41,7 +38,7 @@ static int sandbox_sysreset_request(struct udevice *dev, enum sysreset_t type)
         * (see the U_BOOT_DEVICE() declaration below) should not do anything.
         * If we are that device, return an error.
         */
-       if (state->fdt_fname && dev_of_offset(dev) == -1)
+       if (state->fdt_fname && !dev_of_valid(dev))
                return -ENODEV;
 
        switch (type) {