linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: spi-devel-general@lists.sourceforge.net,
	Grant Likely <grant.likely@secretlab.ca>,
	Rob Herring <rob.herring@calxeda.com>,
	Rob Landley <rob@landley.net>,
	linux-doc@vger.kernel.org, devicetree-discuss@lists.ozlabs.org
Subject: Re: [PATCH] spi: Master driver for NXP SC18IS602/603
Date: Wed, 22 Aug 2012 12:19:59 -0700	[thread overview]
Message-ID: <20120822191959.GA12403@roeck-us.net> (raw)
In-Reply-To: <20120822183230.GC7995@opensource.wolfsonmicro.com>

On Wed, Aug 22, 2012 at 07:32:30PM +0100, Mark Brown wrote:
> On Sat, Aug 18, 2012 at 09:06:27AM -0700, Guenter Roeck wrote:
> > This driver adds support for NXP SC18IS602/603 I2C to SPI bus bridge.
> > 
> > Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> 
> Applied, thanks.  One small thing:
> 
> > +static int sc18is602_probe(struct i2c_client *client,
> > +			   const struct i2c_device_id *id)
> > +{
> > +	struct device *dev = &client->dev;
> > +	struct device_node *np = dev->of_node;
> > +	struct sc18is602_platform_data *pdata = dev_get_platdata(dev);
> > +	struct sc18is602 *hw;
> > +	struct spi_master *master;
> > +	int error;
> > +
> > +	if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C |
> > +				     I2C_FUNC_SMBUS_WRITE_BYTE_DATA))
> > +		return -ENODEV;
> 
> This feels like the wrong thing to do here: given that the user needs to
> explicitly ask for the device to be instantiated we really ought to be
> one the right bus so this should be more of an error.  Not sure what I
> can constructively sugget except for an error message and perhaps
> returning -EINVAL though.

Hi Mark,

Makes sense. Changing the return value to -EINVAL results in the following
warning message from the driver subsystem.

sc18is602: probe of 7-0010 failed with error -22

I think this should be good enough, as there are other possible reasons for the
call to fail which result in similar messages. Do you want to make that change,
or should I change it and resubmit ?

Thanks,
Guenter

  reply	other threads:[~2012-08-22 19:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-18 16:06 [PATCH] spi: Master driver for NXP SC18IS602/603 Guenter Roeck
2012-08-22 18:32 ` Mark Brown
2012-08-22 19:19   ` Guenter Roeck [this message]
2012-08-22 19:24     ` Mark Brown

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=20120822191959.GA12403@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=grant.likely@secretlab.ca \
    --cc=linux-doc@vger.kernel.org \
    --cc=rob.herring@calxeda.com \
    --cc=rob@landley.net \
    --cc=spi-devel-general@lists.sourceforge.net \
    /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).