Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Apr 2026 17:55:52 +0000
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 2df675298a99 - stable/15 - sdhci_fdt_rockchip: Move ofw_bus_status_okay check
Message-ID:  <69ebaea8.1e131.563b5c28@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch stable/15 has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=2df675298a99cb7c77962e6a13f8f01de50aeaa2

commit 2df675298a99cb7c77962e6a13f8f01de50aeaa2
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2026-02-09 16:27:04 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2026-04-24 15:33:06 +0000

    sdhci_fdt_rockchip: Move ofw_bus_status_okay check
    
    This fixes a warning from GCC:
    
    sys/dev/sdhci/sdhci_fdt_rockchip.c: In function 'sdhci_fdt_rockchip_probe':
    sys/dev/sdhci/sdhci_fdt_rockchip.c:120:14: error: statement will never be executed [-Werror=switch-unreachable]
      120 |         if (!ofw_bus_status_okay(dev))
          |              ^~~~~~~~~~~~~~~~~~~~~~~~
    
    Reviewed by:    bnovkov, imp, emaste
    Differential Revision:  https://reviews.freebsd.org/D55158
    
    (cherry picked from commit efdd30c94e0ac4007b52b6f40afdab52fecf2aa5)
---
 sys/dev/sdhci/sdhci_fdt_rockchip.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sys/dev/sdhci/sdhci_fdt_rockchip.c b/sys/dev/sdhci/sdhci_fdt_rockchip.c
index 44a5e2ffe271..79d299f75fb4 100644
--- a/sys/dev/sdhci/sdhci_fdt_rockchip.c
+++ b/sys/dev/sdhci/sdhci_fdt_rockchip.c
@@ -116,9 +116,10 @@ sdhci_fdt_rockchip_probe(device_t dev)
 	struct sdhci_fdt_softc *sc = device_get_softc(dev);
 
 	sc->quirks = 0;
-	switch (ofw_bus_search_compatible(dev, compat_data)->ocd_data) {
 	if (!ofw_bus_status_okay(dev))
 		return (ENXIO);
+
+	switch (ofw_bus_search_compatible(dev, compat_data)->ocd_data) {
 	case SDHCI_FDT_RK3399:
 		device_set_desc(dev, "Rockchip RK3399 fdt SDHCI controller");
 		break;


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69ebaea8.1e131.563b5c28>