snd_hda: whitespace and style(9) cleanups

This commit is contained in:
emaste 2020-04-19 17:53:44 +00:00
parent b43aed33d6
commit d25151bcd2
2 changed files with 16 additions and 23 deletions

View File

@ -360,8 +360,7 @@ hdac_poll_callback(void *arg)
hdac_unlock(sc); hdac_unlock(sc);
return; return;
} }
callout_reset(&sc->poll_callout, sc->poll_ival, callout_reset(&sc->poll_callout, sc->poll_ival, hdac_poll_callback, sc);
hdac_poll_callback, sc);
hdac_unlock(sc); hdac_unlock(sc);
hdac_intr_handler(sc); hdac_intr_handler(sc);
@ -412,7 +411,7 @@ hdac_reset(struct hdac_softc *sc, int wakeup)
if (!(gctl & HDAC_GCTL_CRST)) if (!(gctl & HDAC_GCTL_CRST))
break; break;
DELAY(10); DELAY(10);
} while (--count); } while (--count);
if (gctl & HDAC_GCTL_CRST) { if (gctl & HDAC_GCTL_CRST) {
device_printf(sc->dev, "Unable to put hdac in reset\n"); device_printf(sc->dev, "Unable to put hdac in reset\n");
return (ENXIO); return (ENXIO);
@ -446,7 +445,6 @@ hdac_reset(struct hdac_softc *sc, int wakeup)
return (0); return (0);
} }
/**************************************************************************** /****************************************************************************
* int hdac_get_capabilities(struct hdac_softc *); * int hdac_get_capabilities(struct hdac_softc *);
* *
@ -620,11 +618,10 @@ hdac_dma_alloc(struct hdac_softc *sc, struct hdac_dma *dma, bus_size_t size)
return (result); return (result);
} }
/**************************************************************************** /****************************************************************************
* void hdac_dma_free(struct hdac_softc *, struct hdac_dma *) * void hdac_dma_free(struct hdac_softc *, struct hdac_dma *)
* *
* Free a struct dhac_dma that has been previously allocated via the * Free a struct hdac_dma that has been previously allocated via the
* hdac_dma_alloc function. * hdac_dma_alloc function.
****************************************************************************/ ****************************************************************************/
static void static void
@ -1041,8 +1038,7 @@ hdac_probe(device_t dev)
if (HDA_DEV_MATCH(hdac_devices[i].model, model) && if (HDA_DEV_MATCH(hdac_devices[i].model, model) &&
class == PCIC_MULTIMEDIA && class == PCIC_MULTIMEDIA &&
subclass == PCIS_MULTIMEDIA_HDA) { subclass == PCIS_MULTIMEDIA_HDA) {
snprintf(desc, sizeof(desc), snprintf(desc, sizeof(desc), "%s (0x%04x)",
"%s (0x%04x)",
hdac_devices[i].desc, pci_get_device(dev)); hdac_devices[i].desc, pci_get_device(dev));
result = BUS_PROBE_GENERIC; result = BUS_PROBE_GENERIC;
break; break;
@ -1700,20 +1696,17 @@ hdac_print_child(device_t dev, device_t child)
int retval; int retval;
retval = bus_print_child_header(dev, child); retval = bus_print_child_header(dev, child);
retval += printf(" at cad %d", retval += printf(" at cad %d", (int)(intptr_t)device_get_ivars(child));
(int)(intptr_t)device_get_ivars(child));
retval += bus_print_child_footer(dev, child); retval += bus_print_child_footer(dev, child);
return (retval); return (retval);
} }
static int static int
hdac_child_location_str(device_t dev, device_t child, char *buf, hdac_child_location_str(device_t dev, device_t child, char *buf, size_t buflen)
size_t buflen)
{ {
snprintf(buf, buflen, "cad=%d", snprintf(buf, buflen, "cad=%d", (int)(intptr_t)device_get_ivars(child));
(int)(intptr_t)device_get_ivars(child));
return (0); return (0);
} }
@ -1724,8 +1717,8 @@ hdac_child_pnpinfo_str_method(device_t dev, device_t child, char *buf,
struct hdac_softc *sc = device_get_softc(dev); struct hdac_softc *sc = device_get_softc(dev);
nid_t cad = (uintptr_t)device_get_ivars(child); nid_t cad = (uintptr_t)device_get_ivars(child);
snprintf(buf, buflen, "vendor=0x%04x device=0x%04x revision=0x%02x " snprintf(buf, buflen,
"stepping=0x%02x", "vendor=0x%04x device=0x%04x revision=0x%02x stepping=0x%02x",
sc->codecs[cad].vendor_id, sc->codecs[cad].device_id, sc->codecs[cad].vendor_id, sc->codecs[cad].device_id,
sc->codecs[cad].revision_id, sc->codecs[cad].stepping_id); sc->codecs[cad].revision_id, sc->codecs[cad].stepping_id);
return (0); return (0);
@ -1901,8 +1894,8 @@ hdac_stream_free(device_t dev, device_t child, int dir, int stream)
} }
static int static int
hdac_stream_start(device_t dev, device_t child, hdac_stream_start(device_t dev, device_t child, int dir, int stream,
int dir, int stream, bus_addr_t buf, int blksz, int blkcnt) bus_addr_t buf, int blksz, int blkcnt)
{ {
struct hdac_softc *sc = device_get_softc(dev); struct hdac_softc *sc = device_get_softc(dev);
struct hdac_bdle *bdle; struct hdac_bdle *bdle;

View File

@ -434,7 +434,8 @@ hdacc_probe(device_t dev)
int i; int i;
id = ((uint32_t)hda_get_vendor_id(dev) << 16) + hda_get_device_id(dev); id = ((uint32_t)hda_get_vendor_id(dev) << 16) + hda_get_device_id(dev);
revid = ((uint32_t)hda_get_revision_id(dev) << 8) + hda_get_stepping_id(dev); revid = ((uint32_t)hda_get_revision_id(dev) << 8) +
hda_get_stepping_id(dev);
for (i = 0; i < nitems(hdacc_codecs); i++) { for (i = 0; i < nitems(hdacc_codecs); i++) {
if (!HDA_DEV_MATCH(hdacc_codecs[i].id, id)) if (!HDA_DEV_MATCH(hdacc_codecs[i].id, id))
@ -525,8 +526,7 @@ hdacc_detach(device_t dev)
} }
static int static int
hdacc_child_location_str(device_t dev, device_t child, char *buf, hdacc_child_location_str(device_t dev, device_t child, char *buf, size_t buflen)
size_t buflen)
{ {
struct hdacc_fg *fg = device_get_ivars(child); struct hdacc_fg *fg = device_get_ivars(child);
@ -645,8 +645,8 @@ hdacc_stream_free(device_t dev, device_t child, int dir, int stream)
} }
static int static int
hdacc_stream_start(device_t dev, device_t child, hdacc_stream_start(device_t dev, device_t child, int dir, int stream,
int dir, int stream, bus_addr_t buf, int blksz, int blkcnt) bus_addr_t buf, int blksz, int blkcnt)
{ {
return (HDAC_STREAM_START(device_get_parent(dev), dev, return (HDAC_STREAM_START(device_get_parent(dev), dev,