diff options
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r-- | drivers/usb/gadget/g_dnl.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/usb/gadget/g_dnl.c b/drivers/usb/gadget/g_dnl.c index 0491a0eea9..039331a5af 100644 --- a/drivers/usb/gadget/g_dnl.c +++ b/drivers/usb/gadget/g_dnl.c @@ -19,6 +19,8 @@ #include <dfu.h> #include <thor.h> +#include <env_callback.h> + #include "gadget_chips.h" #include "composite.c" @@ -202,6 +204,19 @@ static int g_dnl_get_bcd_device_number(struct usb_composite_dev *cdev) return g_dnl_get_board_bcd_device_number(gcnum); } +/** + * Update internal serial number variable when the "serial#" env var changes. + * + * Handle all cases, even when flags == H_PROGRAMMATIC or op == env_op_delete. + */ +static int on_serialno(const char *name, const char *value, enum env_op op, + int flags) +{ + g_dnl_set_serialnumber((char *)value); + return 0; +} +U_BOOT_ENV_CALLBACK(serialno, on_serialno); + static int g_dnl_bind(struct usb_composite_dev *cdev) { struct usb_gadget *gadget = cdev->gadget; |