Module Name: src Committed By: pgoyette Date: Fri Jun 22 09:06:04 UTC 2018
Modified Files: src/sys/dev/ata: ata_raid.c Log Message: Call config_cfattach_attach() regardless of whether the module is being built as part of a kernel or as a external module. Addresses kern/53389 - thanks for the report! XXX pullup-8 To generate a diff of this commit: cvs rdiff -u -r1.39 -r1.40 src/sys/dev/ata/ata_raid.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/ata/ata_raid.c diff -u src/sys/dev/ata/ata_raid.c:1.39 src/sys/dev/ata/ata_raid.c:1.40 --- src/sys/dev/ata/ata_raid.c:1.39 Tue Sep 27 08:05:34 2016 +++ src/sys/dev/ata/ata_raid.c Fri Jun 22 09:06:04 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: ata_raid.c,v 1.39 2016/09/27 08:05:34 pgoyette Exp $ */ +/* $NetBSD: ata_raid.c,v 1.40 2018/06/22 09:06:04 pgoyette Exp $ */ /* * Copyright (c) 2003 Wasabi Systems, Inc. @@ -40,7 +40,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ata_raid.c,v 1.39 2016/09/27 08:05:34 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ata_raid.c,v 1.40 2018/06/22 09:06:04 pgoyette Exp $"); #include <sys/param.h> #include <sys/buf.h> @@ -338,26 +338,27 @@ ataraid_modcmd(modcmd_t cmd, void *arg) error = config_cfdriver_attach(&ataraid_cd); if (error) break; +#endif error = config_cfattach_attach(ataraid_cd.cd_name, &ataraid_ca); if (error) { +#ifdef _MODULE config_cfdriver_detach(&ataraid_cd); +#endif aprint_error("%s: unable to register cfattach for \n" "%s, error %d", __func__, ataraid_cd.cd_name, error); break; } -#endif break; case MODULE_CMD_FINI: -#ifdef _MODULE - error = config_cfattach_detach(ataraid_cd.cd_name, &ataraid_ca); if (error) { aprint_error("%s: failed to detach %s cfattach, " "error %d\n", __func__, ataraid_cd.cd_name, error); break; } +#ifdef _MODULE error = config_cfdriver_detach(&ataraid_cd); if (error) { (void)config_cfattach_attach(ataraid_cd.cd_name,