mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alexandre Pereira da Silva <aletes.xgr@gmail.com>
To: Ivo Sieben <meltedpianoman@gmail.com>
Cc: Grant Likely <grant.likely@secretlab.ca>,
	Rob Herring <rob.herring@calxeda.com>,
	Rob Landley <rob@landley.net>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Wolfram Sang <w.sang@pengutronix.de>,
	Chris Wright <chrisw@sous-sol.org>,
	devicetree-discuss@lists.ozlabs.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org, Roland Stigge <stigge@antcom.de>
Subject: Re: [PATCH] SPI: at25: Parse dt settings
Date: Thu, 21 Jun 2012 08:55:43 -0300	[thread overview]
Message-ID: <CAAAP30F1gWgvPwO2VT8fcP7X8veJuMfFjg34LkRaz-q7mwGfWg@mail.gmail.com> (raw)
In-Reply-To: <CAAAP30G6zE5UmVMPPDGpwzHXG5zN3ZZfJ9u4W2TM1B5ccF50Lw@mail.gmail.com>

On Thu, Jun 21, 2012 at 8:10 AM, Alexandre Pereira da Silva
<aletes.xgr@gmail.com> wrote:
> On Thu, Jun 21, 2012 at 6:49 AM, Ivo Sieben <meltedpianoman@gmail.com> wrote:
>> One small remark:
>> In case of platform_data, the "if (!chip)" check has been removed and
>> is now only handled in the device tree initialization.
>> Maybe add this check to the platform initialization as well:
>>
>> } else {
>>        if (!spi->dev.platform_data) {
>>                dev_dbg(&spi->dev, "no chip description\n");
>>                err = -ENODEV;
>>                goto fail;
>>        }
>>        chip =  *(struct spi_eeprom *)spi->dev.platform_data;
>> }

Please ignore my last email. Not enough coffee.

I'm sorry. The code looks right to me.

-       chip = spi->dev.platform_data;
-       if (!chip) {
-               dev_dbg(&spi->dev, "no chip description\n");
-               err = -ENODEV;
-               goto fail;
-       }
+       if (!spi->dev.platform_data) {
+               if (np) {
                             /* No platform data and DT node present,
DT handling */
+               } else {
                            /* No DT and No platform description,
handle error */
+                       dev_dbg(&spi->dev, "no chip description\n");
+                       err = -ENODEV;
+                       goto fail;
+               }
+       } else
                 /* At this point chip is guaranteed to have valid data */
+               chip = *(struct spi_eeprom *)spi->dev.platform_data;

  reply	other threads:[~2012-06-21 11:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-14 12:59 Alexandre Pereira da Silva
2012-06-21  9:49 ` Ivo Sieben
2012-06-21 11:10   ` Alexandre Pereira da Silva
2012-06-21 11:55     ` Alexandre Pereira da Silva [this message]
2012-06-21 14:31       ` Ivo Sieben

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=CAAAP30F1gWgvPwO2VT8fcP7X8veJuMfFjg34LkRaz-q7mwGfWg@mail.gmail.com \
    --to=aletes.xgr@gmail.com \
    --cc=chrisw@sous-sol.org \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=grant.likely@secretlab.ca \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=meltedpianoman@gmail.com \
    --cc=rob.herring@calxeda.com \
    --cc=rob@landley.net \
    --cc=stigge@antcom.de \
    --cc=w.sang@pengutronix.de \
    /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

all inboxes | Powered by JetHome®