stand: uboot_fmtdev can be reduced to devformat
devformat produces the same output as uboot_fmtdev, so just use it to reduce on the dependencies. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D35926
This commit is contained in:
parent
1e9b23448a
commit
add8154e45
@ -160,29 +160,6 @@ uboot_parsedev(struct uboot_devdesc **dev, const char *devspec,
|
||||
}
|
||||
|
||||
|
||||
char *
|
||||
uboot_fmtdev(void *vdev)
|
||||
{
|
||||
struct uboot_devdesc *dev = (struct uboot_devdesc *)vdev;
|
||||
static char buf[128];
|
||||
|
||||
switch(dev->dd.d_dev->dv_type) {
|
||||
case DEVT_NONE:
|
||||
strcpy(buf, "(no device)");
|
||||
break;
|
||||
|
||||
case DEVT_DISK:
|
||||
#ifdef LOADER_DISK_SUPPORT
|
||||
return (disk_fmtdev(vdev));
|
||||
#endif
|
||||
|
||||
case DEVT_NET:
|
||||
sprintf(buf, "%s%d:", dev->dd.d_dev->dv_name, dev->dd.d_unit);
|
||||
break;
|
||||
}
|
||||
return(buf);
|
||||
}
|
||||
|
||||
/*
|
||||
* Set currdev to suit the value being supplied in (value).
|
||||
*/
|
||||
|
@ -50,7 +50,6 @@ struct uboot_devdesc {
|
||||
#endif
|
||||
|
||||
int uboot_getdev(void **vdev, const char *devspec, const char **path);
|
||||
char *uboot_fmtdev(void *vdev);
|
||||
int uboot_setcurrdev(struct env_var *ev, int flags, const void *value);
|
||||
|
||||
extern int devs_no;
|
||||
|
@ -533,7 +533,7 @@ main(int argc, char **argv)
|
||||
return (0xbadef1ce);
|
||||
}
|
||||
|
||||
ldev = uboot_fmtdev(&currdev);
|
||||
ldev = devformat(&currdev.dd);
|
||||
env_setenv("currdev", EV_VOLATILE, ldev, uboot_setcurrdev, env_nounset);
|
||||
env_setenv("loaddev", EV_VOLATILE, ldev, env_noset, env_nounset);
|
||||
printf("Booting from %s\n", ldev);
|
||||
|
Loading…
Reference in New Issue
Block a user