svn commit: r275460 - in head/sys: kern sys

John Baldwin jhb at FreeBSD.org
Wed Dec 3 15:29:54 UTC 2014


Author: jhb
Date: Wed Dec  3 15:29:53 2014
New Revision: 275460
URL: https://svnweb.freebsd.org/changeset/base/275460

Log:
  Revert device_getenv_int() for now as it duplicates resource_int_value().
  We should perhaps implement a device_getenv_*() and device_setenv_*() API
  as a convenience wrapper on top of resource_*_value() and resource_set_*().

Modified:
  head/sys/kern/subr_bus.c
  head/sys/sys/bus.h

Modified: head/sys/kern/subr_bus.c
==============================================================================
--- head/sys/kern/subr_bus.c	Wed Dec  3 15:19:38 2014	(r275459)
+++ head/sys/kern/subr_bus.c	Wed Dec  3 15:29:53 2014	(r275460)
@@ -56,8 +56,6 @@ __FBSDID("$FreeBSD$");
 #include <sys/interrupt.h>
 #include <sys/cpuset.h>
 
-#include <sys/syslog.h>
-
 #include <net/vnet.h>
 
 #include <machine/cpu.h>
@@ -5033,18 +5031,3 @@ bus_free_resource(device_t dev, int type
 		return (0);
 	return (bus_release_resource(dev, type, rman_get_rid(r), r));
 }
-
-int
-device_getenv_int(device_t dev, const char *knob, int *iptr)
-{
-	char env[128];
-	int sz;
-
-	sz = snprintf(env, sizeof(env), "hw.%s.%d.%s", device_get_name(dev), device_get_unit(dev), knob);
-	if (sz >= sizeof(env)) {
-		/* XXX: log? return error? bump sysctl error? */
-		log(LOG_ERR, "device_getenv_int: knob too long: '%s'", knob);
-		return 0;
-	}
-	return (getenv_int(env, iptr));
-}

Modified: head/sys/sys/bus.h
==============================================================================
--- head/sys/sys/bus.h	Wed Dec  3 15:19:38 2014	(r275459)
+++ head/sys/sys/bus.h	Wed Dec  3 15:29:53 2014	(r275460)
@@ -449,7 +449,6 @@ const	char *device_get_nameunit(device_t
 void	*device_get_softc(device_t dev);
 device_state_t	device_get_state(device_t dev);
 int	device_get_unit(device_t dev);
-int	device_getenv_int(device_t dev, const char *knob, int *iptr);
 struct sysctl_ctx_list *device_get_sysctl_ctx(device_t dev);
 struct sysctl_oid *device_get_sysctl_tree(device_t dev);
 int	device_is_alive(device_t dev);	/* did probe succeed? */


More information about the svn-src-head mailing list