Index: uspace/drv/time/cmos-rtc/cmos-rtc.c
===================================================================
--- uspace/drv/time/cmos-rtc/cmos-rtc.c	(revision 85f20643f5a50d25ca775e64fad72573fcdf8e7d)
+++ uspace/drv/time/cmos-rtc/cmos-rtc.c	(revision bb8f69d4b45d3aceef548d6caaf0303b86194f5e)
@@ -55,4 +55,5 @@
 
 #define RTC_FROM_FNODE(fnode)  ((rtc_t *) ((fnode)->dev->driver_data))
+#define RTC_FROM_DEV(devnode)  ((rtc_t *) ((devnode)->driver_data))
 
 typedef struct rtc {
@@ -69,4 +70,6 @@
 	/** true if a client is connected to the device */
 	bool client_connected;
+	/** true if device is removed */
+	bool removed;
 } rtc_t;
 
@@ -85,4 +88,5 @@
 static void rtc_default_handler(ddf_fun_t *fun,
     ipc_callid_t callid, ipc_call_t *call);
+static int rtc_dev_remove(ddf_dev_t *dev);
 
 
@@ -92,5 +96,5 @@
 static driver_ops_t rtc_ops = {
 	.dev_add = rtc_dev_add,
-	.dev_remove = NULL, /* XXX */
+	.dev_remove = rtc_dev_remove,
 };
 
@@ -394,4 +398,37 @@
 }
 
+/** The dev_remove callback for the rtc driver
+ *
+ * @param dev   The RTC device
+ *
+ * @return      EOK on success or a negative error code
+ */
+static int
+rtc_dev_remove(ddf_dev_t *dev)
+{
+	rtc_t *rtc = RTC_FROM_DEV(dev);
+	int rc;
+
+	fibril_mutex_lock(&rtc->mutex);
+	if (rtc->client_connected) {
+		fibril_mutex_unlock(&rtc->mutex);
+		return EBUSY;
+	}
+
+	rtc->removed = true;
+	fibril_mutex_unlock(&rtc->mutex);
+
+	rc = ddf_fun_unbind(rtc->fun);
+	if (rc != EOK) {
+		ddf_msg(LVL_ERROR, "Failed to unbind function");
+		return rc;
+	}
+
+	ddf_fun_destroy(rtc->fun);
+	rtc_dev_cleanup(rtc);
+
+	return rc;
+}
+
 /** Default handler for client requests not handled
  *  by the standard interface
@@ -430,5 +467,7 @@
 
 	if (rtc->client_connected)
-		rc = EBUSY;
+		rc = ELIMIT;
+	else if (rtc->removed)
+		rc = ENXIO;
 	else {
 		rc = EOK;
