From patchwork Tue Aug 3 16:32:44 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lars-Peter Clausen X-Patchwork-Id: 176272 Return-path: X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on void.printf.net X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.9 tests=RCVD_IN_DNSWL_LOW autolearn=disabled version=3.2.5 Envelope-to: chris@printf.net Delivery-date: Tue, 03 Aug 2010 17:33:15 +0100 Received: from lists.laptop.org ([18.85.2.145] helo=mail.laptop.org) by void.printf.net with esmtp (Exim 4.69) (envelope-from ) id 1OgKQV-0002y1-N8 for chris@printf.net; Tue, 03 Aug 2010 17:33:15 +0100 Received: by mail.laptop.org (Postfix) id 424BF23A4B; Tue, 3 Aug 2010 12:32:58 -0400 (EDT) Delivered-To: cjb@laptop.org Received: from spam.laptop.org (spam.laptop.org [18.85.46.23]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.laptop.org (Postfix) with ESMTPS id 334E423A49 for ; Tue, 3 Aug 2010 12:32:58 -0400 (EDT) X-ASG-Debug-ID: 1280853193-35635fd20001-zHW3sV Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by spam.laptop.org with ESMTP id KJBGWWgAEG67VAnA for ; Tue, 03 Aug 2010 12:33:13 -0400 (EDT) X-Barracuda-Envelope-From: linux-mmc-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756597Ab0HCQdK (ORCPT ); Tue, 3 Aug 2010 12:33:10 -0400 Received: from smtp-out-105.synserver.de ([212.40.180.105]:1250 "EHLO smtp-out-103.synserver.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755880Ab0HCQdJ (ORCPT ); Tue, 3 Aug 2010 12:33:09 -0400 Received: (qmail 7998 invoked by uid 0); 3 Aug 2010 16:33:02 -0000 X-SynServer-TrustedSrc: 1 X-SynServer-AuthUser: lars@laprican.de X-SynServer-PPID: 7684 Received: from d076134.adsl.hansenet.de (HELO localhost.localdomain) [80.171.76.134] by 217.119.54.87 with SMTP; 3 Aug 2010 16:33:02 -0000 From: Lars-Peter Clausen To: Ralf Baechle Cc: linux-mips@linux-mips.org, linux-mmc@vger.kernel.org, Maarten ter Huurne , Lars-Peter Clausen X-ASG-Orig-Subj: [PATCH] MMC: jz4740: Fixed card change detection. Subject: [PATCH] MMC: jz4740: Fixed card change detection. Date: Tue, 3 Aug 2010 18:32:44 +0200 Message-Id: <1280853164-19900-1-git-send-email-lars@metafoo.de> X-Mailer: git-send-email 1.5.6.5 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Barracuda-Connect: vger.kernel.org[209.132.180.67] X-Barracuda-Start-Time: 1280853193 X-Barracuda-URL: http://18.85.46.23:8000/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at laptop.org X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=3.5 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=5.5 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.36927 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- diff --git a/drivers/mmc/host/jz4740_mmc.c b/drivers/mmc/host/jz4740_mmc.c index 12efd9c..ad4f987 100644 --- a/drivers/mmc/host/jz4740_mmc.c +++ b/drivers/mmc/host/jz4740_mmc.c @@ -761,24 +761,20 @@ err: static int __devinit jz4740_mmc_request_cd_irq(struct platform_device *pdev, struct jz4740_mmc_host *host) { - int ret; struct jz4740_mmc_platform_data *pdata = pdev->dev.platform_data; - if (gpio_is_valid(pdata->gpio_card_detect)) + if (!gpio_is_valid(pdata->gpio_card_detect)) return 0; host->card_detect_irq = gpio_to_irq(pdata->gpio_card_detect); - if (host->card_detect_irq < 0) { dev_warn(&pdev->dev, "Failed to get card detect irq\n"); return 0; } + return request_irq(host->card_detect_irq, jz4740_mmc_card_detect_irq, IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, "MMC card detect", host); - - - return ret; } static void jz4740_mmc_free_gpios(struct platform_device *pdev)