From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ned Forrester Subject: Re: [PATCH] spi: pxa2xx_spi introduce chip select gpio to simplify the common cases Date: Mon, 08 Sep 2008 22:52:20 -0400 Message-ID: <48C5E4E4.40200@whoi.edu> References: <200809081704.43404.david-b@pacbell.net> <48C5CFEE.6070601@whoi.edu> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: David Brownell , spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, Russell King - ARM Linux To: Eric Miao Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: spi-devel-general-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: spi-devel-general-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: linux-spi.vger.kernel.org Eric Miao wrote: > On Tue, Sep 9, 2008 at 9:42 AM, Eric Miao wrote: >>>> +static int setup_cs(struct spi_device *spi, struct chip_data *chip, >>>> + struct pxa2xx_spi_chip *chip_info) >>> My understanding is that it is legal to call setup without a defined >>> pointer to a struct pxa2xx_spi_chip in spi_dev->controller_data, if the >>> chip is happy with the defaults (only works for a single chip bus that >>> needs no CS, a degenerate case, but still legal). Thus you should allow >>> for that by always checking for existence (chip_info not NULL) before use. >>> > > Ah, checked again with the source, I don't think setup_cs() > shall continue if (chip_info == NULL), which implies a > null_cs_control(), and is now handled by cs_assert() and > cs_deassert(). Yea, I already noticed that. Oh well. -- Ned Forrester nforrester-/d+BM93fTQY@public.gmane.org Oceanographic Systems Lab 508-289-2226 Applied Ocean Physics and Engineering Dept. Woods Hole Oceanographic Institution Woods Hole, MA 02543, USA http://www.whoi.edu/sbl/liteSite.do?litesiteid=7212 http://www.whoi.edu/hpb/Site.do?id=1532 http://www.whoi.edu/page.do?pid=10079 ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/