Module Name: src
Committed By: riastradh
Date: Thu Mar 3 06:23:25 UTC 2022
Modified Files:
src/sys/dev: video.c video_if.h
src/sys/dev/usb: auvitek_video.c pseye.c uvideo.c
Log Message:
video(9): Make softc argument mandatory for video_attach_mi.
No separate video_attach_mi_softc function any more.
To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/dev/video.c
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/video_if.h
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/usb/auvitek_video.c
cvs rdiff -u -r1.28 -r1.29 src/sys/dev/usb/pseye.c
cvs rdiff -u -r1.68 -r1.69 src/sys/dev/usb/uvideo.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/video.c
diff -u src/sys/dev/video.c:1.44 src/sys/dev/video.c:1.45
--- src/sys/dev/video.c:1.44 Thu Mar 3 06:22:23 2022
+++ src/sys/dev/video.c Thu Mar 3 06:23:25 2022
@@ -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 <[email protected]>
@@ -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;
Index: src/sys/dev/video_if.h
diff -u src/sys/dev/video_if.h:1.10 src/sys/dev/video_if.h:1.11
--- src/sys/dev/video_if.h:1.10 Thu Mar 3 06:22:23 2022
+++ src/sys/dev/video_if.h Thu Mar 3 06:23:25 2022
@@ -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 <[email protected]>
@@ -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_ */
Index: src/sys/dev/usb/auvitek_video.c
diff -u src/sys/dev/usb/auvitek_video.c:1.9 src/sys/dev/usb/auvitek_video.c:1.10
--- src/sys/dev/usb/auvitek_video.c:1.9 Tue Jan 22 06:47:20 2019
+++ src/sys/dev/usb/auvitek_video.c Thu Mar 3 06:23:25 2022
@@ -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 <[email protected]>
@@ -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
Index: src/sys/dev/usb/pseye.c
diff -u src/sys/dev/usb/pseye.c:1.28 src/sys/dev/usb/pseye.c:1.29
--- src/sys/dev/usb/pseye.c:1.28 Fri May 22 11:24:31 2020
+++ src/sys/dev/usb/pseye.c Thu Mar 3 06:23:25 2022
@@ -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 <[email protected]>
@@ -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 s
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;
Index: src/sys/dev/usb/uvideo.c
diff -u src/sys/dev/usb/uvideo.c:1.68 src/sys/dev/usb/uvideo.c:1.69
--- src/sys/dev/usb/uvideo.c:1.68 Thu Mar 3 06:22:53 2022
+++ src/sys/dev/usb/uvideo.c Thu Mar 3 06:23:25 2022
@@ -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
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;