[PATCH] spi: Master driver for NXP SC18IS602/603

Mark Brown broonie at opensource.wolfsonmicro.com
Thu Aug 23 04:32:30 EST 2012


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 at 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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.ozlabs.org/pipermail/devicetree-discuss/attachments/20120822/5b182706/attachment.sig>


More information about the devicetree-discuss mailing list