No need to pass interface attribute or locators to config_found().diff -r1.7.4.2 -r1.7.4.3 src/sys/dev/pci/mfii.c
(thorpej)
--- src/sys/dev/pci/mfii.c 2021/03/22 16:23:45 1.7.4.2
+++ src/sys/dev/pci/mfii.c 2021/03/28 20:41:04 1.7.4.3
@@ -1,35 +1,35 @@ | @@ -1,35 +1,35 @@ | |||
1 | /* $NetBSD: mfii.c,v 1.7.4.2 2021/03/22 16:23:45 thorpej Exp $ */ | 1 | /* $NetBSD: mfii.c,v 1.7.4.3 2021/03/28 20:41:04 thorpej Exp $ */ | |
2 | /* $OpenBSD: mfii.c,v 1.58 2018/08/14 05:22:21 jmatthew Exp $ */ | 2 | /* $OpenBSD: mfii.c,v 1.58 2018/08/14 05:22:21 jmatthew Exp $ */ | |
3 | 3 | |||
4 | /* | 4 | /* | |
5 | * Copyright (c) 2018 Manuel Bouyer <Manuel.Bouyer@lip6.fr> | 5 | * Copyright (c) 2018 Manuel Bouyer <Manuel.Bouyer@lip6.fr> | |
6 | * Copyright (c) 2012 David Gwynne <dlg@openbsd.org> | 6 | * Copyright (c) 2012 David Gwynne <dlg@openbsd.org> | |
7 | * | 7 | * | |
8 | * Permission to use, copy, modify, and distribute this software for any | 8 | * Permission to use, copy, modify, and distribute this software for any | |
9 | * purpose with or without fee is hereby granted, provided that the above | 9 | * purpose with or without fee is hereby granted, provided that the above | |
10 | * copyright notice and this permission notice appear in all copies. | 10 | * copyright notice and this permission notice appear in all copies. | |
11 | * | 11 | * | |
12 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | 12 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
13 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | 13 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
14 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | 14 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
15 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | 15 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
16 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | 16 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | |
17 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | 17 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | |
18 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 18 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
19 | */ | 19 | */ | |
20 | 20 | |||
21 | #include <sys/cdefs.h> | 21 | #include <sys/cdefs.h> | |
22 | __KERNEL_RCSID(0, "$NetBSD: mfii.c,v 1.7.4.2 2021/03/22 16:23:45 thorpej Exp $"); | 22 | __KERNEL_RCSID(0, "$NetBSD: mfii.c,v 1.7.4.3 2021/03/28 20:41:04 thorpej Exp $"); | |
23 | 23 | |||
24 | #include "bio.h" | 24 | #include "bio.h" | |
25 | 25 | |||
26 | #include <sys/atomic.h> | 26 | #include <sys/atomic.h> | |
27 | #include <sys/param.h> | 27 | #include <sys/param.h> | |
28 | #include <sys/systm.h> | 28 | #include <sys/systm.h> | |
29 | #include <sys/buf.h> | 29 | #include <sys/buf.h> | |
30 | #include <sys/ioctl.h> | 30 | #include <sys/ioctl.h> | |
31 | #include <sys/device.h> | 31 | #include <sys/device.h> | |
32 | #include <sys/kernel.h> | 32 | #include <sys/kernel.h> | |
33 | #include <sys/proc.h> | 33 | #include <sys/proc.h> | |
34 | #include <sys/cpu.h> | 34 | #include <sys/cpu.h> | |
35 | #include <sys/conf.h> | 35 | #include <sys/conf.h> | |
@@ -978,33 +978,31 @@ mfii_detach(device_t self, int flags) | @@ -978,33 +978,31 @@ mfii_detach(device_t self, int flags) | |||
978 | mfii_dmamem_free(sc, sc->sc_mfi); | 978 | mfii_dmamem_free(sc, sc->sc_mfi); | |
979 | mfii_dmamem_free(sc, sc->sc_requests); | 979 | mfii_dmamem_free(sc, sc->sc_requests); | |
980 | mfii_dmamem_free(sc, sc->sc_reply_postq); | 980 | mfii_dmamem_free(sc, sc->sc_reply_postq); | |
981 | mfii_dmamem_free(sc, sc->sc_sense); | 981 | mfii_dmamem_free(sc, sc->sc_sense); | |
982 | bus_space_unmap(sc->sc_iot, sc->sc_ioh, sc->sc_ios); | 982 | bus_space_unmap(sc->sc_iot, sc->sc_ioh, sc->sc_ios); | |
983 | 983 | |||
984 | return (0); | 984 | return (0); | |
985 | } | 985 | } | |
986 | 986 | |||
987 | static int | 987 | static int | |
988 | mfii_rescan(device_t self, const char *ifattr, const int *locators) | 988 | mfii_rescan(device_t self, const char *ifattr, const int *locators) | |
989 | { | 989 | { | |
990 | struct mfii_softc *sc = device_private(self); | 990 | struct mfii_softc *sc = device_private(self); | |
991 | ||||
991 | if (sc->sc_child != NULL) | 992 | if (sc->sc_child != NULL) | |
992 | return 0; | 993 | return 0; | |
993 | 994 | |||
994 | sc->sc_child = config_found(self, &sc->sc_chan, scsiprint, | 995 | sc->sc_child = config_found(self, &sc->sc_chan, scsiprint, CFARG_EOL); | |
995 | CFARG_IATTR, ifattr, | |||
996 | CFARG_LOCATORS, locators, | |||
997 | CFARG_EOL); | |||
998 | return 0; | 996 | return 0; | |
999 | } | 997 | } | |
1000 | 998 | |||
1001 | static void | 999 | static void | |
1002 | mfii_childdetached(device_t self, device_t child) | 1000 | mfii_childdetached(device_t self, device_t child) | |
1003 | { | 1001 | { | |
1004 | struct mfii_softc *sc = device_private(self); | 1002 | struct mfii_softc *sc = device_private(self); | |
1005 | 1003 | |||
1006 | KASSERT(self == sc->sc_dev); | 1004 | KASSERT(self == sc->sc_dev); | |
1007 | KASSERT(child == sc->sc_child); | 1005 | KASSERT(child == sc->sc_child); | |
1008 | 1006 | |||
1009 | if (child == sc->sc_child) | 1007 | if (child == sc->sc_child) | |
1010 | sc->sc_child = NULL; | 1008 | sc->sc_child = NULL; |
--- src/sys/dev/pci/mpii.c 2021/03/22 16:23:45 1.27.2.2
+++ src/sys/dev/pci/mpii.c 2021/03/28 20:41:04 1.27.2.3
@@ -1,36 +1,36 @@ | @@ -1,36 +1,36 @@ | |||
1 | /* $NetBSD: mpii.c,v 1.27.2.2 2021/03/22 16:23:45 thorpej Exp $ */ | 1 | /* $NetBSD: mpii.c,v 1.27.2.3 2021/03/28 20:41:04 thorpej Exp $ */ | |
2 | /* $OpenBSD: mpii.c,v 1.115 2018/08/14 05:22:21 jmatthew Exp $ */ | 2 | /* $OpenBSD: mpii.c,v 1.115 2018/08/14 05:22:21 jmatthew Exp $ */ | |
3 | /* | 3 | /* | |
4 | * Copyright (c) 2010, 2012 Mike Belopuhov | 4 | * Copyright (c) 2010, 2012 Mike Belopuhov | |
5 | * Copyright (c) 2009 James Giannoules | 5 | * Copyright (c) 2009 James Giannoules | |
6 | * Copyright (c) 2005 - 2010 David Gwynne <dlg@openbsd.org> | 6 | * Copyright (c) 2005 - 2010 David Gwynne <dlg@openbsd.org> | |
7 | * Copyright (c) 2005 - 2010 Marco Peereboom <marco@openbsd.org> | 7 | * Copyright (c) 2005 - 2010 Marco Peereboom <marco@openbsd.org> | |
8 | * | 8 | * | |
9 | * Permission to use, copy, modify, and distribute this software for any | 9 | * Permission to use, copy, modify, and distribute this software for any | |
10 | * purpose with or without fee is hereby granted, provided that the above | 10 | * purpose with or without fee is hereby granted, provided that the above | |
11 | * copyright notice and this permission notice appear in all copies. | 11 | * copyright notice and this permission notice appear in all copies. | |
12 | * | 12 | * | |
13 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | 13 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
14 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | 14 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
15 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | 15 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
16 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | 16 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
17 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | 17 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | |
18 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | 18 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | |
19 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 19 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
20 | */ | 20 | */ | |
21 | 21 | |||
22 | #include <sys/cdefs.h> | 22 | #include <sys/cdefs.h> | |
23 | __KERNEL_RCSID(0, "$NetBSD: mpii.c,v 1.27.2.2 2021/03/22 16:23:45 thorpej Exp $"); | 23 | __KERNEL_RCSID(0, "$NetBSD: mpii.c,v 1.27.2.3 2021/03/28 20:41:04 thorpej Exp $"); | |
24 | 24 | |||
25 | #include "bio.h" | 25 | #include "bio.h" | |
26 | 26 | |||
27 | #include <sys/param.h> | 27 | #include <sys/param.h> | |
28 | #include <sys/systm.h> | 28 | #include <sys/systm.h> | |
29 | #include <sys/buf.h> | 29 | #include <sys/buf.h> | |
30 | #include <sys/device.h> | 30 | #include <sys/device.h> | |
31 | #include <sys/ioctl.h> | 31 | #include <sys/ioctl.h> | |
32 | #include <sys/malloc.h> | 32 | #include <sys/malloc.h> | |
33 | #include <sys/kernel.h> | 33 | #include <sys/kernel.h> | |
34 | #include <sys/mutex.h> | 34 | #include <sys/mutex.h> | |
35 | #include <sys/condvar.h> | 35 | #include <sys/condvar.h> | |
36 | #include <sys/dkio.h> | 36 | #include <sys/dkio.h> | |
@@ -716,30 +716,27 @@ mpii_detach(device_t self, int flags) | @@ -716,30 +716,27 @@ mpii_detach(device_t self, int flags) | |||
716 | } | 716 | } | |
717 | 717 | |||
718 | return (0); | 718 | return (0); | |
719 | } | 719 | } | |
720 | 720 | |||
721 | static int | 721 | static int | |
722 | mpii_rescan(device_t self, const char *ifattr, const int *locators) | 722 | mpii_rescan(device_t self, const char *ifattr, const int *locators) | |
723 | { | 723 | { | |
724 | struct mpii_softc *sc = device_private(self); | 724 | struct mpii_softc *sc = device_private(self); | |
725 | 725 | |||
726 | if (sc->sc_child != NULL) | 726 | if (sc->sc_child != NULL) | |
727 | return 0; | 727 | return 0; | |
728 | 728 | |||
729 | sc->sc_child = config_found(self, &sc->sc_chan, scsiprint, | 729 | sc->sc_child = config_found(self, &sc->sc_chan, scsiprint, CFARG_EOL); | |
730 | CFARG_IATTR, ifattr, | |||
731 | CFARG_LOCATORS, locators, | |||
732 | CFARG_EOL); | |||
733 | 730 | |||
734 | return 0; | 731 | return 0; | |
735 | } | 732 | } | |
736 | 733 | |||
737 | static void | 734 | static void | |
738 | mpii_childdetached(device_t self, device_t child) | 735 | mpii_childdetached(device_t self, device_t child) | |
739 | { | 736 | { | |
740 | struct mpii_softc *sc = device_private(self); | 737 | struct mpii_softc *sc = device_private(self); | |
741 | 738 | |||
742 | KASSERT(self == sc->sc_dev); | 739 | KASSERT(self == sc->sc_dev); | |
743 | KASSERT(child == sc->sc_child); | 740 | KASSERT(child == sc->sc_child); | |
744 | 741 | |||
745 | if (child == sc->sc_child) | 742 | if (child == sc->sc_child) |