git: 6324f0268918 - stable/14 - ahci: Use device_set_desc(f)()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 09 Jun 2024 14:12:01 UTC
The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=6324f02689182418abf19df36b077a9a7d9d13ee commit 6324f02689182418abf19df36b077a9a7d9d13ee Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2024-02-04 23:32:53 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2024-06-09 13:37:47 +0000 ahci: Use device_set_desc(f)() No functional change intended. MFC after: 1 week (cherry picked from commit a74b496507329665c6aa8d0ef2ea42c2fbd88c48) --- sys/dev/ahci/ahci.c | 2 +- sys/dev/ahci/ahci_generic.c | 4 ++-- sys/dev/ahci/ahci_pci.c | 12 ++++-------- sys/dev/ahci/ahciem.c | 2 +- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/sys/dev/ahci/ahci.c b/sys/dev/ahci/ahci.c index 2f0971bddd9b..80cbdefd1e29 100644 --- a/sys/dev/ahci/ahci.c +++ b/sys/dev/ahci/ahci.c @@ -767,7 +767,7 @@ static int ahci_ch_probe(device_t dev) { - device_set_desc_copy(dev, "AHCI channel"); + device_set_desc(dev, "AHCI channel"); return (BUS_PROBE_DEFAULT); } diff --git a/sys/dev/ahci/ahci_generic.c b/sys/dev/ahci/ahci_generic.c index 90487b4622eb..2d4babb17645 100644 --- a/sys/dev/ahci/ahci_generic.c +++ b/sys/dev/ahci/ahci_generic.c @@ -76,7 +76,7 @@ ahci_fdt_probe(device_t dev) if (!ofw_bus_search_compatible(dev, compat_data)->ocd_data) return (ENXIO); - device_set_desc_copy(dev, "AHCI SATA controller"); + device_set_desc(dev, "AHCI SATA controller"); node = ofw_bus_get_node(dev); ctlr->dma_coherent = OF_hasprop(node, "dma-coherent"); return (BUS_PROBE_DEFAULT); @@ -107,7 +107,7 @@ ahci_acpi_probe(device_t dev) if (pci_get_class(dev) == PCIC_STORAGE && pci_get_subclass(dev) == PCIS_STORAGE_SATA && pci_get_progif(dev) == PCIP_STORAGE_SATA_AHCI_1_0) { - device_set_desc_copy(dev, "AHCI SATA controller"); + device_set_desc(dev, "AHCI SATA controller"); if (ACPI_FAILURE(acpi_GetInteger(h, "_CCA", &ctlr->dma_coherent))) ctlr->dma_coherent = 0; diff --git a/sys/dev/ahci/ahci_pci.c b/sys/dev/ahci/ahci_pci.c index 93a72875b502..3d4a7d7c7400 100644 --- a/sys/dev/ahci/ahci_pci.c +++ b/sys/dev/ahci/ahci_pci.c @@ -397,7 +397,6 @@ ahci_pci_ctlr_reset(device_t dev) static int ahci_probe(device_t dev) { - char buf[64]; int i, valid = 0; uint32_t devid = pci_get_devid(dev); uint8_t revid = pci_get_revid(dev); @@ -428,22 +427,20 @@ ahci_probe(device_t dev) (ahci_ids[i].quirks & AHCI_Q_NOFORCE) && (pci_read_config(dev, 0xdf, 1) & 0x40) == 0) return (ENXIO); - snprintf(buf, sizeof(buf), "%s AHCI SATA controller", + device_set_descf(dev, "%s AHCI SATA controller", ahci_ids[i].name); - device_set_desc_copy(dev, buf); return (BUS_PROBE_DEFAULT); } } if (valid != 1) return (ENXIO); - device_set_desc_copy(dev, "AHCI SATA controller"); + device_set_desc(dev, "AHCI SATA controller"); return (BUS_PROBE_DEFAULT); } static int ahci_ata_probe(device_t dev) { - char buf[64]; int i; uint32_t devid = pci_get_devid(dev); uint8_t revid = pci_get_revid(dev); @@ -454,13 +451,12 @@ ahci_ata_probe(device_t dev) for (i = 0; ahci_ids[i].id != 0; i++) { if (ahci_ids[i].id == devid && ahci_ids[i].rev <= revid) { - snprintf(buf, sizeof(buf), "%s AHCI SATA controller", + device_set_descf(dev, "%s AHCI SATA controller", ahci_ids[i].name); - device_set_desc_copy(dev, buf); return (BUS_PROBE_DEFAULT); } } - device_set_desc_copy(dev, "AHCI SATA controller"); + device_set_desc(dev, "AHCI SATA controller"); return (BUS_PROBE_DEFAULT); } diff --git a/sys/dev/ahci/ahciem.c b/sys/dev/ahci/ahciem.c index eb1f2bdc3924..d9ec64b2d014 100644 --- a/sys/dev/ahci/ahciem.c +++ b/sys/dev/ahci/ahciem.c @@ -64,7 +64,7 @@ static int ahci_em_probe(device_t dev) { - device_set_desc_copy(dev, "AHCI enclosure management bridge"); + device_set_desc(dev, "AHCI enclosure management bridge"); return (BUS_PROBE_DEFAULT); }