From: miod Date: Mon, 21 Mar 2022 19:22:39 +0000 (+0000) Subject: Constify struct {audio,midi,radio,video}_hw_if. No functional change. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=0d6a2fdefde3ca287cbbf3741a0574d940eed327;p=openbsd Constify struct {audio,midi,radio,video}_hw_if. No functional change. ok mpi@ ratchov@ "More const is good" deraadt@ --- diff --git a/sys/arch/hppa/gsc/harmony.c b/sys/arch/hppa/gsc/harmony.c index 118d89aadba..ade991c17c2 100644 --- a/sys/arch/hppa/gsc/harmony.c +++ b/sys/arch/hppa/gsc/harmony.c @@ -1,4 +1,4 @@ -/* $OpenBSD: harmony.c,v 1.37 2022/03/13 08:04:38 mpi Exp $ */ +/* $OpenBSD: harmony.c,v 1.38 2022/03/21 19:22:39 miod Exp $ */ /* * Copyright (c) 2003 Jason L. Wright (jason@thought.net) @@ -73,7 +73,7 @@ int harmony_trigger_output(void *, void *, void *, int, int harmony_trigger_input(void *, void *, void *, int, void (*intr)(void *), void *, struct audio_params *); -struct audio_hw_if harmony_sa_hw_if = { +const struct audio_hw_if harmony_sa_hw_if = { harmony_open, harmony_close, harmony_set_params, diff --git a/sys/arch/luna88k/cbus/nec86.c b/sys/arch/luna88k/cbus/nec86.c index ed86c021355..eec75a8f4ac 100644 --- a/sys/arch/luna88k/cbus/nec86.c +++ b/sys/arch/luna88k/cbus/nec86.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nec86.c,v 1.4 2022/02/16 06:21:18 anton Exp $ */ +/* $OpenBSD: nec86.c,v 1.5 2022/03/21 19:22:39 miod Exp $ */ /* $NecBSD: nec86.c,v 1.11 1999/07/23 11:04:39 honda Exp $ */ /* $NetBSD$ */ @@ -67,7 +67,7 @@ * Define our interface to the higher level audio driver. */ -struct audio_hw_if nec86_hw_if = { +const struct audio_hw_if nec86_hw_if = { .open = nec86hw_open, .close = nec86hw_close, .set_params = nec86hw_set_params, diff --git a/sys/arch/luna88k/cbus/nec86var.h b/sys/arch/luna88k/cbus/nec86var.h index 921a3b9a067..7154a8fc525 100644 --- a/sys/arch/luna88k/cbus/nec86var.h +++ b/sys/arch/luna88k/cbus/nec86var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: nec86var.h,v 1.1 2014/12/28 13:03:18 aoyama Exp $ */ +/* $OpenBSD: nec86var.h,v 1.2 2022/03/21 19:22:39 miod Exp $ */ /* $NecBSD: nec86var.h,v 1.6 1998/03/14 07:04:57 kmatsuda Exp $ */ /* $NetBSD$ */ @@ -55,7 +55,7 @@ struct nec86_softc { int sc_intlevel; }; -extern struct audio_hw_if nec86_hw_if; +extern const struct audio_hw_if nec86_hw_if; int nec86_probesubr(bus_space_tag_t, bus_space_handle_t, bus_space_handle_t); void nec86_attachsubr(struct nec86_softc *); diff --git a/sys/arch/macppc/dev/aoa.c b/sys/arch/macppc/dev/aoa.c index dcaf17392f0..f6372876a4d 100644 --- a/sys/arch/macppc/dev/aoa.c +++ b/sys/arch/macppc/dev/aoa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aoa.c,v 1.13 2022/03/13 12:33:01 mpi Exp $ */ +/* $OpenBSD: aoa.c,v 1.14 2022/03/21 19:22:39 miod Exp $ */ /*- * Copyright (c) 2005 Tsubai Masanari. All rights reserved. @@ -65,7 +65,7 @@ struct cfdriver aoa_cd = { NULL, "aoa", DV_DULL }; -struct audio_hw_if aoa_hw_if = { +const struct audio_hw_if aoa_hw_if = { i2s_open, i2s_close, i2s_set_params, diff --git a/sys/arch/macppc/dev/awacs.c b/sys/arch/macppc/dev/awacs.c index c0e9cfb408f..38c7ed6b411 100644 --- a/sys/arch/macppc/dev/awacs.c +++ b/sys/arch/macppc/dev/awacs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: awacs.c,v 1.36 2022/03/13 12:33:01 mpi Exp $ */ +/* $OpenBSD: awacs.c,v 1.37 2022/03/21 19:22:39 miod Exp $ */ /* $NetBSD: awacs.c,v 1.4 2001/02/26 21:07:51 wiz Exp $ */ /*- @@ -126,7 +126,7 @@ struct cfdriver awacs_cd = { NULL, "awacs", DV_DULL }; -struct audio_hw_if awacs_hw_if = { +const struct audio_hw_if awacs_hw_if = { awacs_open, awacs_close, awacs_set_params, diff --git a/sys/arch/macppc/dev/daca.c b/sys/arch/macppc/dev/daca.c index bc44d162907..178b1daeb59 100644 --- a/sys/arch/macppc/dev/daca.c +++ b/sys/arch/macppc/dev/daca.c @@ -1,4 +1,4 @@ -/* $OpenBSD: daca.c,v 1.12 2022/03/13 12:33:01 mpi Exp $ */ +/* $OpenBSD: daca.c,v 1.13 2022/03/21 19:22:39 miod Exp $ */ /*- * Copyright (c) 2002,2003 Tsubai Masanari. All rights reserved. @@ -71,7 +71,7 @@ struct cfdriver daca_cd = { NULL, "daca", DV_DULL }; -struct audio_hw_if daca_hw_if = { +const struct audio_hw_if daca_hw_if = { i2s_open, i2s_close, i2s_set_params, diff --git a/sys/arch/macppc/dev/onyx.c b/sys/arch/macppc/dev/onyx.c index a7b72541b40..989ed3db5d5 100644 --- a/sys/arch/macppc/dev/onyx.c +++ b/sys/arch/macppc/dev/onyx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: onyx.c,v 1.14 2022/03/13 12:33:01 mpi Exp $ */ +/* $OpenBSD: onyx.c,v 1.15 2022/03/21 19:22:39 miod Exp $ */ /*- * Copyright (c) 2005 Tsubai Masanari. All rights reserved. @@ -80,7 +80,7 @@ struct cfdriver onyx_cd = { NULL, "onyx", DV_DULL }; -struct audio_hw_if onyx_hw_if = { +const struct audio_hw_if onyx_hw_if = { i2s_open, i2s_close, i2s_set_params, diff --git a/sys/arch/macppc/dev/snapper.c b/sys/arch/macppc/dev/snapper.c index 9ccde482ae5..e4ce4077064 100644 --- a/sys/arch/macppc/dev/snapper.c +++ b/sys/arch/macppc/dev/snapper.c @@ -1,4 +1,4 @@ -/* $OpenBSD: snapper.c,v 1.41 2022/03/13 12:33:01 mpi Exp $ */ +/* $OpenBSD: snapper.c,v 1.42 2022/03/21 19:22:39 miod Exp $ */ /* $NetBSD: snapper.c,v 1.1 2003/12/27 02:19:34 grant Exp $ */ /*- @@ -77,7 +77,7 @@ struct cfdriver snapper_cd = { NULL, "snapper", DV_DULL }; -struct audio_hw_if snapper_hw_if = { +const struct audio_hw_if snapper_hw_if = { i2s_open, i2s_close, i2s_set_params, diff --git a/sys/arch/macppc/dev/tumbler.c b/sys/arch/macppc/dev/tumbler.c index 91298692632..fbc343b7c66 100644 --- a/sys/arch/macppc/dev/tumbler.c +++ b/sys/arch/macppc/dev/tumbler.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tumbler.c,v 1.11 2022/03/13 12:33:01 mpi Exp $ */ +/* $OpenBSD: tumbler.c,v 1.12 2022/03/21 19:22:39 miod Exp $ */ /*- * Copyright (c) 2001,2003 Tsubai Masanari. All rights reserved. @@ -75,7 +75,7 @@ struct cfdriver tumbler_cd = { NULL, "tumbler", DV_DULL }; -struct audio_hw_if tumbler_hw_if = { +const struct audio_hw_if tumbler_hw_if = { i2s_open, i2s_close, i2s_set_params, diff --git a/sys/arch/sparc64/dev/ce4231.c b/sys/arch/sparc64/dev/ce4231.c index 5e220907150..edd74d38c86 100644 --- a/sys/arch/sparc64/dev/ce4231.c +++ b/sys/arch/sparc64/dev/ce4231.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ce4231.c,v 1.38 2022/02/16 06:21:18 anton Exp $ */ +/* $OpenBSD: ce4231.c,v 1.39 2022/03/21 19:22:39 miod Exp $ */ /* * Copyright (c) 1999 Jason L. Wright (jason@thought.net) @@ -150,7 +150,7 @@ int ce4231_trigger_output(void *, void *, void *, int, int ce4231_trigger_input(void *, void *, void *, int, void (*intr)(void *), void *arg, struct audio_params *); -struct audio_hw_if ce4231_sa_hw_if = { +const struct audio_hw_if ce4231_sa_hw_if = { ce4231_open, ce4231_close, ce4231_set_params, diff --git a/sys/dev/audio.c b/sys/dev/audio.c index 27184919c33..7f560e011f6 100644 --- a/sys/dev/audio.c +++ b/sys/dev/audio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: audio.c,v 1.197 2022/02/22 07:34:06 visa Exp $ */ +/* $OpenBSD: audio.c,v 1.198 2022/03/21 19:22:39 miod Exp $ */ /* * Copyright (c) 2015 Alexandre Ratchov * @@ -113,7 +113,7 @@ struct mixer_ev { */ struct audio_softc { struct device dev; - struct audio_hw_if *ops; /* driver funcs */ + const struct audio_hw_if *ops; /* driver funcs */ void *cookie; /* wskbd cookie */ void *arg; /* first arg to driver funcs */ int mode; /* bitmask of AUMODE_* */ @@ -1225,7 +1225,7 @@ audio_attach(struct device *parent, struct device *self, void *aux) { struct audio_softc *sc = (void *)self; struct audio_attach_args *sa = aux; - struct audio_hw_if *ops = sa->hwif; + const struct audio_hw_if *ops = sa->hwif; struct mixer_devinfo *mi; struct mixer_ctrl *ent; void *arg = sa->hdl; @@ -1487,7 +1487,8 @@ audio_submatch(struct device *parent, void *match, void *aux) } struct device * -audio_attach_mi(struct audio_hw_if *ops, void *arg, void *cookie, struct device *dev) +audio_attach_mi(const struct audio_hw_if *ops, void *arg, void *cookie, + struct device *dev) { struct audio_attach_args aa; diff --git a/sys/dev/audio_if.h b/sys/dev/audio_if.h index 4f43d0e39aa..c5adaf579cd 100644 --- a/sys/dev/audio_if.h +++ b/sys/dev/audio_if.h @@ -1,4 +1,4 @@ -/* $OpenBSD: audio_if.h,v 1.37 2022/02/16 06:21:18 anton Exp $ */ +/* $OpenBSD: audio_if.h,v 1.38 2022/03/21 19:22:40 miod Exp $ */ /* $NetBSD: audio_if.h,v 1.24 1998/01/10 14:07:25 tv Exp $ */ /* @@ -141,7 +141,7 @@ struct audio_hw_if { struct audio_attach_args { int type; - void *hwif; /* either audio_hw_if * or midi_hw_if * */ + const void *hwif; /* either audio_hw_if * or midi_hw_if * */ void *hdl; void *cookie; }; @@ -152,7 +152,8 @@ struct audio_attach_args { #define AUDIODEV_TYPE_RADIO 4 /* Attach the MI driver(s) to the MD driver. */ -struct device *audio_attach_mi(struct audio_hw_if *, void *, void *, struct device *); +struct device *audio_attach_mi(const struct audio_hw_if *, void *, void *, + struct device *); int audioprint(void *, const char *); int audio_blksz_bytes(int, struct audio_params *, struct audio_params *, int); diff --git a/sys/dev/fdt/es8316ac.c b/sys/dev/fdt/es8316ac.c index 5423972f70f..57d1734f261 100644 --- a/sys/dev/fdt/es8316ac.c +++ b/sys/dev/fdt/es8316ac.c @@ -1,4 +1,4 @@ -/* $OpenBSD: es8316ac.c,v 1.1 2020/06/11 00:04:28 patrick Exp $ */ +/* $OpenBSD: es8316ac.c,v 1.2 2022/03/21 19:22:40 miod Exp $ */ /* $NetBSD: es8316ac.c,v 1.2 2020/01/03 01:00:08 jmcneill Exp $ */ /*- * Copyright (c) 2020 Jared McNeill @@ -132,7 +132,7 @@ int escodec_set_port(void *, mixer_ctrl_t *); int escodec_get_port(void *, mixer_ctrl_t *); int escodec_query_devinfo(void *, mixer_devinfo_t *); -struct audio_hw_if escodec_hw_if = { +const struct audio_hw_if escodec_hw_if = { .set_port = escodec_set_port, .get_port = escodec_get_port, .query_devinfo = escodec_query_devinfo, diff --git a/sys/dev/fdt/graphaudio.c b/sys/dev/fdt/graphaudio.c index 900daf57226..d09e08ecea7 100644 --- a/sys/dev/fdt/graphaudio.c +++ b/sys/dev/fdt/graphaudio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: graphaudio.c,v 1.2 2022/02/16 06:21:18 anton Exp $ */ +/* $OpenBSD: graphaudio.c,v 1.3 2022/03/21 19:22:40 miod Exp $ */ /* * Copyright (c) 2020 Patrick Wildt * Copyright (c) 2021 Mark Kettenis @@ -65,7 +65,7 @@ int graphaudio_trigger_input(void *, void *, void *, int, int graphaudio_halt_output(void *); int graphaudio_halt_input(void *); -struct audio_hw_if graphaudio_hw_if = { +const struct audio_hw_if graphaudio_hw_if = { .open = graphaudio_open, .close = graphaudio_close, .set_params = graphaudio_set_params, @@ -206,7 +206,7 @@ graphaudio_open(void *cookie, int flags) { struct graphaudio_softc *sc = cookie; struct dai_device *dai; - struct audio_hw_if *hwif; + const struct audio_hw_if *hwif; int error; dai = sc->sc_dai_cpu; @@ -237,7 +237,7 @@ graphaudio_close(void *cookie) { struct graphaudio_softc *sc = cookie; struct dai_device *dai; - struct audio_hw_if *hwif; + const struct audio_hw_if *hwif; dai = sc->sc_dai_codec; hwif = dai->dd_hw_if; @@ -256,7 +256,7 @@ graphaudio_set_params(void *cookie, int setmode, int usemode, { struct graphaudio_softc *sc = cookie; struct dai_device *dai; - struct audio_hw_if *hwif; + const struct audio_hw_if *hwif; uint32_t rate; int error; @@ -308,7 +308,7 @@ graphaudio_allocm(void *cookie, int direction, size_t size, int type, { struct graphaudio_softc *sc = cookie; struct dai_device *dai = sc->sc_dai_cpu; - struct audio_hw_if *hwif = dai->dd_hw_if; + const struct audio_hw_if *hwif = dai->dd_hw_if; if (hwif->allocm) return hwif->allocm(dai->dd_cookie, @@ -322,7 +322,7 @@ graphaudio_freem(void *cookie, void *addr, int type) { struct graphaudio_softc *sc = cookie; struct dai_device *dai = sc->sc_dai_cpu; - struct audio_hw_if *hwif = dai->dd_hw_if; + const struct audio_hw_if *hwif = dai->dd_hw_if; if (hwif->freem) hwif->freem(dai->dd_cookie, addr, type); @@ -333,7 +333,7 @@ graphaudio_set_port(void *cookie, mixer_ctrl_t *cp) { struct graphaudio_softc *sc = cookie; struct dai_device *dai = sc->sc_dai_codec; - struct audio_hw_if *hwif = dai->dd_hw_if; + const struct audio_hw_if *hwif = dai->dd_hw_if; if (hwif->set_port) return hwif->set_port(dai->dd_cookie, cp); @@ -346,7 +346,7 @@ graphaudio_get_port(void *cookie, mixer_ctrl_t *cp) { struct graphaudio_softc *sc = cookie; struct dai_device *dai = sc->sc_dai_codec; - struct audio_hw_if *hwif = dai->dd_hw_if; + const struct audio_hw_if *hwif = dai->dd_hw_if; if (hwif->get_port) return hwif->get_port(dai->dd_cookie, cp); @@ -359,7 +359,7 @@ graphaudio_query_devinfo(void *cookie, mixer_devinfo_t *dip) { struct graphaudio_softc *sc = cookie; struct dai_device *dai = sc->sc_dai_codec; - struct audio_hw_if *hwif = dai->dd_hw_if; + const struct audio_hw_if *hwif = dai->dd_hw_if; if (hwif->query_devinfo) return hwif->query_devinfo(dai->dd_cookie, dip); @@ -372,7 +372,7 @@ graphaudio_get_props(void *cookie) { struct graphaudio_softc *sc = cookie; struct dai_device *dai = sc->sc_dai_cpu; - struct audio_hw_if *hwif = dai->dd_hw_if; + const struct audio_hw_if *hwif = dai->dd_hw_if; if (hwif->get_props) return hwif->get_props(dai->dd_cookie); @@ -385,7 +385,7 @@ graphaudio_round_blocksize(void *cookie, int block) { struct graphaudio_softc *sc = cookie; struct dai_device *dai = sc->sc_dai_cpu; - struct audio_hw_if *hwif = dai->dd_hw_if; + const struct audio_hw_if *hwif = dai->dd_hw_if; if (hwif->round_blocksize) return hwif->round_blocksize(dai->dd_cookie, block); @@ -398,7 +398,7 @@ graphaudio_round_buffersize(void *cookie, int direction, size_t bufsize) { struct graphaudio_softc *sc = cookie; struct dai_device *dai = sc->sc_dai_cpu; - struct audio_hw_if *hwif = dai->dd_hw_if; + const struct audio_hw_if *hwif = dai->dd_hw_if; if (hwif->round_buffersize) return hwif->round_buffersize(dai->dd_cookie, @@ -413,7 +413,7 @@ graphaudio_trigger_output(void *cookie, void *start, void *end, int blksize, { struct graphaudio_softc *sc = cookie; struct dai_device *dai; - struct audio_hw_if *hwif; + const struct audio_hw_if *hwif; int error; dai = sc->sc_dai_codec; @@ -447,7 +447,7 @@ graphaudio_trigger_input(void *cookie, void *start, void *end, int blksize, { struct graphaudio_softc *sc = cookie; struct dai_device *dai; - struct audio_hw_if *hwif; + const struct audio_hw_if *hwif; int error; dai = sc->sc_dai_codec; @@ -480,7 +480,7 @@ graphaudio_halt_output(void *cookie) { struct graphaudio_softc *sc = cookie; struct dai_device *dai; - struct audio_hw_if *hwif; + const struct audio_hw_if *hwif; dai = sc->sc_dai_codec; hwif = dai->dd_hw_if; @@ -500,7 +500,7 @@ graphaudio_halt_input(void *cookie) { struct graphaudio_softc *sc = cookie; struct dai_device *dai; - struct audio_hw_if *hwif; + const struct audio_hw_if *hwif; dai = sc->sc_dai_codec; hwif = dai->dd_hw_if; diff --git a/sys/dev/fdt/rkiis.c b/sys/dev/fdt/rkiis.c index bf170513447..baf3c1d6bf3 100644 --- a/sys/dev/fdt/rkiis.c +++ b/sys/dev/fdt/rkiis.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rkiis.c,v 1.1 2020/06/11 00:02:08 patrick Exp $ */ +/* $OpenBSD: rkiis.c,v 1.2 2022/03/21 19:22:40 miod Exp $ */ /* $NetBSD: rk_i2s.c,v 1.3 2020/02/29 05:51:10 isaki Exp $ */ /*- * Copyright (c) 2019 Jared McNeill @@ -200,7 +200,7 @@ struct rkiis_softc { struct dai_device sc_dai; }; -struct audio_hw_if rkiis_hw_if = { +const struct audio_hw_if rkiis_hw_if = { .set_params = rkiis_set_params, .get_props = rkiis_get_props, .allocm = rkiis_allocm, diff --git a/sys/dev/fdt/simpleamp.c b/sys/dev/fdt/simpleamp.c index 1d49d65c401..23617d4ab8e 100644 --- a/sys/dev/fdt/simpleamp.c +++ b/sys/dev/fdt/simpleamp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: simpleamp.c,v 1.2 2022/02/14 00:53:40 jsg Exp $ */ +/* $OpenBSD: simpleamp.c,v 1.3 2022/03/21 19:22:40 miod Exp $ */ /* * Copyright (c) 2020 Patrick Wildt * @@ -46,7 +46,7 @@ struct simpleamp_softc { uint32_t sc_vcc; }; -struct audio_hw_if simpleamp_hw_if = { +const struct audio_hw_if simpleamp_hw_if = { .open = simpleamp_open, .close = simpleamp_close, }; diff --git a/sys/dev/fdt/simpleaudio.c b/sys/dev/fdt/simpleaudio.c index 9ed72558849..482c453d5fc 100644 --- a/sys/dev/fdt/simpleaudio.c +++ b/sys/dev/fdt/simpleaudio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: simpleaudio.c,v 1.3 2022/02/16 06:21:18 anton Exp $ */ +/* $OpenBSD: simpleaudio.c,v 1.4 2022/03/21 19:22:40 miod Exp $ */ /* * Copyright (c) 2020 Patrick Wildt * @@ -67,7 +67,7 @@ int simpleaudio_trigger_input(void *, void *, void *, int, int simpleaudio_halt_output(void *); int simpleaudio_halt_input(void *); -struct audio_hw_if simpleaudio_hw_if = { +const struct audio_hw_if simpleaudio_hw_if = { .open = simpleaudio_open, .close = simpleaudio_close, .set_params = simpleaudio_set_params, @@ -226,7 +226,7 @@ simpleaudio_open(void *cookie, int flags) { struct simpleaudio_softc *sc = cookie; struct dai_device *dai; - struct audio_hw_if *hwif; + const struct audio_hw_if *hwif; int error, i; dai = sc->sc_dai_cpu; @@ -269,7 +269,7 @@ simpleaudio_close(void *cookie) { struct simpleaudio_softc *sc = cookie; struct dai_device *dai; - struct audio_hw_if *hwif; + const struct audio_hw_if *hwif; int i; for (i = 0; i < sc->sc_dai_naux; i++) { @@ -296,7 +296,7 @@ simpleaudio_set_params(void *cookie, int setmode, int usemode, { struct simpleaudio_softc *sc = cookie; struct dai_device *dai; - struct audio_hw_if *hwif; + const struct audio_hw_if *hwif; uint32_t rate; int error; @@ -348,7 +348,7 @@ simpleaudio_allocm(void *cookie, int direction, size_t size, int type, { struct simpleaudio_softc *sc = cookie; struct dai_device *dai = sc->sc_dai_cpu; - struct audio_hw_if *hwif = dai->dd_hw_if; + const struct audio_hw_if *hwif = dai->dd_hw_if; if (hwif->allocm) return hwif->allocm(dai->dd_cookie, @@ -362,7 +362,7 @@ simpleaudio_freem(void *cookie, void *addr, int type) { struct simpleaudio_softc *sc = cookie; struct dai_device *dai = sc->sc_dai_cpu; - struct audio_hw_if *hwif = dai->dd_hw_if; + const struct audio_hw_if *hwif = dai->dd_hw_if; if (hwif->freem) hwif->freem(dai->dd_cookie, addr, type); @@ -373,7 +373,7 @@ simpleaudio_set_port(void *cookie, mixer_ctrl_t *cp) { struct simpleaudio_softc *sc = cookie; struct dai_device *dai = sc->sc_dai_codec; - struct audio_hw_if *hwif = dai->dd_hw_if; + const struct audio_hw_if *hwif = dai->dd_hw_if; if (hwif->set_port) return hwif->set_port(dai->dd_cookie, cp); @@ -386,7 +386,7 @@ simpleaudio_get_port(void *cookie, mixer_ctrl_t *cp) { struct simpleaudio_softc *sc = cookie; struct dai_device *dai = sc->sc_dai_codec; - struct audio_hw_if *hwif = dai->dd_hw_if; + const struct audio_hw_if *hwif = dai->dd_hw_if; if (hwif->get_port) return hwif->get_port(dai->dd_cookie, cp); @@ -399,7 +399,7 @@ simpleaudio_query_devinfo(void *cookie, mixer_devinfo_t *dip) { struct simpleaudio_softc *sc = cookie; struct dai_device *dai = sc->sc_dai_codec; - struct audio_hw_if *hwif = dai->dd_hw_if; + const struct audio_hw_if *hwif = dai->dd_hw_if; if (hwif->query_devinfo) return hwif->query_devinfo(dai->dd_cookie, dip); @@ -412,7 +412,7 @@ simpleaudio_get_props(void *cookie) { struct simpleaudio_softc *sc = cookie; struct dai_device *dai = sc->sc_dai_cpu; - struct audio_hw_if *hwif = dai->dd_hw_if; + const struct audio_hw_if *hwif = dai->dd_hw_if; if (hwif->get_props) return hwif->get_props(dai->dd_cookie); @@ -425,7 +425,7 @@ simpleaudio_round_blocksize(void *cookie, int block) { struct simpleaudio_softc *sc = cookie; struct dai_device *dai = sc->sc_dai_cpu; - struct audio_hw_if *hwif = dai->dd_hw_if; + const struct audio_hw_if *hwif = dai->dd_hw_if; if (hwif->round_blocksize) return hwif->round_blocksize(dai->dd_cookie, block); @@ -438,7 +438,7 @@ simpleaudio_round_buffersize(void *cookie, int direction, size_t bufsize) { struct simpleaudio_softc *sc = cookie; struct dai_device *dai = sc->sc_dai_cpu; - struct audio_hw_if *hwif = dai->dd_hw_if; + const struct audio_hw_if *hwif = dai->dd_hw_if; if (hwif->round_buffersize) return hwif->round_buffersize(dai->dd_cookie, @@ -453,7 +453,7 @@ simpleaudio_trigger_output(void *cookie, void *start, void *end, int blksize, { struct simpleaudio_softc *sc = cookie; struct dai_device *dai; - struct audio_hw_if *hwif; + const struct audio_hw_if *hwif; int error, i; for (i = 0; i < sc->sc_dai_naux; i++) { @@ -500,7 +500,7 @@ simpleaudio_trigger_input(void *cookie, void *start, void *end, int blksize, { struct simpleaudio_softc *sc = cookie; struct dai_device *dai; - struct audio_hw_if *hwif; + const struct audio_hw_if *hwif; int error, i; for (i = 0; i < sc->sc_dai_naux; i++) { @@ -545,7 +545,7 @@ int simpleaudio_halt_output(void *cookie) { struct simpleaudio_softc *sc = cookie; struct dai_device *dai; - struct audio_hw_if *hwif; + const struct audio_hw_if *hwif; int i; for (i = 0; i < sc->sc_dai_naux; i++) { @@ -572,7 +572,7 @@ int simpleaudio_halt_input(void *cookie) { struct simpleaudio_softc *sc = cookie; struct dai_device *dai; - struct audio_hw_if *hwif; + const struct audio_hw_if *hwif; int i; for (i = 0; i < sc->sc_dai_naux; i++) { diff --git a/sys/dev/fdt/tascodec.c b/sys/dev/fdt/tascodec.c index 83f0faaf85c..48c7e355b49 100644 --- a/sys/dev/fdt/tascodec.c +++ b/sys/dev/fdt/tascodec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tascodec.c,v 1.2 2022/02/14 14:57:00 kettenis Exp $ */ +/* $OpenBSD: tascodec.c,v 1.3 2022/03/21 19:22:40 miod Exp $ */ /* * Copyright (c) 2022 Mark Kettenis * @@ -82,7 +82,7 @@ int tascodec_trigger_output(void *, void *, void *, int, void (*)(void *), void *, struct audio_params *); int tascodec_halt_output(void *); -struct audio_hw_if tascodec_hw_if = { +const struct audio_hw_if tascodec_hw_if = { .set_port = tascodec_set_port, .get_port = tascodec_get_port, .query_devinfo = tascodec_query_devinfo, diff --git a/sys/dev/ic/arcofi.c b/sys/dev/ic/arcofi.c index 3bf44fbc1ce..5152f2df8d9 100644 --- a/sys/dev/ic/arcofi.c +++ b/sys/dev/ic/arcofi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: arcofi.c,v 1.18 2022/02/16 06:21:18 anton Exp $ */ +/* $OpenBSD: arcofi.c,v 1.19 2022/03/21 19:22:40 miod Exp $ */ /* * Copyright (c) 2011 Miodrag Vallat. @@ -208,7 +208,7 @@ int arcofi_set_port(void *, mixer_ctrl_t *); int arcofi_start_input(void *, void *, int, void (*)(void *), void *); int arcofi_start_output(void *, void *, int, void (*)(void *), void *); -/* const */ struct audio_hw_if arcofi_hw_if = { +const struct audio_hw_if arcofi_hw_if = { .open = arcofi_open, .close = arcofi_close, .set_params = arcofi_set_params, diff --git a/sys/dev/ic/mpuvar.h b/sys/dev/ic/mpuvar.h index 35d76a70671..9abd511bf1f 100644 --- a/sys/dev/ic/mpuvar.h +++ b/sys/dev/ic/mpuvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: mpuvar.h,v 1.6 2008/06/26 05:42:15 ray Exp $ */ +/* $OpenBSD: mpuvar.h,v 1.7 2022/03/21 19:22:40 miod Exp $ */ /* $NetBSD: mpu401var.h,v 1.3 1998/11/25 22:17:06 augustss Exp $ */ /* @@ -39,7 +39,7 @@ struct mpu_softc { void *arg; /* arg for intr() */ }; -extern struct midi_hw_if mpu_midi_hw_if; +extern const struct midi_hw_if mpu_midi_hw_if; int mpu_intr(void *); int mpu_find(void *); diff --git a/sys/dev/isa/ess.c b/sys/dev/isa/ess.c index 86df2f0f815..c0298cacfb4 100644 --- a/sys/dev/isa/ess.c +++ b/sys/dev/isa/ess.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ess.c,v 1.27 2022/02/16 06:21:18 anton Exp $ */ +/* $OpenBSD: ess.c,v 1.28 2022/03/21 19:22:40 miod Exp $ */ /* $NetBSD: ess.c,v 1.44.4.1 1999/06/21 01:18:00 thorpej Exp $ */ /* @@ -197,7 +197,7 @@ static char *essmodel[] = { * Define our interface to the higher level audio driver. */ -struct audio_hw_if ess_1788_hw_if = { +const struct audio_hw_if ess_1788_hw_if = { ess_open, ess_1788_close, ess_set_params, @@ -222,7 +222,7 @@ struct audio_hw_if ess_1788_hw_if = { ess_audio1_trigger_input }; -struct audio_hw_if ess_1888_hw_if = { +const struct audio_hw_if ess_1888_hw_if = { ess_open, ess_1888_close, ess_set_params, diff --git a/sys/dev/isa/gus.c b/sys/dev/isa/gus.c index 8ff717032c8..77c381a1fdd 100644 --- a/sys/dev/isa/gus.c +++ b/sys/dev/isa/gus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gus.c,v 1.49 2022/02/16 06:21:18 anton Exp $ */ +/* $OpenBSD: gus.c,v 1.50 2022/03/21 19:22:40 miod Exp $ */ /* $NetBSD: gus.c,v 1.51 1998/01/25 23:48:06 mycroft Exp $ */ /*- @@ -260,7 +260,7 @@ static const unsigned short gus_log_volumes[512] = { /* * Interface to higher level audio driver */ -struct audio_hw_if gus_hw_if = { +const struct audio_hw_if gus_hw_if = { gusopen, gusclose, gus_set_params, @@ -291,7 +291,7 @@ struct audio_hw_if gus_hw_if = { NULL }; -static struct audio_hw_if gusmax_hw_if = { +const static struct audio_hw_if gusmax_hw_if = { gusmaxopen, gusmax_close, gusmax_set_params, @@ -2082,7 +2082,6 @@ gus_init_cs4231(struct gus_softc *sc) sc->sc_codec.parent = sc; sc->sc_codec.sc_drq = sc->sc_recdrq; sc->sc_codec.sc_recdrq = sc->sc_drq; - gus_hw_if = gusmax_hw_if; /* enable line in and mic in the GUS mixer; the codec chip will do the real mixing for them. */ sc->sc_mixcontrol &= ~GUSMASK_LINE_IN; /* 0 enables. */ @@ -3397,8 +3396,12 @@ gus_subattach(struct gus_softc *sc, struct isa_attach_args *ia) * Attach to the generic audio layer */ - audio_attach_mi(&gus_hw_if, HAS_CODEC(sc) ? (void *)&sc->sc_codec : - (void *)sc, NULL, &sc->sc_dev); + if (HAS_CODEC(sc)) { + audio_attach_mi(&gusmax_hw_if, (void *)&sc->sc_codec, NULL, + &sc->sc_dev); + } else { + audio_attach_mi(&gus_hw_if, (void *)sc, NULL, &sc->sc_dev); + } } /* diff --git a/sys/dev/isa/gusvar.h b/sys/dev/isa/gusvar.h index 4422948542b..e979f53c6ac 100644 --- a/sys/dev/isa/gusvar.h +++ b/sys/dev/isa/gusvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: gusvar.h,v 1.10 2016/09/19 06:46:44 ratchov Exp $ */ +/* $OpenBSD: gusvar.h,v 1.11 2022/03/21 19:22:40 miod Exp $ */ /* $NetBSD: gus.c,v 1.51 1998/01/25 23:48:06 mycroft Exp $ */ /*- @@ -406,7 +406,7 @@ extern const int gus_addrs; #define splgus splaudio -extern struct audio_hw_if gus_hw_if; +extern const struct audio_hw_if gus_hw_if; #define FLIP_REV 5 /* This rev has flipped mixer chans */ diff --git a/sys/dev/isa/mpu401.c b/sys/dev/isa/mpu401.c index cacab0e6442..60e5d635417 100644 --- a/sys/dev/isa/mpu401.c +++ b/sys/dev/isa/mpu401.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mpu401.c,v 1.16 2021/03/07 06:17:04 jsg Exp $ */ +/* $OpenBSD: mpu401.c,v 1.17 2022/03/21 19:22:40 miod Exp $ */ /* $NetBSD: mpu401.c,v 1.3 1998/11/25 22:17:06 augustss Exp $ */ /* @@ -68,7 +68,7 @@ struct cfdriver mpu_cd = { NULL, "mpu", DV_DULL }; -struct midi_hw_if mpu_midi_hw_if = { +const struct midi_hw_if mpu_midi_hw_if = { mpu_open, mpu_close, mpu_output, diff --git a/sys/dev/isa/pas.c b/sys/dev/isa/pas.c index cb206ec4f4f..d475b2d81ac 100644 --- a/sys/dev/isa/pas.c +++ b/sys/dev/isa/pas.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pas.c,v 1.31 2022/02/16 06:21:18 anton Exp $ */ +/* $OpenBSD: pas.c,v 1.32 2022/03/21 19:22:40 miod Exp $ */ /* $NetBSD: pas.c,v 1.37 1998/01/12 09:43:43 thorpej Exp $ */ /* @@ -108,7 +108,7 @@ void pasconf(int, int, int, int); * Define our interface to the higher level audio driver. */ -struct audio_hw_if pas_hw_if = { +const struct audio_hw_if pas_hw_if = { sbdsp_open, sbdsp_close, sbdsp_set_params, diff --git a/sys/dev/isa/sb.c b/sys/dev/isa/sb.c index 2a7ae30b936..75779266311 100644 --- a/sys/dev/isa/sb.c +++ b/sys/dev/isa/sb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sb.c,v 1.31 2022/02/16 06:21:18 anton Exp $ */ +/* $OpenBSD: sb.c,v 1.32 2022/03/21 19:22:40 miod Exp $ */ /* $NetBSD: sb.c,v 1.57 1998/01/12 09:43:46 thorpej Exp $ */ /* @@ -70,7 +70,7 @@ void sb_mpu401_close(void *); int sb_mpu401_output(void *, int); void sb_mpu401_getinfo(void *, struct midi_info *); -struct midi_hw_if sb_midi_hw_if = { +const struct midi_hw_if sb_midi_hw_if = { sbdsp_midi_open, sbdsp_midi_close, sbdsp_midi_output, @@ -79,7 +79,7 @@ struct midi_hw_if sb_midi_hw_if = { 0, /* ioctl */ }; -struct midi_hw_if sb_mpu401_hw_if = { +const struct midi_hw_if sb_mpu401_hw_if = { sb_mpu401_open, sb_mpu401_close, sb_mpu401_output, @@ -93,7 +93,7 @@ struct midi_hw_if sb_mpu401_hw_if = { * Define our interface to the higher level audio driver. */ -struct audio_hw_if sb_hw_if = { +const struct audio_hw_if sb_hw_if = { sbdsp_open, sbdsp_close, sbdsp_set_params, @@ -243,7 +243,7 @@ sbattach(struct sbdsp_softc *sc) { struct audio_attach_args arg; #if NMIDI > 0 - struct midi_hw_if *mhw = &sb_midi_hw_if; + const struct midi_hw_if *mhw = &sb_midi_hw_if; #endif sc->sc_ih = isa_intr_establish(sc->sc_ic, sc->sc_irq, diff --git a/sys/dev/midi.c b/sys/dev/midi.c index bcef144fbdc..73000a32c82 100644 --- a/sys/dev/midi.c +++ b/sys/dev/midi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: midi.c,v 1.52 2021/10/30 12:48:11 ratchov Exp $ */ +/* $OpenBSD: midi.c,v 1.53 2022/03/21 19:22:40 miod Exp $ */ /* * Copyright (c) 2003, 2004 Alexandre Ratchov @@ -549,7 +549,7 @@ midiattach(struct device *parent, struct device *self, void *aux) struct midi_info mi; struct midi_softc *sc = (struct midi_softc *)self; struct audio_attach_args *sa = (struct audio_attach_args *)aux; - struct midi_hw_if *hwif = sa->hwif; + const struct midi_hw_if *hwif = sa->hwif; void *hdl = sa->hdl; #ifdef DIAGNOSTIC @@ -645,7 +645,7 @@ midiprint(void *aux, const char *pnp) } struct device * -midi_attach_mi(struct midi_hw_if *hwif, void *hdl, struct device *dev) +midi_attach_mi(const struct midi_hw_if *hwif, void *hdl, struct device *dev) { struct audio_attach_args arg; diff --git a/sys/dev/midi_if.h b/sys/dev/midi_if.h index bfe3ec72fa3..09755cbe062 100644 --- a/sys/dev/midi_if.h +++ b/sys/dev/midi_if.h @@ -1,4 +1,4 @@ -/* $OpenBSD: midi_if.h,v 1.9 2015/05/16 10:04:20 ratchov Exp $ */ +/* $OpenBSD: midi_if.h,v 1.10 2022/03/21 19:22:40 miod Exp $ */ /* $NetBSD: midi_if.h,v 1.3 1998/11/25 22:17:07 augustss Exp $ */ /* @@ -52,6 +52,7 @@ struct midi_hw_if { int (*ioctl)(void *, u_long, caddr_t, int, struct proc *); }; -struct device *midi_attach_mi(struct midi_hw_if *, void *, struct device *); +struct device *midi_attach_mi(const struct midi_hw_if *, void *, + struct device *); #endif /* _SYS_DEV_MIDI_IF_H_ */ diff --git a/sys/dev/midivar.h b/sys/dev/midivar.h index d62daec694d..ff14ecbb343 100644 --- a/sys/dev/midivar.h +++ b/sys/dev/midivar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: midivar.h,v 1.12 2021/10/30 12:26:26 ratchov Exp $ */ +/* $OpenBSD: midivar.h,v 1.13 2022/03/21 19:22:40 miod Exp $ */ /* * Copyright (c) 2003, 2004 Alexandre Ratchov @@ -72,7 +72,7 @@ struct midi_buffer { struct midi_softc { struct device dev; - struct midi_hw_if *hw_if; + const struct midi_hw_if *hw_if; void *hw_hdl; int isbusy; /* concerns only the output */ int flags; /* open flags */ diff --git a/sys/dev/ofw/ofw_misc.h b/sys/dev/ofw/ofw_misc.h index 2dfa800a820..9aee48a0f22 100644 --- a/sys/dev/ofw/ofw_misc.h +++ b/sys/dev/ofw/ofw_misc.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ofw_misc.h,v 1.23 2022/03/02 12:00:46 kettenis Exp $ */ +/* $OpenBSD: ofw_misc.h,v 1.24 2022/03/21 19:22:40 miod Exp $ */ /* * Copyright (c) 2017-2021 Mark Kettenis * @@ -191,7 +191,7 @@ void *endpoint_get_cookie(struct endpoint *); struct dai_device { int dd_node; void *dd_cookie; - void *dd_hw_if; + const void *dd_hw_if; int (*dd_set_format)(void *, uint32_t, uint32_t, uint32_t); int (*dd_set_sysclk)(void *, uint32_t); diff --git a/sys/dev/pci/auacer.c b/sys/dev/pci/auacer.c index d42892bbbbd..ad840a08458 100644 --- a/sys/dev/pci/auacer.c +++ b/sys/dev/pci/auacer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: auacer.c,v 1.24 2022/03/11 18:00:45 mpi Exp $ */ +/* $OpenBSD: auacer.c,v 1.25 2022/03/21 19:22:40 miod Exp $ */ /* $NetBSD: auacer.c,v 1.3 2004/11/10 04:20:26 kent Exp $ */ /*- @@ -179,7 +179,7 @@ void auacer_finish_attach(struct device *); static void auacer_reset(struct auacer_softc *sc); -struct audio_hw_if auacer_hw_if = { +const struct audio_hw_if auacer_hw_if = { auacer_open, auacer_close, auacer_set_params, diff --git a/sys/dev/pci/auglx.c b/sys/dev/pci/auglx.c index 8316136cef3..7902c382002 100644 --- a/sys/dev/pci/auglx.c +++ b/sys/dev/pci/auglx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: auglx.c,v 1.19 2022/03/11 18:00:45 mpi Exp $ */ +/* $OpenBSD: auglx.c,v 1.20 2022/03/21 19:22:40 miod Exp $ */ /* * Copyright (c) 2008 Marc Balmer @@ -234,7 +234,7 @@ void auglx_free_prd(struct auglx_softc *sc, struct auglx_ring *bm); int auglx_allocmem(struct auglx_softc *, size_t, size_t, struct auglx_dma *); void auglx_freemem(struct auglx_softc *, struct auglx_dma *); -struct audio_hw_if auglx_hw_if = { +const struct audio_hw_if auglx_hw_if = { auglx_open, auglx_close, auglx_set_params, diff --git a/sys/dev/pci/auich.c b/sys/dev/pci/auich.c index bc27d233f21..f03c0e3bdb1 100644 --- a/sys/dev/pci/auich.c +++ b/sys/dev/pci/auich.c @@ -1,4 +1,4 @@ -/* $OpenBSD: auich.c,v 1.115 2022/03/11 18:00:45 mpi Exp $ */ +/* $OpenBSD: auich.c,v 1.116 2022/03/21 19:22:40 miod Exp $ */ /* * Copyright (c) 2000,2001 Michael Shalayeff @@ -315,7 +315,7 @@ void auich_freemem(struct auich_softc *, struct auich_dma *); void auich_resume(struct auich_softc *); -struct audio_hw_if auich_hw_if = { +const struct audio_hw_if auich_hw_if = { auich_open, auich_close, auich_set_params, diff --git a/sys/dev/pci/auixp.c b/sys/dev/pci/auixp.c index dca3dfa3007..92f57fd2676 100644 --- a/sys/dev/pci/auixp.c +++ b/sys/dev/pci/auixp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: auixp.c,v 1.47 2022/03/11 18:00:45 mpi Exp $ */ +/* $OpenBSD: auixp.c,v 1.48 2022/03/21 19:22:40 miod Exp $ */ /* $NetBSD: auixp.c,v 1.9 2005/06/27 21:13:09 thorpej Exp $ */ /* @@ -154,7 +154,7 @@ void auixp_update_busbusy(struct auixp_softc *); #define DPRINTF(x) #endif -struct audio_hw_if auixp_hw_if = { +const struct audio_hw_if auixp_hw_if = { auixp_open, auixp_close, auixp_set_params, diff --git a/sys/dev/pci/autri.c b/sys/dev/pci/autri.c index 39db4333a40..306aa674509 100644 --- a/sys/dev/pci/autri.c +++ b/sys/dev/pci/autri.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autri.c,v 1.46 2022/03/11 18:00:45 mpi Exp $ */ +/* $OpenBSD: autri.c,v 1.47 2022/03/21 19:22:40 miod Exp $ */ /* * Copyright (c) 2001 SOMEYA Yoshihiko and KUROSAWA Takahiro. @@ -139,7 +139,7 @@ int autri_query_devinfo(void *addr, mixer_devinfo_t *dip); int autri_get_portnum_by_name(struct autri_softc *, char *, char *, char *); -struct audio_hw_if autri_hw_if = { +const struct audio_hw_if autri_hw_if = { autri_open, autri_close, autri_set_params, @@ -171,7 +171,7 @@ int autri_midi_open(void *, int, void (*)(void *, int), void (*)(void *), void *); int autri_midi_output(void *, int); -struct midi_hw_if autri_midi_hw_if = { +const struct midi_hw_if autri_midi_hw_if = { autri_midi_open, autri_midi_close, autri_midi_output, diff --git a/sys/dev/pci/auvia.c b/sys/dev/pci/auvia.c index 8281f448621..a2b7923f3a7 100644 --- a/sys/dev/pci/auvia.c +++ b/sys/dev/pci/auvia.c @@ -1,4 +1,4 @@ -/* $OpenBSD: auvia.c,v 1.62 2022/03/11 18:00:45 mpi Exp $ */ +/* $OpenBSD: auvia.c,v 1.63 2022/03/21 19:22:41 miod Exp $ */ /* $NetBSD: auvia.c,v 1.28 2002/11/04 16:38:49 kent Exp $ */ /*- @@ -178,7 +178,7 @@ const struct cfattach auvia_ca = { #define TIMEOUT 50 -struct audio_hw_if auvia_hw_if = { +const struct audio_hw_if auvia_hw_if = { auvia_open, auvia_close, auvia_set_params, diff --git a/sys/dev/pci/azalia.c b/sys/dev/pci/azalia.c index b3ae4463941..27f799ea4a1 100644 --- a/sys/dev/pci/azalia.c +++ b/sys/dev/pci/azalia.c @@ -1,4 +1,4 @@ -/* $OpenBSD: azalia.c,v 1.270 2022/03/11 18:00:45 mpi Exp $ */ +/* $OpenBSD: azalia.c,v 1.271 2022/03/21 19:22:41 miod Exp $ */ /* $NetBSD: azalia.c,v 1.20 2006/05/07 08:31:44 kent Exp $ */ /*- @@ -289,7 +289,7 @@ struct cfdriver azalia_cd = { NULL, "azalia", DV_DULL, CD_SKIPHIBERNATE }; -struct audio_hw_if azalia_hw_if = { +const struct audio_hw_if azalia_hw_if = { azalia_open, azalia_close, azalia_set_params, diff --git a/sys/dev/pci/bktr/bktr_os.c b/sys/dev/pci/bktr/bktr_os.c index cb266015d07..8b463c49160 100644 --- a/sys/dev/pci/bktr/bktr_os.c +++ b/sys/dev/pci/bktr/bktr_os.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bktr_os.c,v 1.35 2022/03/11 18:00:53 mpi Exp $ */ +/* $OpenBSD: bktr_os.c,v 1.36 2022/03/21 19:22:41 miod Exp $ */ /* $FreeBSD: src/sys/dev/bktr/bktr_os.c,v 1.20 2000/10/20 08:16:53 roger Exp $ */ /* @@ -123,7 +123,7 @@ struct cfdriver bktr_cd = { int bktr_get_info(void *, struct radio_info *); int bktr_set_info(void *, struct radio_info *); -struct radio_hw_if bktr_hw_if = { +const struct radio_hw_if bktr_hw_if = { NULL, /* open */ NULL, /* close */ bktr_get_info, diff --git a/sys/dev/pci/cmpci.c b/sys/dev/pci/cmpci.c index 278400b3042..416db69f4d9 100644 --- a/sys/dev/pci/cmpci.c +++ b/sys/dev/pci/cmpci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmpci.c,v 1.48 2022/03/11 18:00:45 mpi Exp $ */ +/* $OpenBSD: cmpci.c,v 1.49 2022/03/21 19:22:41 miod Exp $ */ /* $NetBSD: cmpci.c,v 1.25 2004/10/26 06:32:20 xtraeme Exp $ */ /* @@ -149,7 +149,7 @@ int cmpci_trigger_input(void *, void *, void *, int, void (*)(void *), void *, struct audio_params *); -struct audio_hw_if cmpci_hw_if = { +const struct audio_hw_if cmpci_hw_if = { cmpci_open, /* open */ cmpci_close, /* close */ cmpci_set_params, /* set_params */ diff --git a/sys/dev/pci/cs4280.c b/sys/dev/pci/cs4280.c index ee0b09132c3..6f8d7f31ea4 100644 --- a/sys/dev/pci/cs4280.c +++ b/sys/dev/pci/cs4280.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cs4280.c,v 1.56 2022/03/11 18:00:45 mpi Exp $ */ +/* $OpenBSD: cs4280.c,v 1.57 2022/03/21 19:22:41 miod Exp $ */ /* $NetBSD: cs4280.c,v 1.5 2000/06/26 04:56:23 simonb Exp $ */ /* @@ -233,7 +233,7 @@ int cs4280_midi_open(void *, int, void (*)(void *, int), int cs4280_midi_output(void *, int); #endif -struct audio_hw_if cs4280_hw_if = { +const struct audio_hw_if cs4280_hw_if = { cs4280_open, cs4280_close, cs4280_set_params, @@ -259,7 +259,7 @@ struct audio_hw_if cs4280_hw_if = { }; #if NMIDI > 0 -struct midi_hw_if cs4280_midi_hw_if = { +const struct midi_hw_if cs4280_midi_hw_if = { cs4280_midi_open, cs4280_midi_close, cs4280_midi_output, diff --git a/sys/dev/pci/cs4281.c b/sys/dev/pci/cs4281.c index 0c9c1d962c4..f8bc2564982 100644 --- a/sys/dev/pci/cs4281.c +++ b/sys/dev/pci/cs4281.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cs4281.c,v 1.41 2022/03/11 18:00:45 mpi Exp $ */ +/* $OpenBSD: cs4281.c,v 1.42 2022/03/21 19:22:41 miod Exp $ */ /* $Tera: cs4281.c,v 1.18 2000/12/27 14:24:45 tacha Exp $ */ /* @@ -194,7 +194,7 @@ int cs4281_debug = 5; #define DPRINTFN(n,x) #endif -struct audio_hw_if cs4281_hw_if = { +const struct audio_hw_if cs4281_hw_if = { cs4281_open, cs4281_close, cs4281_set_params, @@ -227,7 +227,7 @@ int cs4281_midi_open(void *, int, void (*)(void *, int), void (*)(void *), void *); int cs4281_midi_output(void *, int); -struct midi_hw_if cs4281_midi_hw_if = { +const struct midi_hw_if cs4281_midi_hw_if = { cs4281_midi_open, cs4281_midi_close, cs4281_midi_output, diff --git a/sys/dev/pci/eap.c b/sys/dev/pci/eap.c index 9a0eb2a4125..53c8acfae5f 100644 --- a/sys/dev/pci/eap.c +++ b/sys/dev/pci/eap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: eap.c,v 1.60 2022/03/11 18:00:45 mpi Exp $ */ +/* $OpenBSD: eap.c,v 1.61 2022/03/21 19:22:41 miod Exp $ */ /* $NetBSD: eap.c,v 1.46 2001/09/03 15:07:37 reinoud Exp $ */ /* @@ -194,7 +194,7 @@ int eap_midi_open(void *, int, void (*)(void *, int), int eap_midi_output(void *, int); #endif -struct audio_hw_if eap1370_hw_if = { +const struct audio_hw_if eap1370_hw_if = { eap_open, eap_close, eap_set_params, @@ -219,7 +219,7 @@ struct audio_hw_if eap1370_hw_if = { eap_trigger_input }; -struct audio_hw_if eap1371_hw_if = { +const struct audio_hw_if eap1371_hw_if = { eap_open, eap_close, eap_set_params, @@ -245,7 +245,7 @@ struct audio_hw_if eap1371_hw_if = { }; #if NMIDI > 0 -struct midi_hw_if eap_midi_hw_if = { +const struct midi_hw_if eap_midi_hw_if = { eap_midi_open, eap_midi_close, eap_midi_output, @@ -433,7 +433,7 @@ eap_attach(struct device *parent, struct device *self, void *aux) struct eap_softc *sc = (struct eap_softc *)self; struct pci_attach_args *pa = (struct pci_attach_args *)aux; pci_chipset_tag_t pc = pa->pa_pc; - struct audio_hw_if *eap_hw_if; + const struct audio_hw_if *eap_hw_if; char const *intrstr; pci_intr_handle_t ih; mixer_ctrl_t ctl; diff --git a/sys/dev/pci/emuxki.c b/sys/dev/pci/emuxki.c index aeb8e731790..998f722d4a5 100644 --- a/sys/dev/pci/emuxki.c +++ b/sys/dev/pci/emuxki.c @@ -1,4 +1,4 @@ -/* $OpenBSD: emuxki.c,v 1.57 2022/03/11 18:00:45 mpi Exp $ */ +/* $OpenBSD: emuxki.c,v 1.58 2022/03/21 19:22:41 miod Exp $ */ /* $NetBSD: emuxki.c,v 1.1 2001/10/17 18:39:41 jdolecek Exp $ */ /*- @@ -211,7 +211,7 @@ const struct cfattach emu_ca = { emuxki_activate }; -struct audio_hw_if emuxki_hw_if = { +const struct audio_hw_if emuxki_hw_if = { emuxki_open, emuxki_close, emuxki_set_params, diff --git a/sys/dev/pci/envy.c b/sys/dev/pci/envy.c index 04b985cc131..51689997017 100644 --- a/sys/dev/pci/envy.c +++ b/sys/dev/pci/envy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: envy.c,v 1.83 2022/03/11 18:00:45 mpi Exp $ */ +/* $OpenBSD: envy.c,v 1.84 2022/03/21 19:22:41 miod Exp $ */ /* * Copyright (c) 2007 Alexandre Ratchov * @@ -179,7 +179,7 @@ struct cfdriver envy_cd = { NULL, "envy", DV_DULL }; -struct audio_hw_if envy_hw_if = { +const struct audio_hw_if envy_hw_if = { envy_open, /* open */ envy_close, /* close */ envy_set_params, /* set_params */ @@ -205,7 +205,7 @@ struct audio_hw_if envy_hw_if = { }; #if NMIDI > 0 -struct midi_hw_if envy_midi_hw_if = { +const struct midi_hw_if envy_midi_hw_if = { envy_midi_open, envy_midi_close, envy_midi_output, diff --git a/sys/dev/pci/esa.c b/sys/dev/pci/esa.c index 4374f7a63e7..63c864db22f 100644 --- a/sys/dev/pci/esa.c +++ b/sys/dev/pci/esa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: esa.c,v 1.37 2022/03/11 18:00:45 mpi Exp $ */ +/* $OpenBSD: esa.c,v 1.38 2022/03/21 19:22:41 miod Exp $ */ /* $NetBSD: esa.c,v 1.12 2002/03/24 14:17:35 jmcneill Exp $ */ /* @@ -151,7 +151,7 @@ void esa_remove_list(struct esa_voice *, struct esa_list *, int); void esa_suspend(struct esa_softc *); void esa_resume(struct esa_softc *); -struct audio_hw_if esa_hw_if = { +const struct audio_hw_if esa_hw_if = { esa_open, esa_close, esa_set_params, diff --git a/sys/dev/pci/eso.c b/sys/dev/pci/eso.c index 7444529845d..b700ddecbdc 100644 --- a/sys/dev/pci/eso.c +++ b/sys/dev/pci/eso.c @@ -1,4 +1,4 @@ -/* $OpenBSD: eso.c,v 1.49 2022/03/11 18:00:45 mpi Exp $ */ +/* $OpenBSD: eso.c,v 1.50 2022/03/21 19:22:41 miod Exp $ */ /* $NetBSD: eso.c,v 1.48 2006/12/18 23:13:39 kleink Exp $ */ /* @@ -123,7 +123,7 @@ int eso_trigger_input(void *, void *, void *, int, void (*)(void *), void *, struct audio_params *); void eso_setup(struct eso_softc *, int, int); -struct audio_hw_if eso_hw_if = { +const struct audio_hw_if eso_hw_if = { eso_open, eso_close, eso_set_params, diff --git a/sys/dev/pci/fms.c b/sys/dev/pci/fms.c index c242371c6b4..8e18364f857 100644 --- a/sys/dev/pci/fms.c +++ b/sys/dev/pci/fms.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fms.c,v 1.32 2022/03/11 18:00:45 mpi Exp $ */ +/* $OpenBSD: fms.c,v 1.33 2022/03/21 19:22:41 miod Exp $ */ /* $NetBSD: fms.c,v 1.5.4.1 2000/06/30 16:27:50 simonb Exp $ */ /*- @@ -99,7 +99,7 @@ const struct cfattach fms_ca = { sizeof (struct fms_softc), fms_match, fms_attach }; -struct audio_hw_if fms_hw_if = { +const struct audio_hw_if fms_hw_if = { fms_open, fms_close, fms_set_params, diff --git a/sys/dev/pci/fmsradio.c b/sys/dev/pci/fmsradio.c index b87e84818ee..26f34732dd3 100644 --- a/sys/dev/pci/fmsradio.c +++ b/sys/dev/pci/fmsradio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fmsradio.c,v 1.7 2021/11/23 00:17:59 jsg Exp $ */ +/* $OpenBSD: fmsradio.c,v 1.8 2022/03/21 19:22:41 miod Exp $ */ /* * Copyright (c) 2002 Vladimir Popov @@ -136,7 +136,7 @@ int fmsradio_get_info(void *, struct radio_info *); int fmsradio_set_info(void *, struct radio_info *); int fmsradio_search(void *, int); -struct radio_hw_if fmsradio_hw_if = { +const struct radio_hw_if fmsradio_hw_if = { NULL, /* open */ NULL, /* close */ fmsradio_get_info, diff --git a/sys/dev/pci/maestro.c b/sys/dev/pci/maestro.c index 19bc93c07b3..d6ceb0cae2c 100644 --- a/sys/dev/pci/maestro.c +++ b/sys/dev/pci/maestro.c @@ -1,4 +1,4 @@ -/* $OpenBSD: maestro.c,v 1.45 2022/03/11 18:00:50 mpi Exp $ */ +/* $OpenBSD: maestro.c,v 1.46 2022/03/21 19:22:41 miod Exp $ */ /* $FreeBSD: /c/ncvs/src/sys/dev/sound/pci/maestro.c,v 1.3 2000/11/21 12:22:11 julian Exp $ */ /* * FreeBSD's ESS Agogo/Maestro driver @@ -527,7 +527,7 @@ const struct cfattach maestro_ca = { NULL, maestro_activate }; -struct audio_hw_if maestro_hw_if = { +const struct audio_hw_if maestro_hw_if = { maestro_open, maestro_close, maestro_set_params, diff --git a/sys/dev/pci/neo.c b/sys/dev/pci/neo.c index aed3bc2e771..b6f984d26e1 100644 --- a/sys/dev/pci/neo.c +++ b/sys/dev/pci/neo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: neo.c,v 1.36 2022/03/11 18:00:51 mpi Exp $ */ +/* $OpenBSD: neo.c,v 1.37 2022/03/21 19:22:41 miod Exp $ */ /* * Copyright (c) 1999 Cameron Grant @@ -237,7 +237,7 @@ static int samplerates[9] = { /* -------------------------------------------------------------------- */ -struct audio_hw_if neo_hw_if = { +const struct audio_hw_if neo_hw_if = { neo_open, neo_close, neo_set_params, diff --git a/sys/dev/pci/sv.c b/sys/dev/pci/sv.c index 15ddfcbd617..9f902d3d961 100644 --- a/sys/dev/pci/sv.c +++ b/sys/dev/pci/sv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sv.c,v 1.39 2022/03/11 18:00:51 mpi Exp $ */ +/* $OpenBSD: sv.c,v 1.40 2022/03/21 19:22:41 miod Exp $ */ /* * Copyright (c) 1998 Constantine Paul Sapuntzakis @@ -146,7 +146,7 @@ int sv_get_props(void *); void sv_dumpregs(struct sv_softc *sc); -struct audio_hw_if sv_hw_if = { +const struct audio_hw_if sv_hw_if = { sv_open, sv_close, sv_set_params, diff --git a/sys/dev/pci/yds.c b/sys/dev/pci/yds.c index 91eb5a4faff..d4910b587c7 100644 --- a/sys/dev/pci/yds.c +++ b/sys/dev/pci/yds.c @@ -1,4 +1,4 @@ -/* $OpenBSD: yds.c,v 1.58 2022/03/11 18:00:52 mpi Exp $ */ +/* $OpenBSD: yds.c,v 1.59 2022/03/21 19:22:41 miod Exp $ */ /* $NetBSD: yds.c,v 1.5 2001/05/21 23:55:04 minoura Exp $ */ /* @@ -199,7 +199,7 @@ static void yds_dump_play_slot(struct yds_softc *, int); #define YDS_DUMP_PLAY_SLOT(n,sc,bank) #endif /* AUDIO_DEBUG */ -static struct audio_hw_if yds_hw_if = { +const static struct audio_hw_if yds_hw_if = { yds_open, yds_close, yds_set_params, diff --git a/sys/dev/radio.c b/sys/dev/radio.c index 5f916dfd231..fc08c25ddf4 100644 --- a/sys/dev/radio.c +++ b/sys/dev/radio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: radio.c,v 1.11 2016/09/22 00:47:19 jsg Exp $ */ +/* $OpenBSD: radio.c,v 1.12 2022/03/21 19:22:40 miod Exp $ */ /* $RuOBSD: radio.c,v 1.7 2001/12/04 06:03:05 tm Exp $ */ /* @@ -152,7 +152,7 @@ radioioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct proc *p) */ struct device * -radio_attach_mi(struct radio_hw_if *rhwp, void *hdlp, struct device *dev) +radio_attach_mi(const struct radio_hw_if *rhwp, void *hdlp, struct device *dev) { struct audio_attach_args arg; diff --git a/sys/dev/radio_if.h b/sys/dev/radio_if.h index 969a6052eaf..9223d0f09e2 100644 --- a/sys/dev/radio_if.h +++ b/sys/dev/radio_if.h @@ -1,4 +1,4 @@ -/* $OpenBSD: radio_if.h,v 1.3 2002/05/30 15:22:26 mickey Exp $ */ +/* $OpenBSD: radio_if.h,v 1.4 2022/03/21 19:22:40 miod Exp $ */ /* $RuOBSD: radio_if.h,v 1.6 2001/10/18 16:51:36 pva Exp $ */ /* @@ -47,6 +47,7 @@ struct radio_hw_if { int (*search)(void *, int); }; -struct device *radio_attach_mi(struct radio_hw_if *, void *, struct device *); +struct device *radio_attach_mi(const struct radio_hw_if *, void *, + struct device *); #endif /* _SYS_DEV_RADIO_IF_H */ diff --git a/sys/dev/radiovar.h b/sys/dev/radiovar.h index 921f9ec400d..a4b50e92e2c 100644 --- a/sys/dev/radiovar.h +++ b/sys/dev/radiovar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: radiovar.h,v 1.3 2002/01/05 02:23:03 mickey Exp $ */ +/* $OpenBSD: radiovar.h,v 1.4 2022/03/21 19:22:40 miod Exp $ */ /* $RuOBSD: radiovar.h,v 1.3 2001/09/29 17:10:16 pva Exp $ */ /* @@ -33,7 +33,7 @@ struct radio_softc { struct device dev; void *hw_hdl; /* hardware driver handle */ struct device *sc_dev; /* hardware device struct */ - struct radio_hw_if *hw_if; /* hardware interface */ + const struct radio_hw_if *hw_if; /* hardware interface */ char sc_dying; /* device detached */ }; diff --git a/sys/dev/sbus/cs4231.c b/sys/dev/sbus/cs4231.c index 06b090fc736..2672609ae1a 100644 --- a/sys/dev/sbus/cs4231.c +++ b/sys/dev/sbus/cs4231.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cs4231.c,v 1.40 2022/03/13 13:34:54 mpi Exp $ */ +/* $OpenBSD: cs4231.c,v 1.41 2022/03/21 19:22:41 miod Exp $ */ /* * Copyright (c) 1999 Jason L. Wright (jason@thought.net) @@ -151,7 +151,7 @@ int cs4231_trigger_output(void *, void *, void *, int, int cs4231_trigger_input(void *, void *, void *, int, void (*)(void *), void *, struct audio_params *); -struct audio_hw_if cs4231_sa_hw_if = { +const struct audio_hw_if cs4231_sa_hw_if = { cs4231_open, cs4231_close, cs4231_set_params, diff --git a/sys/dev/tc/bba.c b/sys/dev/tc/bba.c index 1c774d5ef6e..840e7e85eda 100644 --- a/sys/dev/tc/bba.c +++ b/sys/dev/tc/bba.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bba.c,v 1.8 2022/02/16 06:21:19 anton Exp $ */ +/* $OpenBSD: bba.c,v 1.9 2022/03/21 19:22:41 miod Exp $ */ /* $NetBSD: bba.c,v 1.38 2011/06/04 01:27:57 tsutsui Exp $ */ /* * Copyright (c) 2011 Miodrag Vallat. @@ -152,7 +152,7 @@ int bba_trigger_output(void *, void *, void *, int, int bba_trigger_input(void *, void *, void *, int, void (*)(void *), void *, struct audio_params *); -struct audio_hw_if bba_hw_if = { +const struct audio_hw_if bba_hw_if = { am7930_open, am7930_close, am7930_set_params, diff --git a/sys/dev/usb/uaudio.c b/sys/dev/usb/uaudio.c index 8dafe8ffe75..3b301fed636 100644 --- a/sys/dev/usb/uaudio.c +++ b/sys/dev/usb/uaudio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uaudio.c,v 1.168 2022/02/21 14:21:58 jsg Exp $ */ +/* $OpenBSD: uaudio.c,v 1.169 2022/03/21 19:22:42 miod Exp $ */ /* * Copyright (c) 2018 Alexandre Ratchov * @@ -468,7 +468,7 @@ const struct cfattach uaudio_ca = { sizeof(struct uaudio_softc), uaudio_match, uaudio_attach, uaudio_detach }; -struct audio_hw_if uaudio_hw_if = { +const struct audio_hw_if uaudio_hw_if = { uaudio_open, /* open */ uaudio_close, /* close */ uaudio_set_params, /* set_params */ diff --git a/sys/dev/usb/udsbr.c b/sys/dev/usb/udsbr.c index 1ba3d96d2e7..3960e03e31d 100644 --- a/sys/dev/usb/udsbr.c +++ b/sys/dev/usb/udsbr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: udsbr.c,v 1.27 2016/11/06 12:58:01 mpi Exp $ */ +/* $OpenBSD: udsbr.c,v 1.28 2022/03/21 19:22:42 miod Exp $ */ /* $NetBSD: udsbr.c,v 1.7 2002/07/11 21:14:27 augustss Exp $ */ /* @@ -65,7 +65,7 @@ int udsbrdebug = 0; int udsbr_get_info(void *, struct radio_info *); int udsbr_set_info(void *, struct radio_info *); -struct radio_hw_if udsbr_hw_if = { +const struct radio_hw_if udsbr_hw_if = { NULL, /* open */ NULL, /* close */ udsbr_get_info, diff --git a/sys/dev/usb/umidi.c b/sys/dev/usb/umidi.c index 9d65d186427..1f4e2cb615c 100644 --- a/sys/dev/usb/umidi.c +++ b/sys/dev/usb/umidi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: umidi.c,v 1.54 2020/07/31 10:49:33 mglocker Exp $ */ +/* $OpenBSD: umidi.c,v 1.55 2022/03/21 19:22:42 miod Exp $ */ /* $NetBSD: umidi.c,v 1.16 2002/07/11 21:14:32 augustss Exp $ */ /* * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -116,7 +116,7 @@ static void out_intr(struct usbd_xfer *, void *, usbd_status); static int out_build_packet(int, struct umidi_packet *, uByte, u_char *); -struct midi_hw_if umidi_hw_if = { +const struct midi_hw_if umidi_hw_if = { umidi_open, umidi_close, umidi_output, diff --git a/sys/dev/usb/utvfu.c b/sys/dev/usb/utvfu.c index 87e9bcee943..7e39c3b9eb7 100644 --- a/sys/dev/usb/utvfu.c +++ b/sys/dev/usb/utvfu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: utvfu.c,v 1.16 2022/02/16 06:21:19 anton Exp $ */ +/* $OpenBSD: utvfu.c,v 1.17 2022/03/21 19:22:42 miod Exp $ */ /* * Copyright (c) 2013 Lubomir Rintel * Copyright (c) 2013 Federico Simoncelli @@ -813,7 +813,7 @@ const struct cfattach utvfu_ca = { NULL }; -struct video_hw_if utvfu_vid_hw_if = { +const struct video_hw_if utvfu_vid_hw_if = { utvfu_open, /* open */ utvfu_close, /* close */ utvfu_querycap, /* VIDIOC_QUERYCAP */ @@ -842,7 +842,7 @@ struct video_hw_if utvfu_vid_hw_if = { utvfu_start_read /* start stream for read */ }; -struct audio_hw_if utvfu_au_hw_if = { +const struct audio_hw_if utvfu_au_hw_if = { utvfu_audio_open, /* open hardware */ utvfu_audio_close, /* close hardware */ utvfu_audio_set_params, diff --git a/sys/dev/usb/uvideo.c b/sys/dev/usb/uvideo.c index 595da2844b8..e5c7425818b 100644 --- a/sys/dev/usb/uvideo.c +++ b/sys/dev/usb/uvideo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvideo.c,v 1.215 2022/01/09 05:43:02 jsg Exp $ */ +/* $OpenBSD: uvideo.c,v 1.216 2022/03/21 19:22:42 miod Exp $ */ /* * Copyright (c) 2008 Robert Nagy @@ -271,7 +271,7 @@ const struct cfattach uvideo_ca = { sizeof(struct uvideo_softc), uvideo_match, uvideo_attach, uvideo_detach }; -struct video_hw_if uvideo_hw_if = { +const struct video_hw_if uvideo_hw_if = { uvideo_open, /* open */ uvideo_close, /* close */ uvideo_querycap, /* VIDIOC_QUERYCAP */ diff --git a/sys/dev/video.c b/sys/dev/video.c index 3ec200e0f37..7319074c27b 100644 --- a/sys/dev/video.c +++ b/sys/dev/video.c @@ -1,4 +1,4 @@ -/* $OpenBSD: video.c,v 1.54 2021/02/17 17:21:58 mglocker Exp $ */ +/* $OpenBSD: video.c,v 1.55 2022/03/21 19:22:40 miod Exp $ */ /* * Copyright (c) 2008 Robert Nagy @@ -46,7 +46,7 @@ struct video_softc { struct device dev; void *hw_hdl; /* hardware driver handle */ struct device *sc_dev; /* hardware device struct */ - struct video_hw_if *hw_if; /* hardware interface */ + const struct video_hw_if *hw_if; /* hardware interface */ char sc_dying; /* device detached */ struct process *sc_owner; /* owner process */ uint8_t sc_open; /* device opened */ @@ -562,7 +562,7 @@ video_submatch(struct device *parent, void *match, void *aux) * probed/attached to the hardware driver */ struct device * -video_attach_mi(struct video_hw_if *rhwp, void *hdlp, struct device *dev) +video_attach_mi(const struct video_hw_if *rhwp, void *hdlp, struct device *dev) { struct video_attach_args arg; diff --git a/sys/dev/video_if.h b/sys/dev/video_if.h index 3f0cbd20352..9c1ba23ab6d 100644 --- a/sys/dev/video_if.h +++ b/sys/dev/video_if.h @@ -1,4 +1,4 @@ -/* $OpenBSD: video_if.h,v 1.18 2014/10/18 08:01:34 armani Exp $ */ +/* $OpenBSD: video_if.h,v 1.19 2022/03/21 19:22:40 miod Exp $ */ /* * Copyright (c) 2008 Robert Nagy * Copyright (c) 2008 Marcus Glocker @@ -63,10 +63,11 @@ struct video_hw_if { }; struct video_attach_args { - void *hwif; + const void *hwif; void *hdl; }; -struct device *video_attach_mi(struct video_hw_if *, void *, struct device *); +struct device *video_attach_mi(const struct video_hw_if *, void *, + struct device *); #endif /* _SYS_DEV_VIDEO_IF_H */