From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751907AbbIQRKe (ORCPT ); Thu, 17 Sep 2015 13:10:34 -0400 Received: from smtp01.smtpout.orange.fr ([80.12.242.123]:50600 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751666AbbIQRKc (ORCPT ); Thu, 17 Sep 2015 13:10:32 -0400 X-ME-Helo: belgarion X-ME-Auth: amFyem1pay5yb2JlcnRAb3JhbmdlLmZy X-ME-Date: Thu, 17 Sep 2015 19:10:31 +0200 X-ME-IP: 90.16.209.104 From: Robert Jarzmik To: Ulf Hansson Cc: linux-mmc , "linux-kernel\@vger.kernel.org" , Petr Cvek Subject: Re: [PATCH v2] mmc: pxamci: fix card detect with slot-gpio API References: <1442430961-32269-1-git-send-email-robert.jarzmik@free.fr> X-URL: http://belgarath.falguerolles.org/ Date: Thu, 17 Sep 2015 19:05:32 +0200 In-Reply-To: (Ulf Hansson's message of "Thu, 17 Sep 2015 10:20:10 +0200") Message-ID: <871tdxrn6r.fsf@belgarion.home> User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Ulf Hansson writes: >> + if (gpio_is_valid(gpio_ro)) >> + ret = mmc_gpio_request_ro(mmc, gpio_ro); > > Would it be possible for you to use the mmc_gpiod_request_ro() instead? I don't think so. Most of pxamci users are old platform data based machine code, which passes an integer for the gpio. A full conversion to gpio_desc is another work. >> - gpio_direction_input(gpio_cd); >> >> - ret = request_irq(gpio_to_irq(gpio_cd), pxamci_detect_irq, > > I guess the pxamci_detect_irq() function can be removed within this > patch as well!? Euh no. The reason is on this line : host->pdata->init(&pdev->dev, pxamci_detect_irq, mmc); Machine code is passed this callback to signal a card detection change for esoteric cases, using this function as a IRQ handler. For example we have trizeps4_mci_init() in arch/arm/mach-pxa/trizeps4.c. >> + if (gpio_is_valid(gpio_cd)) >> + ret = mmc_gpio_request_cd(mmc, gpio_cd, 0); > > Would it be possible for you to use the mmc_gpiod_request_cd() instead? Same reason as before I'm afraid. > I believe you have some additional code to remove in pxamci_remove(). > Some gpio_free() and free_irq() shouldn't be needed there after this > change. Yes, good catch. This will be for v3. Cheers. -- Robert