From patchwork Tue Oct 6 05:06:50 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 51863 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n965DuhU014894 for ; Tue, 6 Oct 2009 05:13:57 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756220AbZJFFH2 (ORCPT ); Tue, 6 Oct 2009 01:07:28 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756196AbZJFFHL (ORCPT ); Tue, 6 Oct 2009 01:07:11 -0400 Received: from mail-ew0-f217.google.com ([209.85.219.217]:64745 "EHLO mail-ew0-f217.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754519AbZJFFHH (ORCPT ); Tue, 6 Oct 2009 01:07:07 -0400 Received: by mail-ew0-f217.google.com with SMTP id 17so3529224ewy.39 for ; Mon, 05 Oct 2009 22:06:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=uk8zJS/VGEKvMv2x7JKQPpovVJS85zfqrUXajxqulBA=; b=hU+nG5BnmAXfr4AexQLGF7DTT+Qwv3vtu2mIJGa6iyDVIki/ouoVvy+aln6FGW0TJz NsVl8g/7s62AgClmOiV7U+7qKrE7uk0LkxsjgO3S6iESoHThp1b3+prJlR6mbmyFYquO qW/hByRSMu6TVSaeGasMr9PZ1j9jIK4jMKST0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=ttjMDIfxe7/YDCL1rZIuAWEDr0ehx6K/sW7C1tX4oz0NguTylPkbhYcjms6avBRpgm SxEbiUjK/36sBe6o1tSYKM8Kd8DCmYz0dxdXwWvqk/8xpNDTEmGVx14iKdH9wdAf40lM f+yMMRqsYqkH611WNaYp6Zo8k0Rt1AHP2AG1s= Received: by 10.211.158.8 with SMTP id k8mr289066ebo.38.1254805615704; Mon, 05 Oct 2009 22:06:55 -0700 (PDT) Received: from mailhub.coreip.homeip.net (c-24-6-153-137.hsd1.ca.comcast.net [24.6.153.137]) by mx.google.com with ESMTPS id 7sm999714eyb.6.2009.10.05.22.06.54 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 05 Oct 2009 22:06:54 -0700 (PDT) Date: Mon, 5 Oct 2009 22:06:50 -0700 From: Dmitry Torokhov To: Pavel Machek Cc: rpurdie@rpsys.net, lenz@cs.wisc.edu, kernel list , Dirk@Opfer-Online.de, arminlitzel@web.de, Cyril Hrubis , thommycheck@gmail.com, linux-arm-kernel , dbaryshkov@gmail.com, omegamoon@gmail.com, eric.y.miao@gmail.com, utx@penguin.cz, linux-input@vger.kernel.org Subject: Re: 32-rc1 aka 32-rc2: warning at manage.c:361 (set_irq_wake), matrix-keypad related? Message-ID: <20091006050649.GH27881@core.coreip.homeip.net> References: <20090930200746.GA1384@ucw.cz> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20090930200746.GA1384@ucw.cz> User-Agent: Mutt/1.5.19 (2009-01-05) Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org diff --git a/drivers/input/keyboard/matrix_keypad.c b/drivers/input/keyboard/matrix_keypad.c index 91cfe51..488171c 100644 --- a/drivers/input/keyboard/matrix_keypad.c +++ b/drivers/input/keyboard/matrix_keypad.c @@ -218,14 +218,29 @@ static int matrix_keypad_suspend(struct platform_device *pdev, pm_message_t stat struct matrix_keypad *keypad = platform_get_drvdata(pdev); const struct matrix_keypad_platform_data *pdata = keypad->pdata; int i; + int err; matrix_keypad_stop(keypad->input_dev); - if (device_may_wakeup(&pdev->dev)) - for (i = 0; i < pdata->num_row_gpios; i++) - enable_irq_wake(gpio_to_irq(pdata->row_gpios[i])); + if (device_may_wakeup(&pdev->dev)) { + for (i = 0; i < pdata->num_row_gpios; i++) { + err = enable_irq_wake(gpio_to_irq(pdata->row_gpios[i])); + if (err) { + dev_err(&pdev->dev, + "Failed to setup GPIO %d as " + "wakeup source, err: %d\n", + pdata->row_gpios[i], err); + goto err_out; + } + } + } return 0; + + err_out: + while (--i >= 0) + disable_irq_wake(gpio_to_irq(pdata->row_gpios[i])); + return err; } static int matrix_keypad_resume(struct platform_device *pdev)