summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2009-10-05 18:59:37 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2009-10-05 18:59:37 +0000
commit29452034d1c8798d9724795177c9678f7f7913ad (patch)
tree19b0a42b87e6e194dadffd39d78aed6036f05d6d /sys
parentf7709a16f4d20f26d84497c07c17feb8817d5ac4 (diff)
match() function was leaving the i2c bus locked; ok kettenis
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/i2c/rs5c372.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/dev/i2c/rs5c372.c b/sys/dev/i2c/rs5c372.c
index 04eb2942469..5f5c67d6de2 100644
--- a/sys/dev/i2c/rs5c372.c
+++ b/sys/dev/i2c/rs5c372.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rs5c372.c,v 1.4 2008/04/17 16:50:17 deraadt Exp $ */
+/* $OpenBSD: rs5c372.c,v 1.5 2009/10/05 18:59:36 deraadt Exp $ */
/* $NetBSD: rs5c372.c,v 1.5 2006/03/29 06:41:24 thorpej Exp $ */
/*
@@ -136,6 +136,7 @@ ricohrtc_match(struct device *parent, void *v, void *arg)
return (0);
}
if ((data & ~RICOHRTC_SECONDS_MASK) != 0) {
+ iic_release_bus(ia->ia_tag, I2C_F_POLL);
printf("ricohrtc second %d\n",data);
return (0);
}
@@ -149,6 +150,7 @@ ricohrtc_match(struct device *parent, void *v, void *arg)
}
if ((data & ~RICOHRTC_MINUTES_MASK) != 0) {
+ iic_release_bus(ia->ia_tag, I2C_F_POLL);
printf("ricohrtc minute %d\n",data);
return (0);
}
@@ -161,12 +163,13 @@ ricohrtc_match(struct device *parent, void *v, void *arg)
return (0);
}
if ((data & ~RICOHRTC_HOURS_24MASK) != 0) {
+ iic_release_bus(ia->ia_tag, I2C_F_POLL);
printf("ricohrtc hour %d\n",data);
return (0);
}
-#endif
-
iic_release_bus(ia->ia_tag, I2C_F_POLL);
+
+#endif
return (1);
}