Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757150AbZJ1Bp2 (ORCPT ); Tue, 27 Oct 2009 21:45:28 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756977AbZJ1Bp1 (ORCPT ); Tue, 27 Oct 2009 21:45:27 -0400 Received: from relay.atmel.no ([80.232.32.139]:58253 "EHLO relay.atmel.no" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756073AbZJ1Bp0 convert rfc822-to-8bit (ORCPT ); Tue, 27 Oct 2009 21:45:26 -0400 Date: Wed, 28 Oct 2009 09:31:31 +0800 From: Haavard Skinnemoen To: "Thiago A. =?UTF-8?B?Q29ycsOqYQ==?=" Cc: linux-mmc@vger.kernel.org, kernel@avr32linux.org, linux-kernel@vger.kernel.org, Nicolas Ferre , Andrew Victor , akpm@linux-foundation.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 3/3 v2] at91/atmel-mci: inclusion of sd/mmc driver in at91sam9g45 chip and board Message-ID: <20091028093131.0f8d8340@hskinnemoen-d830> In-Reply-To: References: <20090930155557.7dae503b@hskinnemoen-d830> <20091028083548.38f1d80c@hskinnemoen-d830> Organization: Atmel X-Mailer: Claws Mail 3.7.3 (GTK+ 2.16.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1061 Lines: 26 Thiago A. CorrĂȘa wrote: > >> Causes at91_set_gpio_input() to be called for pin -1.  Which shouldn't be valid. > >> AT91 platforms use 0 to indicate an un-connected GPIO pin, so the > >> assignment of "wp_pin" should probably just be removed. > > > > The mci driver expects non-existent pins to have a negative value, as > > do all other drivers which use gpio_is_valid(). > > > > Then I think it would be best to use GPIO_PIN_NONE. Makes it clear > what is expected and avoids confusion on what should be the proper > value. Unfortunately, GPIO_PIN_NONE only exists on AVR32. > I hope I'm not saying non-sense, but even if I am, I guess you can see > that I'm advocating against the magic numbers :) IIRC, the correct way to specify a non-existent pin is to use -ENODEV. Haavard -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/