From mboxrd@z Thu Jan 1 00:00:00 1970 From: yuhang wang Subject: Re: [PATCH V2] SPI: DUAL and QUAD support Date: Mon, 29 Jul 2013 10:44:43 +0800 Message-ID: References: <1374917973-7083-1-git-send-email-wangyuhang2014@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: "spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org" , Sourav Poddar , Mark Brown , "linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org" , "Gupta, Pekon" To: Trent Piepho Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: spi-devel-general-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: linux-spi.vger.kernel.org Hi 2013/7/29 Trent Piepho : > On Sat, Jul 27, 2013 at 2:39 AM, wangyuhang wrote: >> 2:To spidev, in order to backward compatible, still use >> SPI_IOC_RD_MODE to deal with user who use . Add >> SPI_IOC_EXTRD_MODE to fix the . And SPI_IOC_RD_LSB_FIRST >> seems a little redundant, so del it. > > Your changes to spidev are not backward compatible at all. You can > not change the data types in the ioctl and maintain backward > compatibility. You can also not delete ioctls! > well, please give me some details or specific situations. Why ioctl can not be changed. The operation that SPI_IOC_RD_LSB_FIRST do can be done in SPI_IOC_RD_MODE, so I dont think there is any necessary using SPI_IOC_RD_LSB_FIRST. What you worry about is the user already used SPI_IOC_RD_LSB_FIRST? >> @@ -1316,6 +1324,12 @@ int spi_setup(struct spi_device *spi) >> /* help drivers fail *cleanly* when they need options >> * that aren't supported with their current master >> */ >> + if (((spi->mode >> 8) & 0x03) == 0x03 || >> + ((spi->mode >> 10) & 0x03) == 0x03) { >> + dev_err(&spi->dev, >> + "setup: can not select dual and quad at the same time\n"); >> + return -EINVAL; >> + } > > This code won't work if the constants you added for mode flags change > value. More importantly, anyone searching the code for SPI_TX_DUAL, > etc. won't find this code. agree, thanks. ------------------------------------------------------------------------------ See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk