linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: yuhang wang <wangyuhang2014-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Trent Piepho <tpiepho-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: "spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org"
	<spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>,
	Sourav Poddar <sourav.poddar-l0cyMroinI0@public.gmane.org>,
	Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	"linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
	<linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	"Gupta, Pekon" <pekon-l0cyMroinI0@public.gmane.org>
Subject: Re: [PATCH V2] SPI: DUAL and QUAD support
Date: Mon, 29 Jul 2013 10:44:43 +0800	[thread overview]
Message-ID: <CAHSAbzNTUpsftZ1-fpv7UefuSdUvUidg9-SLOUXCTmSBhM0ZJQ@mail.gmail.com> (raw)
In-Reply-To: <CA+7tXihU+JODQec-h2joUYiVY=otuSOu8BwADn+mtgELCFHPng-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

Hi


2013/7/29 Trent Piepho <tpiepho-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:
> On Sat, Jul 27, 2013 at 2:39 AM, wangyuhang <wangyuhang2014-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> 2:To spidev, in order to backward compatible, still use
>>  SPI_IOC_RD_MODE to deal with user who use <u8 mode>. Add
>>  SPI_IOC_EXTRD_MODE to fix the <u16 mode>. 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

  parent reply	other threads:[~2013-07-29  2:44 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-27  9:39 [PATCH V2] SPI: DUAL and QUAD support wangyuhang
     [not found] ` <1374917973-7083-1-git-send-email-wangyuhang2014-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-07-29  0:32   ` Trent Piepho
     [not found]     ` <CA+7tXihU+JODQec-h2joUYiVY=otuSOu8BwADn+mtgELCFHPng-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-07-29  2:44       ` yuhang wang [this message]
2013-07-29  6:42         ` Mark Brown
     [not found]           ` <20130729064234.GS9858-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2013-07-29 10:53             ` [PATCH] " wangyuhang
2013-07-29 12:43               ` Gupta, Pekon
     [not found]                 ` <20980858CB6D3A4BAE95CA194937D5E73E9EE267-yXqyApvAXouIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
2013-07-29 13:58                   ` yuhang wang
2013-07-29 14:21                     ` Gupta, Pekon
     [not found]                       ` <20980858CB6D3A4BAE95CA194937D5E73E9EE356-yXqyApvAXouIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
2013-07-29 14:52                         ` yuhang wang
2013-07-29 23:26                         ` Trent Piepho
     [not found]                           ` <CA+7tXijduVqFdao3L3oJcFBYw_cffdyo-fwyAS2cBASfEMExpA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-07-30  7:30                             ` yuhang wang
2013-08-08  8:57                               ` Gupta, Pekon
     [not found]                                 ` <20980858CB6D3A4BAE95CA194937D5E73E9F1E1B-yXqyApvAXouIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
2013-08-09  3:22                                   ` yuhang wang
2013-08-09  4:25                                     ` Gupta, Pekon
     [not found]                                       ` <20980858CB6D3A4BAE95CA194937D5E73E9F22F0-yXqyApvAXouIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
2013-08-09  9:14                                         ` yuhang wang
2013-08-07 11:57                   ` Gupta, Pekon
     [not found]                     ` <20980858CB6D3A4BAE95CA194937D5E73E9F1993-yXqyApvAXouIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
2013-08-09  2:09                       ` yuhang wang
2013-08-09  2:50                         ` Gupta, Pekon
     [not found]               ` <1375095194-7093-1-git-send-email-wangyuhang2014-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-07-29 12:56                 ` Matthieu CASTET
     [not found]                   ` <20130729145626.6c227aa0-ITF29qwbsa/QT0dZR+AlfA@public.gmane.org>
2013-07-29 14:25                     ` yuhang wang
     [not found]                       ` <CAHSAbzOPfpbPHohG7-EzftiPr5T2m19qgrKg7KS2jSKD-B=goA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-07-29 15:35                         ` Matthieu CASTET
     [not found]                           ` <20130729173511.65caa07d-ITF29qwbsa/QT0dZR+AlfA@public.gmane.org>
2013-07-30  1:13                             ` yuhang wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHSAbzNTUpsftZ1-fpv7UefuSdUvUidg9-SLOUXCTmSBhM0ZJQ@mail.gmail.com \
    --to=wangyuhang2014-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=pekon-l0cyMroinI0@public.gmane.org \
    --cc=sourav.poddar-l0cyMroinI0@public.gmane.org \
    --cc=spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=tpiepho-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).