git: 4fcaee7a5f4a - stable/14 - bxe: Use device_set_descf()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 27 Jun 2024 15:31:08 UTC
The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=4fcaee7a5f4ac12aeb9513755a816bd5b2953fa3 commit 4fcaee7a5f4ac12aeb9513755a816bd5b2953fa3 Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2024-06-05 19:24:16 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2024-06-27 15:27:41 +0000 bxe: Use device_set_descf() No functional change intended. MFC after: 1 week (cherry picked from commit 9da1b6dc161bfd7b494ba472cde33af49ef8196f) --- sys/dev/bxe/bxe.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/sys/dev/bxe/bxe.c b/sys/dev/bxe/bxe.c index 86e396bad4ae..8524deeb354e 100644 --- a/sys/dev/bxe/bxe.c +++ b/sys/dev/bxe/bxe.c @@ -2489,7 +2489,6 @@ static int bxe_probe(device_t dev) { struct bxe_device_type *t; - char *descbuf; uint16_t did, sdid, svid, vid; /* Find our device structure */ @@ -2506,20 +2505,12 @@ bxe_probe(device_t dev) if ((vid == t->bxe_vid) && (did == t->bxe_did) && ((svid == t->bxe_svid) || (t->bxe_svid == PCI_ANY_ID)) && ((sdid == t->bxe_sdid) || (t->bxe_sdid == PCI_ANY_ID))) { - descbuf = malloc(BXE_DEVDESC_MAX, M_TEMP, M_NOWAIT); - if (descbuf == NULL) - return (ENOMEM); - - /* Print out the device identity. */ - snprintf(descbuf, BXE_DEVDESC_MAX, + device_set_descf(dev, "%s (%c%d) BXE v:%s", t->bxe_name, (((pci_read_config(dev, PCIR_REVID, 4) & 0xf0) >> 4) + 'A'), (pci_read_config(dev, PCIR_REVID, 4) & 0xf), BXE_DRIVER_VERSION); - - device_set_desc_copy(dev, descbuf); - free(descbuf, M_TEMP); return (BUS_PROBE_DEFAULT); } t++;