Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 1 Dec 2024 04:57:48 GMT
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: 191ed65ad2ce - stable/13 - cpufreq: Use a real device_probe routine
Message-ID:  <202412010457.4B14vm6F096980@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=191ed65ad2ce1b96361b2d05862b9745f9cdcec6

commit 191ed65ad2ce1b96361b2d05862b9745f9cdcec6
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2024-10-21 14:24:15 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2024-11-30 21:34:41 +0000

    cpufreq: Use a real device_probe routine
    
    cpufreq doesn't have any child drivers, so calling bus_generic_probe
    was a nop.
    
    Reviewed by:    imp
    Differential Revision:  https://reviews.freebsd.org/D47184
    
    (cherry picked from commit ce968b095e75262ba3605491acf6850ce331481d)
---
 sys/kern/kern_cpu.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/sys/kern/kern_cpu.c b/sys/kern/kern_cpu.c
index 8d7d9b59bd07..04a9b2ac6c44 100644
--- a/sys/kern/kern_cpu.c
+++ b/sys/kern/kern_cpu.c
@@ -98,6 +98,7 @@ TAILQ_HEAD(cf_setting_lst, cf_setting_array);
 		printf("cpufreq: " msg);	\
 	} while (0)
 
+static int	cpufreq_probe(device_t dev);
 static int	cpufreq_attach(device_t dev);
 static void	cpufreq_startup_task(void *ctx, int pending);
 static int	cpufreq_detach(device_t dev);
@@ -117,7 +118,7 @@ static int	cpufreq_levels_sysctl(SYSCTL_HANDLER_ARGS);
 static int	cpufreq_settings_sysctl(SYSCTL_HANDLER_ARGS);
 
 static device_method_t cpufreq_methods[] = {
-	DEVMETHOD(device_probe,		bus_generic_probe),
+	DEVMETHOD(device_probe,		cpufreq_probe),
 	DEVMETHOD(device_attach,	cpufreq_attach),
 	DEVMETHOD(device_detach,	cpufreq_detach),
 
@@ -141,6 +142,13 @@ SYSCTL_INT(_debug_cpufreq, OID_AUTO, lowest, CTLFLAG_RWTUN, &cf_lowest_freq, 1,
 SYSCTL_INT(_debug_cpufreq, OID_AUTO, verbose, CTLFLAG_RWTUN, &cf_verbose, 1,
     "Print verbose debugging messages");
 
+static int
+cpufreq_probe(device_t dev)
+{
+	device_set_desc(dev, "CPU frequency control");
+	return (BUS_PROBE_DEFAULT);
+}
+
 /*
  * This is called as the result of a hardware specific frequency control driver
  * calling cpufreq_register. It provides a general interface for system wide



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202412010457.4B14vm6F096980>