Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev video(9): Make softc argument mandatory for video_at...
details: https://anonhg.NetBSD.org/src/rev/8524071b0400
branches: trunk
changeset: 362579:8524071b0400
user: riastradh <riastradh%NetBSD.org@localhost>
date: Thu Mar 03 06:23:25 2022 +0000
description:
video(9): Make softc argument mandatory for video_attach_mi.
No separate video_attach_mi_softc function any more.
diffstat:
sys/dev/usb/auvitek_video.c | 9 +++++----
sys/dev/usb/pseye.c | 6 +++---
sys/dev/usb/uvideo.c | 8 ++++----
sys/dev/video.c | 18 +++---------------
sys/dev/video_if.h | 5 ++---
5 files changed, 17 insertions(+), 29 deletions(-)
diffs (145 lines):
diff -r e1e7895b9ea7 -r 8524071b0400 sys/dev/usb/auvitek_video.c
--- a/sys/dev/usb/auvitek_video.c Thu Mar 03 06:22:53 2022 +0000
+++ b/sys/dev/usb/auvitek_video.c Thu Mar 03 06:23:25 2022 +0000
@@ -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@localhost>
@@ -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 @@
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 -r e1e7895b9ea7 -r 8524071b0400 sys/dev/usb/pseye.c
--- a/sys/dev/usb/pseye.c Thu Mar 03 06:22:53 2022 +0000
+++ b/sys/dev/usb/pseye.c Thu Mar 03 06:23:25 2022 +0000
@@ -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@localhost>
@@ -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 @@
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 -r e1e7895b9ea7 -r 8524071b0400 sys/dev/usb/uvideo.c
--- a/sys/dev/usb/uvideo.c Thu Mar 03 06:22:53 2022 +0000
+++ b/sys/dev/usb/uvideo.c Thu Mar 03 06:23:25 2022 +0000
@@ -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 @@
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 -r e1e7895b9ea7 -r 8524071b0400 sys/dev/video.c
--- a/sys/dev/video.c Thu Mar 03 06:22:53 2022 +0000
+++ b/sys/dev/video.c Thu Mar 03 06:23:25 2022 +0000
@@ -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@localhost>
@@ -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 @@
* 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 -r e1e7895b9ea7 -r 8524071b0400 sys/dev/video_if.h
--- a/sys/dev/video_if.h Thu Mar 03 06:22:53 2022 +0000
+++ b/sys/dev/video_if.h Thu Mar 03 06:23:25 2022 +0000
@@ -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@localhost>
@@ -504,8 +504,7 @@
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_ */
Home |
Main Index |
Thread Index |
Old Index