Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755560AbYBVJ2y (ORCPT ); Fri, 22 Feb 2008 04:28:54 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751321AbYBVJ2m (ORCPT ); Fri, 22 Feb 2008 04:28:42 -0500 Received: from twin.jikos.cz ([213.151.79.26]:45489 "EHLO twin.jikos.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751197AbYBVJ2k (ORCPT ); Fri, 22 Feb 2008 04:28:40 -0500 Date: Fri, 22 Feb 2008 10:28:32 +0100 (CET) From: Jiri Kosina X-X-Sender: jikos@twin.jikos.cz To: Pioz cc: linux-kernel@vger.kernel.org Subject: Re: Keyboard interrupt - request_irq() In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1282 Lines: 35 On Thu, 21 Feb 2008, Pioz wrote: > 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): [ ... ] > res = request_irq (1, irq_myhandler, IRQF_SHARED, "bao", dev_id); [ ... ] > 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... The check in setup_irq() very probably triggers for you: /* * Can't share interrupts unless both agree to and are * the same type (level, edge, polarity). So both flag * fields must have IRQF_SHARED set and the bits which * set the trigger type must match. */ if (!((old->flags & new->flags) & IRQF_SHARED) || ((old->flags ^ new->flags) & IRQF_TRIGGER_MASK)) { old_name = old->name; goto mismatch; } -- Jiri Kosina SUSE Labs -- 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/