imx6: wandboard: fix dwc_ahsata build errors when DM enabled
[oweals/u-boot.git] / cmd / usb_gadget_sdp.c
index ae4d73c1250d02eb082d65ea687c2d6ad663412e..808ed974fa7537a367f3b8d5567fe1d0988f6224 100644 (file)
@@ -1,10 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * cmd_sdp.c -- sdp command
  *
  * Copyright (C) 2016 Toradex
  * Author: Stefan Agner <stefan.agner@toradex.com>
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -21,24 +20,24 @@ static int do_sdp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
        char *usb_controller = argv[1];
        int controller_index = simple_strtoul(usb_controller, NULL, 0);
-       board_usb_init(controller_index, USB_INIT_DEVICE);
+       usb_gadget_initialize(controller_index);
 
        g_dnl_clear_detach();
        g_dnl_register("usb_dnl_sdp");
 
        ret = sdp_init(controller_index);
        if (ret) {
-               pr_err("SDP init failed: %d", ret);
+               pr_err("SDP init failed: %d\n", ret);
                goto exit;
        }
 
        /* This command typically does not return but jumps to an image */
        sdp_handle(controller_index);
-       pr_err("SDP ended");
+       pr_err("SDP ended\n");
 
 exit:
        g_dnl_unregister();
-       board_usb_cleanup(controller_index, USB_INIT_DEVICE);
+       usb_gadget_release(controller_index);
 
        return ret;
 }