Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/i2c ihidev(4): Add missing includes and header guard.



details:   https://anonhg.NetBSD.org/src/rev/a736c6a1f531
branches:  trunk
changeset: 359619:a736c6a1f531
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Fri Jan 14 21:32:27 2022 +0000

description:
ihidev(4): Add missing includes and header guard.

Mark the sections that are conventionally separate files for hardware
interface (*reg.h) versus software state (*var.h).

diffstat:

 sys/dev/i2c/ihidev.h |  19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)

diffs (51 lines):

diff -r 9a4ba3b9416b -r a736c6a1f531 sys/dev/i2c/ihidev.h
--- a/sys/dev/i2c/ihidev.h      Fri Jan 14 19:44:04 2022 +0000
+++ b/sys/dev/i2c/ihidev.h      Fri Jan 14 21:32:27 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ihidev.h,v 1.4 2020/01/09 04:04:01 thorpej Exp $ */
+/* $NetBSD: ihidev.h,v 1.5 2022/01/14 21:32:27 riastradh Exp $ */
 /* $OpenBSD ihidev.h,v 1.4 2016/01/31 18:24:35 jcs Exp $ */
 
 /*-
@@ -30,6 +30,11 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
+#ifndef        _DEV_I2C_IHIDEV_H_
+#define        _DEV_I2C_IHIDEV_H_
+
+/* ihidevreg.h */
+
 /*
  * HID-over-i2c driver
  *
@@ -48,6 +53,8 @@
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
+#include <sys/types.h>
+
 /* from usbdi.h: Match codes. */
 /* First five codes is for a whole device. */
 #define IMATCH_VENDOR_PRODUCT_REV                      14
@@ -93,6 +100,15 @@
        uint32_t reserved;
 } __packed;
 
+/* ihidevvar.h */
+
+#include <sys/types.h>
+
+#include <sys/device.h>
+#include <sys/mutex.h>
+
+#include <dev/i2c/i2cvar.h>
+
 struct ihidev_softc {
        device_t        sc_dev;
        i2c_tag_t       sc_tag;
@@ -160,3 +176,4 @@
 int ihidev_get_report(device_t, int, int, void *, int);
 int ihidev_report_type_conv(int);
 
+#endif /* _DEV_I2C_IHIDEV_H_ */



Home | Main Index | Thread Index | Old Index