From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755405Ab1KHDsn (ORCPT ); Mon, 7 Nov 2011 22:48:43 -0500 Received: from eu1sys200aog105.obsmtp.com ([207.126.144.119]:36401 "EHLO eu1sys200aog105.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753437Ab1KHDsm (ORCPT ); Mon, 7 Nov 2011 22:48:42 -0500 Message-ID: <4EB8A68C.9070905@st.com> Date: Tue, 8 Nov 2011 09:18:28 +0530 From: Viresh Kumar User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0) Gecko/20110812 Thunderbird/6.0 MIME-Version: 1.0 To: Linus Walleij Cc: Rabin VINCENT , "linux-kernel@vger.kernel.org" , "sameo@linux.intel.com" , Armando VISCONTI , Shiraz HASHIM , Vipin KUMAR , Rajeev KUMAR , Deepak SIKRI , Vipul Kumar SAMAR , Amit VIRDI , Pratyush ANAND , Bhupesh SHARMA , "viresh.linux@gmail.com" , Bhavna YADAV , Vincenzo FRASCINO , Mirko GARDI , Srinidhi KASAGAR , Linus WALLEIJ Subject: Re: [PATCH] mfd/stmpe: Add support for irq over gpio pin References: <5366f62b74861af357a0aecdb4e27aa69ffd703b.1320312035.git.viresh.kumar@st.com> In-Reply-To: Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/7/2011 5:59 PM, Linus Walleij wrote: > On Thu, Nov 3, 2011 at 10:26 AM, Viresh Kumar wrote: >> +free_gpio: >> + gpio_free(pdata->irq_gpio); > > Will that work if you didn't request irq over GPIO? > > If you did not request GPIO and stmpe_chip_init() > fails this will still be executed. > > Maybe: > > if (pdata->irq_over_gpio) > gpio_free(pdata->irq_gpio); > :( Silly mistake. >> diff --git a/include/linux/mfd/stmpe.h b/include/linux/mfd/stmpe.h >> index be1af7c..7901351 100644 >> --- a/include/linux/mfd/stmpe.h >> +++ b/include/linux/mfd/stmpe.h >> @@ -76,6 +76,7 @@ struct stmpe { >> struct stmpe_variant_info *variant; >> const u8 *regs; >> >> + int irq; >> int irq_base; >> int num_gpios; >> u8 ier[2]; >> @@ -194,6 +195,8 @@ struct stmpe_platform_data { >> unsigned int irq_trigger; >> bool irq_invert_polarity; >> bool autosleep; >> + bool irq_over_gpio; >> + int irq_gpio; >> int autosleep_timeout; > > Please also update the kerneldoc for struct stmpe. Sure. -- viresh