summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorriastradh <riastradh@NetBSD.org>2022-03-03 06:23:25 +0000
committerriastradh <riastradh@NetBSD.org>2022-03-03 06:23:25 +0000
commitfe7af6a69e5ac963cd82e33e0eaf8a33114566de (patch)
tree9bc9185af09ae9ebf4c5e200248775e6801839c1 /sys/dev
parentb03b57717de9ba1dee4ff1bbbce2d2b99d98d6d3 (diff)
video(9): Make softc argument mandatory for video_attach_mi.
No separate video_attach_mi_softc function any more.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/usb/auvitek_video.c9
-rw-r--r--sys/dev/usb/pseye.c6
-rw-r--r--sys/dev/usb/uvideo.c8
-rw-r--r--sys/dev/video.c18
-rw-r--r--sys/dev/video_if.h5
5 files changed, 17 insertions, 29 deletions
diff --git a/sys/dev/usb/auvitek_video.c b/sys/dev/usb/auvitek_video.c
index 3c723697ea2..a5822c38e09 100644
--- a/sys/dev/usb/auvitek_video.c
+++ b/sys/dev/usb/auvitek_video.c
@@ -1,4 +1,4 @@
-/* $NetBSD: auvitek_video.c,v 1.9 2019/01/22 06:47:20 skrll Exp $ */
+/* $NetBSD: auvitek_video.c,v 1.10 2022/03/03 06:23:25 riastradh Exp $ */
/*-
* Copyright (c) 2010 Jared D. McNeill <jmcneill@invisible.ca>
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: auvitek_video.c,v 1.9 2019/01/22 06:47:20 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: auvitek_video.c,v 1.10 2022/03/03 06:23:25 riastradh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -152,9 +152,10 @@ void
auvitek_video_rescan(struct auvitek_softc *sc, const char *ifattr,
const int *locs)
{
- if (ifattr_match(ifattr, "videobus") && sc->sc_videodev == NULL)
+ if (ifattr_match(ifattr, "videobus") && sc->sc_videodev == NULL) {
sc->sc_videodev = video_attach_mi(&auvitek_video_if,
- sc->sc_dev);
+ sc->sc_dev, sc);
+ }
}
void
diff --git a/sys/dev/usb/pseye.c b/sys/dev/usb/pseye.c
index 782a79ee043..5caf2d249e6 100644
--- a/sys/dev/usb/pseye.c
+++ b/sys/dev/usb/pseye.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pseye.c,v 1.28 2020/05/22 11:24:31 jmcneill Exp $ */
+/* $NetBSD: pseye.c,v 1.29 2022/03/03 06:23:25 riastradh Exp $ */
/*-
* Copyright (c) 2008 Jared D. McNeill <jmcneill@invisible.ca>
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pseye.c,v 1.28 2020/05/22 11:24:31 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pseye.c,v 1.29 2022/03/03 06:23:25 riastradh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -263,7 +263,7 @@ pseye_attach(device_t parent, device_t self, void *opaque)
if (!pmf_device_register(self, NULL, NULL))
aprint_error_dev(self, "couldn't establish power handler\n");
- sc->sc_videodev = video_attach_mi(&pseye_hw_if, self);
+ sc->sc_videodev = video_attach_mi(&pseye_hw_if, self, sc);
if (sc->sc_videodev == NULL) {
aprint_error_dev(self, "couldn't attach video layer\n");
sc->sc_dying = 1;
diff --git a/sys/dev/usb/uvideo.c b/sys/dev/usb/uvideo.c
index 8a60ac04727..6ddcf22f6ae 100644
--- a/sys/dev/usb/uvideo.c
+++ b/sys/dev/usb/uvideo.c
@@ -1,4 +1,4 @@
-/* $NetBSD: uvideo.c,v 1.68 2022/03/03 06:22:53 riastradh Exp $ */
+/* $NetBSD: uvideo.c,v 1.69 2022/03/03 06:23:25 riastradh Exp $ */
/*
* Copyright (c) 2008 Patrick Mahoney
@@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvideo.c,v 1.68 2022/03/03 06:22:53 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvideo.c,v 1.69 2022/03/03 06:23:25 riastradh Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -603,8 +603,8 @@ uvideo_attach(device_t parent, device_t self, void *aux)
SLIST_FOREACH(vs, &sc->sc_stream_list, entries) {
/* XXX initialization of vs_videodev is racy */
- vs->vs_videodev = video_attach_mi_softc(&uvideo_hw_if,
- sc->sc_dev, vs);
+ vs->vs_videodev = video_attach_mi(&uvideo_hw_if, sc->sc_dev,
+ vs);
}
return;
diff --git a/sys/dev/video.c b/sys/dev/video.c
index 55cf76e92fb..c6d82f5d834 100644
--- a/sys/dev/video.c
+++ b/sys/dev/video.c
@@ -1,4 +1,4 @@
-/* $NetBSD: video.c,v 1.44 2022/03/03 06:22:23 riastradh Exp $ */
+/* $NetBSD: video.c,v 1.45 2022/03/03 06:23:25 riastradh Exp $ */
/*
* Copyright (c) 2008 Patrick Mahoney <pat@polycrystal.org>
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: video.c,v 1.44 2022/03/03 06:22:23 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: video.c,v 1.45 2022/03/03 06:23:25 riastradh Exp $");
#include "video.h"
#if NVIDEO > 0
@@ -428,19 +428,7 @@ video_print(void *aux, const char *pnp)
* gets probed/attached to the hardware driver.
*/
device_t
-video_attach_mi(const struct video_hw_if *hw_if, device_t parent)
-{
- struct video_attach_args args;
-
- args.hw_if = hw_if;
- args.hw_softc = device_private(parent);
- return config_found(parent, &args, video_print,
- CFARGS(.iattr = "videobus"));
-}
-
-device_t
-video_attach_mi_softc(const struct video_hw_if *hw_if, device_t parent,
- void *sc)
+video_attach_mi(const struct video_hw_if *hw_if, device_t parent, void *sc)
{
struct video_attach_args args;
diff --git a/sys/dev/video_if.h b/sys/dev/video_if.h
index 5b9de429840..91ff6c2240d 100644
--- a/sys/dev/video_if.h
+++ b/sys/dev/video_if.h
@@ -1,4 +1,4 @@
-/* $NetBSD: video_if.h,v 1.10 2022/03/03 06:22:23 riastradh Exp $ */
+/* $NetBSD: video_if.h,v 1.11 2022/03/03 06:23:25 riastradh Exp $ */
/*
* Copyright (c) 2008 Patrick Mahoney <pat@polycrystal.org>
@@ -504,8 +504,7 @@ struct video_attach_args {
void *hw_softc;
};
-device_t video_attach_mi(const struct video_hw_if *, device_t);
-device_t video_attach_mi_softc(const struct video_hw_if *, device_t, void *);
+device_t video_attach_mi(const struct video_hw_if *, device_t, void *);
void video_submit_payload(device_t, const struct video_payload *);
#endif /* _SYS_DEV_VIDEO_IF_H_ */