Add a new optional function device_register_post_config(), symmetric to

device register, called after config is done with a device.
Only used if an arch defines  __HAVE_DEVICE_REGISTER_POSTCONFIG.
This commit is contained in:
martin 2010-01-10 13:42:34 +00:00
parent fefe0aff38
commit 693845d2c3
2 changed files with 18 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: subr_autoconf.c,v 1.195 2010/01/08 20:07:14 dyoung Exp $ */
/* $NetBSD: subr_autoconf.c,v 1.196 2010/01/10 13:42:34 martin Exp $ */
/*
* Copyright (c) 1996, 2000 Christopher G. Demetriou
@ -77,7 +77,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: subr_autoconf.c,v 1.195 2010/01/08 20:07:14 dyoung Exp $");
__KERNEL_RCSID(0, "$NetBSD: subr_autoconf.c,v 1.196 2010/01/10 13:42:34 martin Exp $");
#ifdef _KERNEL_OPT
#include "opt_ddb.h"
@ -1308,6 +1308,10 @@ config_attach_loc(device_t parent, cfdata_t cf,
aprint_debug_dev(dev, "WARNING: power management not supported\n");
config_process_deferred(&deferred_config_queue, dev);
#ifdef __HAVE_DEVICE_REGISTER_POSTCONFIG
device_register_post_config(dev, aux);
#endif
return dev;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: rump_dev.c,v 1.10 2010/01/09 16:32:57 pooka Exp $ */
/* $NetBSD: rump_dev.c,v 1.11 2010/01/10 13:42:34 martin Exp $ */
/*
* Copyright (c) 2009 Antti Kantee. All Rights Reserved.
@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rump_dev.c,v 1.10 2010/01/09 16:32:57 pooka Exp $");
__KERNEL_RCSID(0, "$NetBSD: rump_dev.c,v 1.11 2010/01/10 13:42:34 martin Exp $");
#include <sys/param.h>
#include <sys/device.h>
@ -92,3 +92,13 @@ device_register(struct device *dev, void *v)
/* nada */
}
#endif
#ifdef __HAVE_DEVICE_REGISTER_POSTCONFIG
void
device_register_post_config(struct device *dev, void *v)
{
/* nada */
}
#endif