Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934777AbYBUQEp (ORCPT ); Thu, 21 Feb 2008 11:04:45 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S933383AbYBUQEJ (ORCPT ); Thu, 21 Feb 2008 11:04:09 -0500 Received: from nf-out-0910.google.com ([64.233.182.185]:6958 "EHLO nf-out-0910.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1763874AbYBUQEH (ORCPT ); Thu, 21 Feb 2008 11:04:07 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=KsKbY/q7lblv7bpGNEuwd3X7XihsE234OWXvWuho9fdsPNdkDebZ/j0/xiqiHSW17v31B/oXESJyIHOh20jr1EXOQi6ZXwCRToTAXvvtRgC1h/ylgidijako9SjvrnM1WB32LD7Jv7+aMR6exch3EMBJrhbbsW0yMMJ6WgGWyZU= Message-ID: Date: Thu, 21 Feb 2008 17:04:04 +0100 From: Pioz To: linux-kernel@vger.kernel.org Subject: Keyboard interrupt - request_irq() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1096 Lines: 46 Hi all, I have a problem. I want handle the keyboard interrupt and for this purpose I have write this module (I have kernel 2.6.23): #include #include #include [...] irqreturn_t irq_myhandler (int irqn, void *dev) { printk (KERN_INFO "Key pressed...\n"); return IRQ_HANDLED; } int init_module () { int res; printk (KERN_INFO "Hello World!\n"); free_irq (1, NULL); res = request_irq (1, irq_myhandler, IRQF_SHARED, "bao", dev_id); printk (KERN_INFO "res: %d\n", res); return 0; } void cleanup_module () { free_irq (1, NULL); printk (KERN_INFO "Goodbye World!\n"); } The return value of request_irq() function is -EBUSY. Why? Is the default handler? How can I do to change handler with my function? Thanks... -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/