sandbox: Correct operaion of 'reset' command
authorSimon Glass <sjg@chromium.org>
Sat, 3 Oct 2015 17:21:16 +0000 (11:21 -0600)
committerSimon Glass <sjg@chromium.org>
Mon, 5 Oct 2015 14:47:49 +0000 (15:47 +0100)
Currently 'reset' only works with the test device tree. When run without a
device tree, or with the normal device tree, the following error is
displayed:

   Reset not supported on this platform

Fix the driver and the standard device tree to avoid this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Stephen Warren <swarren@nvidia.com>
Tested-by: Stephen Warren <swarren@wwwdotorg.org>
arch/sandbox/dts/sandbox.dts
drivers/misc/reset_sandbox.c

index 65b9125f5fcc753f87f85cf964c9b8f013986307..08f72aceda530a9a357dd63a9b22bd3c23fef434 100644 (file)
                };
        };
 
+       reset@1 {
+               compatible = "sandbox,reset";
+       };
+
        spi@0 {
                #address-cells = <1>;
                #size-cells = <0>;
index 917121bc5e80777d7ad1da8ff795544ce6ca1c69..2691bb031a50eb2702f6bc56784aca7f37b24471 100644 (file)
@@ -40,7 +40,7 @@ static int sandbox_reset_request(struct udevice *dev, enum reset_t type)
         * (see the U_BOOT_DEVICE() declaration below) should not do anything.
         * If we are that device, return an error.
         */
-       if (gd->fdt_blob && dev->of_offset == -1)
+       if (state->fdt_fname && dev->of_offset == -1)
                return -ENODEV;
 
        switch (type) {