aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2022-08-11 15:08:52 +0000
committerWarner Losh <imp@FreeBSD.org>2022-08-11 16:27:17 +0000
commitadd8154e451f441778fb9c2fb7d10d281dea9611 (patch)
tree808739bda393b7c66526fb1adc6a3bdc285be969
parent1e9b23448a3010e8403eae08ad890fe1eb75da8b (diff)
downloadsrc-add8154e451f441778fb9c2fb7d10d281dea9611.tar.gz
src-add8154e451f441778fb9c2fb7d10d281dea9611.zip
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
-rw-r--r--stand/uboot/devicename.c23
-rw-r--r--stand/uboot/libuboot.h1
-rw-r--r--stand/uboot/main.c2
3 files changed, 1 insertions, 25 deletions
diff --git a/stand/uboot/devicename.c b/stand/uboot/devicename.c
index b6b0e6e40639..b73a7694f14a 100644
--- a/stand/uboot/devicename.c
+++ b/stand/uboot/devicename.c
@@ -160,29 +160,6 @@ fail:
}
-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).
*/
diff --git a/stand/uboot/libuboot.h b/stand/uboot/libuboot.h
index 18a12c216d7e..b9039bcf7fdf 100644
--- a/stand/uboot/libuboot.h
+++ b/stand/uboot/libuboot.h
@@ -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;
diff --git a/stand/uboot/main.c b/stand/uboot/main.c
index 6648dc607c11..573995663fe4 100644
--- a/stand/uboot/main.c
+++ b/stand/uboot/main.c
@@ -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);