remove remaining references of CONFIG_BOARDINFO
With this all code uses barebox_get_model() and no longer a compile time generated string. Also this renames barebox_boardinfo() to barebox_get_model() since we are going to add the corresponding _set_ function and 'model' corresponds to the devicetree notion. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
8326bff00f
commit
b986f4f1ee
|
@ -99,7 +99,7 @@ static int do_dfu(int argc, char *argv[])
|
||||||
char *endptr, *argstr;
|
char *endptr, *argstr;
|
||||||
struct usb_dfu_dev *dfu_alts = NULL;
|
struct usb_dfu_dev *dfu_alts = NULL;
|
||||||
char *manufacturer = "barebox";
|
char *manufacturer = "barebox";
|
||||||
char *productname = CONFIG_BOARDINFO;
|
const char *productname = barebox_get_model();
|
||||||
u16 idVendor = 0, idProduct = 0;
|
u16 idVendor = 0, idProduct = 0;
|
||||||
|
|
||||||
|
|
||||||
|
@ -163,7 +163,7 @@ BAREBOX_CMD_HELP_START(dfu)
|
||||||
BAREBOX_CMD_HELP_USAGE("dfu [OPTIONS] <description>\n")
|
BAREBOX_CMD_HELP_USAGE("dfu [OPTIONS] <description>\n")
|
||||||
BAREBOX_CMD_HELP_SHORT("Start firmware update with the Device Firmware Update (DFU) protocol.\n")
|
BAREBOX_CMD_HELP_SHORT("Start firmware update with the Device Firmware Update (DFU) protocol.\n")
|
||||||
BAREBOX_CMD_HELP_OPT ("-m <str>", "Manufacturer string (barebox)\n")
|
BAREBOX_CMD_HELP_OPT ("-m <str>", "Manufacturer string (barebox)\n")
|
||||||
BAREBOX_CMD_HELP_OPT ("-p <str>", "product string (" CONFIG_BOARDINFO ")\n")
|
BAREBOX_CMD_HELP_OPT ("-p <str>", "product string\n")
|
||||||
BAREBOX_CMD_HELP_OPT ("-V <id>", "vendor id\n")
|
BAREBOX_CMD_HELP_OPT ("-V <id>", "vendor id\n")
|
||||||
BAREBOX_CMD_HELP_OPT ("-P <id>", "product id\n")
|
BAREBOX_CMD_HELP_OPT ("-P <id>", "product id\n")
|
||||||
BAREBOX_CMD_HELP_OPT ("<description>",
|
BAREBOX_CMD_HELP_OPT ("<description>",
|
||||||
|
|
|
@ -33,7 +33,7 @@ static int do_usbserial(int argc, char *argv[])
|
||||||
struct usb_serial_pdata pdata;
|
struct usb_serial_pdata pdata;
|
||||||
char *argstr;
|
char *argstr;
|
||||||
char *manufacturer = "barebox";
|
char *manufacturer = "barebox";
|
||||||
char *productname = CONFIG_BOARDINFO;
|
const char *productname = barebox_get_model();
|
||||||
u16 idVendor = 0, idProduct = 0;
|
u16 idVendor = 0, idProduct = 0;
|
||||||
int mode = 0;
|
int mode = 0;
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ BAREBOX_CMD_HELP_START(usbserial)
|
||||||
BAREBOX_CMD_HELP_USAGE("usbserial [OPTIONS] <description>\n")
|
BAREBOX_CMD_HELP_USAGE("usbserial [OPTIONS] <description>\n")
|
||||||
BAREBOX_CMD_HELP_SHORT("Enable/disable a serial gadget on the USB device interface.\n")
|
BAREBOX_CMD_HELP_SHORT("Enable/disable a serial gadget on the USB device interface.\n")
|
||||||
BAREBOX_CMD_HELP_OPT ("-m <str>", "Manufacturer string (barebox)\n")
|
BAREBOX_CMD_HELP_OPT ("-m <str>", "Manufacturer string (barebox)\n")
|
||||||
BAREBOX_CMD_HELP_OPT ("-p <str>", "product string (" CONFIG_BOARDINFO ")\n")
|
BAREBOX_CMD_HELP_OPT ("-p <str>", "product string\n")
|
||||||
BAREBOX_CMD_HELP_OPT ("-V <id>", "vendor id\n")
|
BAREBOX_CMD_HELP_OPT ("-V <id>", "vendor id\n")
|
||||||
BAREBOX_CMD_HELP_OPT ("-P <id>", "product id\n")
|
BAREBOX_CMD_HELP_OPT ("-P <id>", "product id\n")
|
||||||
BAREBOX_CMD_HELP_OPT ("-a", "CDC ACM (default)\n")
|
BAREBOX_CMD_HELP_OPT ("-a", "CDC ACM (default)\n")
|
||||||
|
|
|
@ -353,7 +353,7 @@ config HUSH_FANCY_PROMPT
|
||||||
prompt "allow fancy hush prompts"
|
prompt "allow fancy hush prompts"
|
||||||
help
|
help
|
||||||
Allow to set PS1 from the command line. PS1 can have several escaped commands
|
Allow to set PS1 from the command line. PS1 can have several escaped commands
|
||||||
like \h for CONFIG_BOARDINFO or \w for the current working directory.
|
like \h for the 'model' string or \w for the current working directory.
|
||||||
|
|
||||||
config HUSH_GETOPT
|
config HUSH_GETOPT
|
||||||
bool
|
bool
|
||||||
|
|
|
@ -126,19 +126,19 @@ EXPORT_SYMBOL(perror);
|
||||||
void (*do_execute)(void *func, int argc, char *argv[]);
|
void (*do_execute)(void *func, int argc, char *argv[]);
|
||||||
EXPORT_SYMBOL(do_execute);
|
EXPORT_SYMBOL(do_execute);
|
||||||
|
|
||||||
static const char *boardinfo;
|
static const char *model;
|
||||||
|
|
||||||
const char *barebox_boardinfo(void)
|
const char *barebox_get_model(void)
|
||||||
{
|
{
|
||||||
if (boardinfo)
|
if (model)
|
||||||
return boardinfo;
|
return model;
|
||||||
|
|
||||||
boardinfo = of_get_model();
|
model = of_get_model();
|
||||||
if (boardinfo)
|
if (model)
|
||||||
boardinfo = xstrdup(boardinfo);
|
model = xstrdup(model);
|
||||||
else
|
else
|
||||||
boardinfo = CONFIG_BOARDINFO;
|
model = CONFIG_BOARDINFO;
|
||||||
|
|
||||||
return boardinfo;
|
return model;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(barebox_boardinfo);
|
EXPORT_SYMBOL(barebox_get_model);
|
||||||
|
|
|
@ -9,5 +9,5 @@ EXPORT_SYMBOL(version_string);
|
||||||
void barebox_banner (void)
|
void barebox_banner (void)
|
||||||
{
|
{
|
||||||
pr_info("\n\n%s\n\n", version_string);
|
pr_info("\n\n%s\n\n", version_string);
|
||||||
pr_info("Board: %s\n", barebox_boardinfo());
|
pr_info("Board: %s\n", barebox_get_model());
|
||||||
}
|
}
|
||||||
|
|
|
@ -234,7 +234,7 @@ void barebox_banner(void);
|
||||||
static inline void barebox_banner(void) {}
|
static inline void barebox_banner(void) {}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const char *barebox_boardinfo(void);
|
const char *barebox_get_model(void);
|
||||||
|
|
||||||
#define IOMEM(addr) ((void __force __iomem *)(addr))
|
#define IOMEM(addr) ((void __force __iomem *)(addr))
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ struct usb_dfu_dev {
|
||||||
|
|
||||||
struct usb_dfu_pdata {
|
struct usb_dfu_pdata {
|
||||||
char *manufacturer;
|
char *manufacturer;
|
||||||
char *productname;
|
const char *productname;
|
||||||
u16 idVendor;
|
u16 idVendor;
|
||||||
u16 idProduct;
|
u16 idProduct;
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
struct usb_serial_pdata {
|
struct usb_serial_pdata {
|
||||||
char *manufacturer;
|
char *manufacturer;
|
||||||
char *productname;
|
const char *productname;
|
||||||
u16 idVendor;
|
u16 idVendor;
|
||||||
u16 idProduct;
|
u16 idProduct;
|
||||||
int mode;
|
int mode;
|
||||||
|
|
|
@ -54,7 +54,7 @@ int process_escape_sequence(const char *source, char *dest, int destlen)
|
||||||
dest[i++] = 0x1b;
|
dest[i++] = 0x1b;
|
||||||
break;
|
break;
|
||||||
case 'h':
|
case 'h':
|
||||||
i += snprintf(dest + i, destlen - i, "%s", barebox_boardinfo());
|
i += snprintf(dest + i, destlen - i, "%s", barebox_get_model());
|
||||||
break;
|
break;
|
||||||
case 'w':
|
case 'w':
|
||||||
i += snprintf(dest + i, destlen - i, "%s", getcwd());
|
i += snprintf(dest + i, destlen - i, "%s", getcwd());
|
||||||
|
|
Loading…
Reference in New Issue