Index: kernel/generic/src/console/kconsole.c
===================================================================
--- kernel/generic/src/console/kconsole.c	(revision e9d15d9f0efb393d698245b131a15268dc1cd68f)
+++ kernel/generic/src/console/kconsole.c	(revision 24abb85d299db39cc03f429adc41bb1ed4f23e23)
@@ -55,5 +55,4 @@
 #include <str.h>
 #include <sysinfo/sysinfo.h>
-#include <ddi/device.h>
 #include <symtab.h>
 #include <errno.h>
Index: kernel/generic/src/ddi/device.c
===================================================================
--- kernel/generic/src/ddi/device.c	(revision e9d15d9f0efb393d698245b131a15268dc1cd68f)
+++ 	(revision )
@@ -1,63 +1,0 @@
-/*
- * Copyright (c) 2006 Jakub Jermar
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup genericddi
- * @{
- */
-/**
- * @file
- * @brief Device numbers.
- */
-
-#include <assert.h>
-#include <typedefs.h>
-#include <ddi/device.h>
-#include <atomic.h>
-#include <debug.h>
-
-static atomic_t last;
-
-/** Assign new device number.
- *
- * @return Unique device number.
- */
-devno_t device_assign_devno(void)
-{
-	devno_t devno = (devno_t) atomic_postinc(&last);
-	assert(devno >= 0);
-	
-	return devno;
-}
-
-sysarg_t sys_device_assign_devno(void)
-{
-	return (sysarg_t) device_assign_devno();
-}
-
-/** @}
- */
Index: kernel/generic/src/ddi/irq.c
===================================================================
--- kernel/generic/src/ddi/irq.c	(revision e9d15d9f0efb393d698245b131a15268dc1cd68f)
+++ kernel/generic/src/ddi/irq.c	(revision 24abb85d299db39cc03f429adc41bb1ed4f23e23)
@@ -59,7 +59,8 @@
  * Note about the irq_hash_table.
  *
- * The hash table is configured to use two keys: inr and devno.  However, the
- * hash index is computed only from inr. Moreover, if devno is -1, the match is
- * based on the return value of the claim() function instead of on devno.
+ * The hash table is configured to use two keys: inr and mode.  However, the
+ * hash index is computed only from inr. Moreover, if mode is IRQ_HT_MODE_CLAIM,
+ * the match is based also on the return value of the claim(). Otherwise the
+ * the keys do not match.
  */
 
@@ -73,7 +74,4 @@
 #include <mem.h>
 #include <arch.h>
-
-#define KEY_INR    0
-#define KEY_DEVNO  1
 
 /** Spinlock protecting the kernel IRQ hash table.
@@ -174,5 +172,4 @@
 	link_initialize(&irq->notif_cfg.link);
 	irq->inr = -1;
-	irq->devno = -1;
 	
 	irq_initialize_arch(irq);
@@ -190,6 +187,6 @@
 {
 	sysarg_t key[] = {
-		(sysarg_t) irq->inr,
-		(sysarg_t) irq->devno
+		[IRQ_HT_KEY_INR] = (sysarg_t) irq->inr,
+		[IRQ_HT_KEY_MODE] = (sysarg_t) IRQ_HT_MODE_NO_CLAIM 
 	};
 	
@@ -208,6 +205,6 @@
 	link_t *lnk;
 	sysarg_t key[] = {
-		(sysarg_t) inr,
-		(sysarg_t) -1    /* Search will use claim() instead of devno */
+		[IRQ_HT_KEY_INR] = (sysarg_t) inr,
+		[IRQ_HT_KEY_MODE] = (sysarg_t) IRQ_HT_MODE_CLAIM
 	};
 	
@@ -231,6 +228,6 @@
 	link_t *lnk;
 	sysarg_t key[] = {
-		(sysarg_t) inr,
-		(sysarg_t) -1    /* Search will use claim() instead of devno */
+		[IRQ_HT_KEY_INR] = (sysarg_t) inr,
+		[IRQ_HT_KEY_MODE] = (sysarg_t) IRQ_HT_MODE_CLAIM
 	};
 	
@@ -290,7 +287,7 @@
  * be collisions between different INRs.
  *
- * The devno is not used to compute the hash.
- *
- * @param key The first of the keys is inr and the second is devno or -1.
+ * The mode is not used to compute the hash.
+ *
+ * @param key The first of the keys is inr and the second is mode.
  *
  * @return Index into the hash table.
@@ -299,5 +296,5 @@
 size_t irq_ht_hash(sysarg_t key[])
 {
-	inr_t inr = (inr_t) key[KEY_INR];
+	inr_t inr = (inr_t) key[IRQ_HT_KEY_INR];
 	return inr % buckets;
 }
@@ -308,11 +305,11 @@
  * more complex architecture setup in which there are way too many interrupt
  * numbers (i.e. inr's) to arrange the hash table so that collisions occur only
- * among same inrs of different devnos. So the explicit check for inr match must
- * be done.  Second, if devno is -1, the second key (i.e. devno) is not used for
- * the match and the result of the claim() function is used instead.
+ * among same inrs of different devices. So the explicit check for inr match
+ * must be done.  Second, if mode is IRQ_HT_MODE_CLAIM, the result of the
+ * claim() function is used for the match. Otherwise the key does not match.
  *
  * This function assumes interrupts are already disabled.
  *
- * @param key  Keys (i.e. inr and devno).
+ * @param key  Keys (i.e. inr and mode).
  * @param keys This is 2. 
  * @param item The item to compare the key with.
@@ -325,17 +322,16 @@
 {
 	irq_t *irq = hash_table_get_instance(item, irq_t, link);
-	inr_t inr = (inr_t) key[KEY_INR];
-	devno_t devno = (devno_t) key[KEY_DEVNO];
+	inr_t inr = (inr_t) key[IRQ_HT_KEY_INR];
+	irq_ht_mode_t mode = (irq_ht_mode_t) key[IRQ_HT_KEY_MODE];
 	
 	bool rv;
 	
 	irq_spinlock_lock(&irq->lock, false);
-	if (devno == -1) {
+	if (mode == IRQ_HT_MODE_CLAIM) {
 		/* Invoked by irq_dispatch_and_lock(). */
-		rv = ((irq->inr == inr) &&
-		    (irq->claim(irq) == IRQ_ACCEPT));
+		rv = ((irq->inr == inr) && (irq->claim(irq) == IRQ_ACCEPT));
 	} else {
 		/* Invoked by irq_find_and_lock(). */
-		rv = ((irq->inr == inr) && (irq->devno == devno));
+		rv = false;
 	}
 	
@@ -363,5 +359,5 @@
  * no collisions between different INRs.
  *
- * @param key The first of the keys is inr and the second is devno or -1.
+ * @param key The first of the keys is inr and the second is mode.
  *
  * @return Index into the hash table.
@@ -370,5 +366,5 @@
 size_t irq_lin_hash(sysarg_t key[])
 {
-	inr_t inr = (inr_t) key[KEY_INR];
+	inr_t inr = (inr_t) key[IRQ_HT_KEY_INR];
 	return inr;
 }
@@ -385,5 +381,5 @@
  * This function assumes interrupts are already disabled.
  *
- * @param key  Keys (i.e. inr and devno).
+ * @param key  Keys (i.e. inr and mode).
  * @param keys This is 2. 
  * @param item The item to compare the key with.
@@ -396,14 +392,14 @@
 {
 	irq_t *irq = list_get_instance(item, irq_t, link);
-	devno_t devno = (devno_t) key[KEY_DEVNO];
+	irq_ht_mode_t mode = (irq_ht_mode_t) key[IRQ_HT_KEY_MODE];
 	bool rv;
 	
 	irq_spinlock_lock(&irq->lock, false);
-	if (devno == -1) {
+	if (mode == IRQ_HT_MODE_CLAIM) {
 		/* Invoked by irq_dispatch_and_lock() */
 		rv = (irq->claim(irq) == IRQ_ACCEPT);
 	} else {
 		/* Invoked by irq_find_and_lock() */
-		rv = (irq->devno == devno);
+		rv = false;
 	}
 	
Index: kernel/generic/src/ipc/irq.c
===================================================================
--- kernel/generic/src/ipc/irq.c	(revision e9d15d9f0efb393d698245b131a15268dc1cd68f)
+++ kernel/generic/src/ipc/irq.c	(revision 24abb85d299db39cc03f429adc41bb1ed4f23e23)
@@ -294,5 +294,4 @@
  * @param box     Receiving answerbox.
  * @param inr     IRQ number.
- * @param devno   Device number.
  * @param imethod Interface and method to be associated with the
  *                notification.
@@ -303,10 +302,10 @@
  *
  */
-int ipc_irq_subscribe(answerbox_t *box, inr_t inr, devno_t devno,
-    sysarg_t imethod, irq_code_t *ucode)
+int ipc_irq_subscribe(answerbox_t *box, inr_t inr, sysarg_t imethod,
+    irq_code_t *ucode)
 {
 	sysarg_t key[] = {
-		(sysarg_t) inr,
-		(sysarg_t) devno
+		[IRQ_HT_KEY_INR] = (sysarg_t) inr,
+		[IRQ_HT_KEY_MODE] = (sysarg_t) IRQ_HT_MODE_NO_CLAIM
 	};
 	
@@ -334,5 +333,4 @@
 	irq_t *irq = &kobj->irq;
 	irq_initialize(irq);
-	irq->devno = devno;
 	irq->inr = inr;
 	irq->claim = ipc_irq_top_half_claim;
@@ -349,19 +347,4 @@
 	 */
 	irq_spinlock_lock(&irq_uspace_hash_table_lock, true);
-	
-	link_t *hlp = hash_table_find(&irq_uspace_hash_table, key);
-	if (hlp) {
-		irq_t *hirq = hash_table_get_instance(hlp, irq_t, link);
-		
-		/* hirq is locked */
-		irq_spinlock_unlock(&hirq->lock, false);
-		code_free(code);
-		irq_spinlock_unlock(&irq_uspace_hash_table_lock, true);
-		
-		kobject_free(TASK, cap);
-		return EEXIST;
-	}
-	
-	/* Locking is not really necessary, but paranoid */
 	irq_spinlock_lock(&irq->lock, false);
 	irq_spinlock_lock(&box->irq_lock, false);
Index: kernel/generic/src/ipc/sysipc.c
===================================================================
--- kernel/generic/src/ipc/sysipc.c	(revision e9d15d9f0efb393d698245b131a15268dc1cd68f)
+++ kernel/generic/src/ipc/sysipc.c	(revision 24abb85d299db39cc03f429adc41bb1ed4f23e23)
@@ -801,5 +801,4 @@
  *
  * @param inr     IRQ number.
- * @param devno   Device number.
  * @param imethod Interface and method to be associated with the notification.
  * @param ucode   Uspace pointer to the top-half pseudocode.
@@ -810,11 +809,10 @@
  *
  */
-sysarg_t sys_ipc_irq_subscribe(inr_t inr, devno_t devno, sysarg_t imethod,
-    irq_code_t *ucode)
+sysarg_t sys_ipc_irq_subscribe(inr_t inr, sysarg_t imethod, irq_code_t *ucode)
 {
 	if (!(perm_get(TASK) & PERM_IRQ_REG))
 		return EPERM;
 	
-	return ipc_irq_subscribe(&TASK->answerbox, inr, devno, imethod, ucode);
+	return ipc_irq_subscribe(&TASK->answerbox, inr, imethod, ucode);
 }
 
Index: kernel/generic/src/syscall/syscall.c
===================================================================
--- kernel/generic/src/syscall/syscall.c	(revision e9d15d9f0efb393d698245b131a15268dc1cd68f)
+++ kernel/generic/src/syscall/syscall.c	(revision 24abb85d299db39cc03f429adc41bb1ed4f23e23)
@@ -45,5 +45,4 @@
 #include <arch.h>
 #include <debug.h>
-#include <ddi/device.h>
 #include <interrupt.h>
 #include <ipc/sysipc.h>
@@ -175,5 +174,4 @@
 	
 	/* DDI related syscalls. */
-	[SYS_DEVICE_ASSIGN_DEVNO] = (syshandler_t) sys_device_assign_devno,
 	[SYS_PHYSMEM_MAP] = (syshandler_t) sys_physmem_map,
 	[SYS_PHYSMEM_UNMAP] = (syshandler_t) sys_physmem_unmap,
