Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/i2c modularize cx24227



details:   https://anonhg.NetBSD.org/src/rev/045f23f1bd77
branches:  trunk
changeset: 767967:045f23f1bd77
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Thu Aug 04 22:24:45 2011 +0000

description:
modularize cx24227

diffstat:

 sys/dev/i2c/cx24227.c |  17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diffs (47 lines):

diff -r 7a035309f3c4 -r 045f23f1bd77 sys/dev/i2c/cx24227.c
--- a/sys/dev/i2c/cx24227.c     Thu Aug 04 22:24:29 2011 +0000
+++ b/sys/dev/i2c/cx24227.c     Thu Aug 04 22:24:45 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cx24227.c,v 1.1 2011/08/04 01:48:34 jakllsch Exp $ */
+/* $NetBSD: cx24227.c,v 1.2 2011/08/04 22:24:45 jmcneill Exp $ */
 
 /*
  * Copyright (c) 2008, 2011 Jonathan A. Kollasch
@@ -27,12 +27,13 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cx24227.c,v 1.1 2011/08/04 01:48:34 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cx24227.c,v 1.2 2011/08/04 22:24:45 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/device.h>
 #include <sys/kmem.h>
+#include <sys/module.h>
 
 #include <dev/i2c/cx24227var.h>
 
@@ -264,7 +265,7 @@
 static int
 cx24227_init(struct cx24227 *sc)
 {
-       int i;
+       unsigned int i;
        uint16_t reg;
 
        cx24227_sleepreset(sc);
@@ -305,3 +306,13 @@
 
        return 0;
 }
+
+MODULE(MODULE_CLASS_DRIVER, cx24227, NULL);
+
+static int
+cx24227_modcmd(modcmd_t cmd, void *priv)
+{
+       if (cmd == MODULE_CMD_INIT || cmd == MODULE_CMD_FINI)
+               return 0;
+       return ENOTTY;
+}



Home | Main Index | Thread Index | Old Index