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_*().
This commit is contained in:
parent
f9477570ec
commit
b10c08a52b
@ -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, struct resource *r)
|
||||
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));
|
||||
}
|
||||
|
@ -449,7 +449,6 @@ const char *device_get_nameunit(device_t dev);
|
||||
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? */
|
||||
|
Loading…
x
Reference in New Issue
Block a user