mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 12:54:27 +00:00
proto: Use device_set_descf()
No functional change intended. MFC after: 1 week
This commit is contained in:
parent
66d2d42a1f
commit
542f9494b7
|
@ -32,7 +32,6 @@
|
||||||
#include <machine/bus.h>
|
#include <machine/bus.h>
|
||||||
#include <sys/rman.h>
|
#include <sys/rman.h>
|
||||||
#include <machine/resource.h>
|
#include <machine/resource.h>
|
||||||
#include <sys/sbuf.h>
|
|
||||||
|
|
||||||
#include <isa/isavar.h>
|
#include <isa/isavar.h>
|
||||||
#include <isa/pnpvar.h>
|
#include <isa/pnpvar.h>
|
||||||
|
@ -62,7 +61,6 @@ static char **proto_isa_devnames;
|
||||||
static int
|
static int
|
||||||
proto_isa_probe(device_t dev)
|
proto_isa_probe(device_t dev)
|
||||||
{
|
{
|
||||||
struct sbuf *sb;
|
|
||||||
struct resource *res;
|
struct resource *res;
|
||||||
int rid, type;
|
int rid, type;
|
||||||
|
|
||||||
|
@ -76,11 +74,7 @@ proto_isa_probe(device_t dev)
|
||||||
if (res == NULL)
|
if (res == NULL)
|
||||||
return (ENODEV);
|
return (ENODEV);
|
||||||
|
|
||||||
sb = sbuf_new_auto();
|
device_set_descf(dev, "%s:%#jx", proto_isa_prefix, rman_get_start(res));
|
||||||
sbuf_printf(sb, "%s:%#jx", proto_isa_prefix, rman_get_start(res));
|
|
||||||
sbuf_finish(sb);
|
|
||||||
device_set_desc_copy(dev, sbuf_data(sb));
|
|
||||||
sbuf_delete(sb);
|
|
||||||
bus_release_resource(dev, type, rid, res);
|
bus_release_resource(dev, type, rid, res);
|
||||||
return (proto_probe(dev, proto_isa_prefix, &proto_isa_devnames));
|
return (proto_probe(dev, proto_isa_prefix, &proto_isa_devnames));
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,6 @@
|
||||||
#include <machine/bus.h>
|
#include <machine/bus.h>
|
||||||
#include <sys/rman.h>
|
#include <sys/rman.h>
|
||||||
#include <machine/resource.h>
|
#include <machine/resource.h>
|
||||||
#include <sys/sbuf.h>
|
|
||||||
|
|
||||||
#include <dev/pci/pcireg.h>
|
#include <dev/pci/pcireg.h>
|
||||||
#include <dev/pci/pcivar.h>
|
#include <dev/pci/pcivar.h>
|
||||||
|
@ -62,17 +61,12 @@ static char **proto_pci_devnames;
|
||||||
static int
|
static int
|
||||||
proto_pci_probe(device_t dev)
|
proto_pci_probe(device_t dev)
|
||||||
{
|
{
|
||||||
struct sbuf *sb;
|
|
||||||
|
|
||||||
if ((pci_read_config(dev, PCIR_HDRTYPE, 1) & PCIM_HDRTYPE) != 0)
|
if ((pci_read_config(dev, PCIR_HDRTYPE, 1) & PCIM_HDRTYPE) != 0)
|
||||||
return (ENXIO);
|
return (ENXIO);
|
||||||
|
|
||||||
sb = sbuf_new_auto();
|
device_set_descf(dev, "%s%d:%d:%d:%d", proto_pci_prefix,
|
||||||
sbuf_printf(sb, "%s%d:%d:%d:%d", proto_pci_prefix, pci_get_domain(dev),
|
pci_get_domain(dev), pci_get_bus(dev), pci_get_slot(dev),
|
||||||
pci_get_bus(dev), pci_get_slot(dev), pci_get_function(dev));
|
pci_get_function(dev));
|
||||||
sbuf_finish(sb);
|
|
||||||
device_set_desc_copy(dev, sbuf_data(sb));
|
|
||||||
sbuf_delete(sb);
|
|
||||||
return (proto_probe(dev, proto_pci_prefix, &proto_pci_devnames));
|
return (proto_probe(dev, proto_pci_prefix, &proto_pci_devnames));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue