From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758267Ab1IHKww (ORCPT ); Thu, 8 Sep 2011 06:52:52 -0400 Received: from out4.smtp.messagingengine.com ([66.111.4.28]:36975 "EHLO out4.smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758223Ab1IHKwu (ORCPT ); Thu, 8 Sep 2011 06:52:50 -0400 X-Sasl-enc: nK1LlMYYRtIazjtA7S4XSBbH+qPY7psgmWFuQUs6HHww 1315479169 Message-ID: <4E689E9A.8000407@ladisch.de> Date: Thu, 08 Sep 2011 12:53:14 +0200 From: Clemens Ladisch User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) MIME-Version: 1.0 To: Yong Zhang CC: linux-kernel@vger.kernel.org, tglx@linutronix.de, mingo@elte.hu, Jaroslav Kysela , Takashi Iwai , =?UTF-8?B?VXdlIEtsZWluZS1Lw7ZuaWc=?= , Jiri Kosina , Andreas Mohr , Lucas De Marchi , Julia Lawall , Ondrej Zary , Dan Carpenter , Joe Perches , alsa-devel@alsa-project.org Subject: Re: [RFC] [PATCH 02/62] mpu401:snd_mpu401_uart_new(): split semantic of irq_flags References: <1315383059-3673-1-git-send-email-yong.zhang0@gmail.com> <1315383059-3673-3-git-send-email-yong.zhang0@gmail.com> In-Reply-To: <1315383059-3673-3-git-send-email-yong.zhang0@gmail.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Yong Zhang wrote: > Now snd_mpu401_uart_new() parameter 'irq_flags' take two role > in it: one is the condition to request_irq and the other is > the real irq_flags which will be transfered to request_irq(). > > So add another parameter 'want_irq' to take the role of the > first one, this will make it easy to remove IRQF_DISABLED. Please note that the irq number is also intended to pass this information: > * @irq: the irq number, -1 if no interrupt for mpu > ... > - if (irq >= 0 && irq_flags) { > if (request_irq(irq, snd_mpu401_uart_interrupt, irq_flags, Of course, most of snd_mpu401_uart_new()'s users get this wrong and use 0 instead of -1, relying on the irq_flags parameter only. But if these are fixed to use irq == -1, we get the same effect without having to introduce another parameter. Regards, Clemens From mboxrd@z Thu Jan 1 00:00:00 1970 From: Clemens Ladisch Subject: Re: [RFC] [PATCH 02/62] mpu401:snd_mpu401_uart_new(): split semantic of irq_flags Date: Thu, 08 Sep 2011 12:53:14 +0200 Message-ID: <4E689E9A.8000407@ladisch.de> References: <1315383059-3673-1-git-send-email-yong.zhang0@gmail.com> <1315383059-3673-3-git-send-email-yong.zhang0@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by alsa0.perex.cz (Postfix) with ESMTP id D366824A03 for ; Thu, 8 Sep 2011 12:52:50 +0200 (CEST) In-Reply-To: <1315383059-3673-3-git-send-email-yong.zhang0@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Yong Zhang Cc: alsa-devel@alsa-project.org, Ondrej Zary , Dan Carpenter , Takashi Iwai , Jiri Kosina , linux-kernel@vger.kernel.org, Andreas Mohr , Lucas De Marchi , Julia Lawall , =?UTF-8?B?VXdlIEtsZWluZS1Lw7ZuaWc=?= , Joe Perches , tglx@linutronix.de, mingo@elte.hu List-Id: alsa-devel@alsa-project.org Yong Zhang wrote: > Now snd_mpu401_uart_new() parameter 'irq_flags' take two role > in it: one is the condition to request_irq and the other is > the real irq_flags which will be transfered to request_irq(). > > So add another parameter 'want_irq' to take the role of the > first one, this will make it easy to remove IRQF_DISABLED. Please note that the irq number is also intended to pass this information: > * @irq: the irq number, -1 if no interrupt for mpu > ... > - if (irq >= 0 && irq_flags) { > if (request_irq(irq, snd_mpu401_uart_interrupt, irq_flags, Of course, most of snd_mpu401_uart_new()'s users get this wrong and use 0 instead of -1, relying on the irq_flags parameter only. But if these are fixed to use irq == -1, we get the same effect without having to introduce another parameter. Regards, Clemens