git: 7fe4c7b59e03 - stable/13 - acpi_toshiba: Use device_get_softc in attach.

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Fri, 20 May 2022 00:20:59 UTC
The branch stable/13 has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=7fe4c7b59e030e81dc1227ff649176e99f6de9c9

commit 7fe4c7b59e030e81dc1227ff649176e99f6de9c9
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2022-04-21 17:29:15 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2022-05-19 21:33:09 +0000

    acpi_toshiba: Use device_get_softc in attach.
    
    Rather than a detour via the devclass and hardcoding unit 0.
    
    While here, remove a check for sc being NULL.  It will never be NULL
    when attach is called.
    
    Reviewed by:    imp
    Differential Revision:  https://reviews.freebsd.org/D35010
    
    (cherry picked from commit 1ac10fa429370731be57dee76b19896e01764b76)
---
 sys/dev/acpi_support/acpi_toshiba.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/sys/dev/acpi_support/acpi_toshiba.c b/sys/dev/acpi_support/acpi_toshiba.c
index c5233579d560..208cc36c9a59 100644
--- a/sys/dev/acpi_support/acpi_toshiba.c
+++ b/sys/dev/acpi_support/acpi_toshiba.c
@@ -562,9 +562,7 @@ acpi_toshiba_video_attach(device_t dev)
 {
 	struct		acpi_toshiba_softc *sc;
 
-	sc = devclass_get_softc(acpi_toshiba_devclass, 0);
-	if (sc == NULL)
-		return (ENXIO);
+	sc = device_get_softc(dev);
 	sc->video_handle = acpi_get_handle(dev);
 	return (0);
 }