diff options
author | Patrick Wildt <patrick@cvs.openbsd.org> | 2013-04-25 23:07:18 +0000 |
---|---|---|
committer | Patrick Wildt <patrick@cvs.openbsd.org> | 2013-04-25 23:07:18 +0000 |
commit | b5fd3ca25b0a8e55727ca5ae0c5662d78c88544a (patch) | |
tree | 83da27a61341ad6b47c14e3f0309ab1a29b6a032 | |
parent | f63894cf293cf0914a77d1f72b445faa23f607f8 (diff) |
Add a terminator to the device list, so that we don't end up having
unexpected behaviour when a device isn't found.
ok bmercer@
-rw-r--r-- | sys/arch/beagle/dev/omap.c | 6 | ||||
-rw-r--r-- | sys/arch/beagle/dev/omap3.c | 9 | ||||
-rw-r--r-- | sys/arch/beagle/dev/omap4.c | 8 |
3 files changed, 18 insertions, 5 deletions
diff --git a/sys/arch/beagle/dev/omap.c b/sys/arch/beagle/dev/omap.c index aa8307cb29c..62e6ac8557b 100644 --- a/sys/arch/beagle/dev/omap.c +++ b/sys/arch/beagle/dev/omap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: omap.c,v 1.3 2011/11/15 23:01:11 drahn Exp $ */ +/* $OpenBSD: omap.c,v 1.4 2013/04/25 23:07:17 patrick Exp $ */ /* * Copyright (c) 2005,2008 Dale Rahn <drahn@openbsd.com> * @@ -155,9 +155,11 @@ omap_attach(struct device *parent, struct device *self, void *aux) struct omap_dev *od = omap_find_dev(bd->name, bd->unit); struct omap_attach_args oa; - if (od == NULL) + if (od == NULL) { printf("%s: device %s unit %d not found\n", self->dv_xname, bd->name, bd->unit); + continue; + } memset(&oa, 0, sizeof(oa)); oa.oa_dev = od; diff --git a/sys/arch/beagle/dev/omap3.c b/sys/arch/beagle/dev/omap3.c index 9f4eb842d50..a1e47ff22dd 100644 --- a/sys/arch/beagle/dev/omap3.c +++ b/sys/arch/beagle/dev/omap3.c @@ -1,4 +1,4 @@ -/* $OpenBSD: omap3.c,v 1.4 2011/11/10 23:43:01 uwe Exp $ */ +/* $OpenBSD: omap3.c,v 1.5 2013/04/25 23:07:17 patrick Exp $ */ /* * Copyright (c) 2011 Uwe Stuehler <uwe@openbsd.org> @@ -17,6 +17,8 @@ */ #include <sys/types.h> +#include <sys/param.h> + #include <machine/bus.h> #include <beagle/dev/omapvar.h> @@ -179,6 +181,11 @@ struct omap_dev omap3_devs[] = { { .name = "omusbtll", .unit = 0, .mem = { { USBTLL_ADDR, USBTLL_SIZE } }, + }, + + /* Terminator */ + { .name = NULL, + .unit = 0, } }; diff --git a/sys/arch/beagle/dev/omap4.c b/sys/arch/beagle/dev/omap4.c index 12299a6cc7d..e2b6779a7fa 100644 --- a/sys/arch/beagle/dev/omap4.c +++ b/sys/arch/beagle/dev/omap4.c @@ -1,4 +1,4 @@ -/* $OpenBSD: omap4.c,v 1.5 2011/11/15 23:01:11 drahn Exp $ */ +/* $OpenBSD: omap4.c,v 1.6 2013/04/25 23:07:17 patrick Exp $ */ /* * Copyright (c) 2011 Uwe Stuehler <uwe@openbsd.org> @@ -155,8 +155,12 @@ struct omap_dev omap4_devs[] = { .unit = 0, .mem = { { HSMMC1_ADDR, HSMMCx_SIZE } }, .irq = { HSMMC1_IRQ } - } + }, + /* Terminator */ + { .name = NULL, + .unit = 0, + } }; void |