git: 00f79c97a4f2 - main - cam_periph: Remove vestigial "scbus" comparison

From: Warner Losh <imp_at_FreeBSD.org>
Date: Fri, 05 Nov 2021 15:25:36 UTC
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=00f79c97a4f265f8d653a11fdb764cd999b7d0a9

commit 00f79c97a4f265f8d653a11fdb764cd999b7d0a9
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2021-11-05 14:56:13 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2021-11-05 14:56:13 +0000

    cam_periph: Remove vestigial "scbus" comparison
    
    The code in camperiphunit rejects "scbus" as an 'at' location that would
    allow any other wiring to use that unit number. Yet in
    camperiphunitnext, if we have a no target and the 'at' location of
    'scbus' it would be excluded on the basis that it's a wiring
    cadidate. This is improper and appears to be a hold-over of the
    pre-hints / pre-newbus config system, so remove it.
    
    Sponsored by:           Netflix
    Differential Revision:  https://reviews.freebsd.org/D32680
---
 sys/cam/cam_periph.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c
index d8fd41d77be7..990854f992c3 100644
--- a/sys/cam/cam_periph.c
+++ b/sys/cam/cam_periph.c
@@ -568,9 +568,10 @@ camperiphnextunit(struct periph_driver *p_drv, u_int newunit, int wired,
 			break;
 
 		/*
-		 * Don't match entries like "da 4" as a wired down
-		 * device, but do match entries like "da 4 target 5"
-		 * or even "da 4 scbus 1". 
+		 * Don't allow the mere presence of any attributes of a device
+		 * means that it is for a wired down entry. Instead, insist that
+		 * one of the matching criteria from camperiphunit be present
+		 * for the device.
 		 */
 		i = 0;
 		dname = periph_name;
@@ -580,8 +581,7 @@ camperiphnextunit(struct periph_driver *p_drv, u_int newunit, int wired,
 				break;
 			/* if no "target" and no specific scbus, skip */
 			if (resource_int_value(dname, dunit, "target", &val) &&
-			    (resource_string_value(dname, dunit, "at",&strval)||
-			     strcmp(strval, "scbus") == 0))
+			    resource_string_value(dname, dunit, "at",&strval))
 				continue;
 			if (newunit == dunit)
 				break;