Index: uspace/drv/time/cmos-rtc/cmos-rtc.c
===================================================================
--- uspace/drv/time/cmos-rtc/cmos-rtc.c	(revision 923b2eba2c475b653bf61196dd0fb30b0e24c215)
+++ uspace/drv/time/cmos-rtc/cmos-rtc.c	(revision 2a5171dbe0f3ff6b37e1850e41cf8588f6fe41d6)
@@ -68,24 +68,12 @@
 
 
-static int
-rtc_time_get(ddf_fun_t *fun, struct tm *t);
-
-static int
-rtc_time_set(ddf_fun_t *fun, struct tm *t);
-
-static int
-rtc_dev_add(ddf_dev_t *dev);
-
-static int
-rtc_dev_initialize(rtc_t *rtc);
-
-static bool
-rtc_pio_enable(rtc_t *rtc);
-
-static void
-rtc_dev_cleanup(rtc_t *rtc);
-
-static int
-rtc_open(ddf_fun_t *fun);
+static int  rtc_time_get(ddf_fun_t *fun, struct tm *t);
+static int  rtc_time_set(ddf_fun_t *fun, struct tm *t);
+static int  rtc_dev_add(ddf_dev_t *dev);
+static int  rtc_dev_initialize(rtc_t *rtc);
+static bool rtc_pio_enable(rtc_t *rtc);
+static void rtc_dev_cleanup(rtc_t *rtc);
+static int  rtc_open(ddf_fun_t *fun);
+static void rtc_close(ddf_fun_t *fun);
 
 
@@ -117,5 +105,5 @@
 
 	rtc_dev_ops.open = rtc_open;
-	rtc_dev_ops.close = NULL; /* XXX */
+	rtc_dev_ops.close = rtc_close;
 
 	rtc_dev_ops.interfaces[CLOCK_DEV_IFACE] = &rtc_clock_dev_ops;
@@ -349,4 +337,21 @@
 }
 
+/** Close the device
+ *
+ * @param fun  The function node
+ */
+static void
+rtc_close(ddf_fun_t *fun)
+{
+	rtc_t *rtc = RTC_FROM_FNODE(fun);
+
+	fibril_mutex_lock(&rtc->mutex);
+
+	assert(rtc->client_connected);
+	rtc->client_connected = false;
+
+	fibril_mutex_unlock(&rtc->mutex);
+}
+
 int
 main(int argc, char **argv)
