All of lore.kernel.org
 help / color / mirror / Atom feed
diff for duplicates of <4D878D8B.6070902@cam.ac.uk>

diff --git a/a/1.txt b/N1/1.txt
index c42c146..8d9a3b6 100644
--- a/a/1.txt
+++ b/N1/1.txt
@@ -1,31 +1,27 @@
 On 03/19/11 09:27, cliff.cai@analog.com wrote:
 > From: Cliff Cai <cliff.cai@analog.com>
->=20
+> 
 > Change v2:v1:
->=20
+> 
 > Make modification according to Michael Hennerich's comments,
 > correct the spi transfer way,use existing sysfs interfaces.
 Hi Cliff,
 
-As you are proposing a couple of new interfaces we need to have documen=
-tation
+As you are proposing a couple of new interfaces we need to have documentation
 for them. They are quad and dynamic_null_correction.
-We need to first establish whether they are of general utility and henc=
-e
+We need to first establish whether they are of general utility and hence
 should be in the main abi doc. The quadrature one isn't something I've
 seen before. Is it common in gyros?
 
 Dynamic null correction looks like it should be gyro_z_calibbias to me
 but I could be wrong.  The doc says
 "
-The user can make small adjustments to the rateout of the device by ass=
-erting
+The user can make small adjustments to the rateout of the device by asserting
 these bits. This 10-bit register allows the user to adjust the static
-rateout of the device by up to =B16.4=B0/sec.
+rateout of the device by up to ±6.4°/sec.
 "
 
-which makes me think it is an internally applied offset on the output s=
-ignal
+which makes me think it is an internally applied offset on the output signal
 and hence calibbias in our abi.
 
 Other than that, various minor nitpicks inline.
@@ -33,53 +29,47 @@ Other than that, various minor nitpicks inline.
 Jonathan
 
 
->=20
+> 
 > Signed-off-by: Cliff Cai<cliff@analog.com>
 > ---
 >  drivers/staging/iio/gyro/Kconfig         |   10 +
 >  drivers/staging/iio/gyro/Makefile        |    3 +
 >  drivers/staging/iio/gyro/adxrs450.h      |   59 ++++
->  drivers/staging/iio/gyro/adxrs450_core.c |  471 ++++++++++++++++++++=
-++++++++++
+>  drivers/staging/iio/gyro/adxrs450_core.c |  471 ++++++++++++++++++++++++++++++
 >  4 files changed, 543 insertions(+), 0 deletions(-)
 >  create mode 100644 drivers/staging/iio/gyro/adxrs450.h
 >  create mode 100644 drivers/staging/iio/gyro/adxrs450_core.c
->=20
-> diff --git a/drivers/staging/iio/gyro/Kconfig b/drivers/staging/iio/g=
-yro/Kconfig
+> 
+> diff --git a/drivers/staging/iio/gyro/Kconfig b/drivers/staging/iio/gyro/Kconfig
 > index 236f15f..3432967 100644
 > --- a/drivers/staging/iio/gyro/Kconfig
 > +++ b/drivers/staging/iio/gyro/Kconfig
 > @@ -45,3 +45,13 @@ config ADIS16251
-> =20
+>  
 >  	  This driver can also be built as a module.  If so, the module
 >  	  will be called adis16251.
 > +
 > +config ADXRS450
-> +	tristate "Analog Devices ADXRS450 Digital Output Gyroscope SPI driv=
-er"
+> +	tristate "Analog Devices ADXRS450 Digital Output Gyroscope SPI driver"
 > +	depends on SPI
 > +	help
-> +	  Say yes here to build support for Analog Devices ADXRS450 program=
-mable
+> +	  Say yes here to build support for Analog Devices ADXRS450 programmable
 > +	  digital output gyroscope.
 > +
 > +	  This driver can also be built as a module.  If so, the module
 > +	  will be called adxrs450.
-> diff --git a/drivers/staging/iio/gyro/Makefile b/drivers/staging/iio/=
-gyro/Makefile
+> diff --git a/drivers/staging/iio/gyro/Makefile b/drivers/staging/iio/gyro/Makefile
 > index 2764c15..2212240 100644
 > --- a/drivers/staging/iio/gyro/Makefile
 > +++ b/drivers/staging/iio/gyro/Makefile
-> @@ -17,3 +17,6 @@ obj-$(CONFIG_ADIS16260) +=3D adis16260.o
-> =20
->  adis16251-y             :=3D adis16251_core.o
->  obj-$(CONFIG_ADIS16251) +=3D adis16251.o
-> +
-> +adxrs450-y             :=3D adxrs450_core.o
-> +obj-$(CONFIG_ADXRS450) +=3D adxrs450.o
-> diff --git a/drivers/staging/iio/gyro/adxrs450.h b/drivers/staging/ii=
-o/gyro/adxrs450.h
+> @@ -17,3 +17,6 @@ obj-$(CONFIG_ADIS16260) += adis16260.o
+>  
+>  adis16251-y             := adis16251_core.o
+>  obj-$(CONFIG_ADIS16251) += adis16251.o
+> +
+> +adxrs450-y             := adxrs450_core.o
+> +obj-$(CONFIG_ADXRS450) += adxrs450.o
+> diff --git a/drivers/staging/iio/gyro/adxrs450.h b/drivers/staging/iio/gyro/adxrs450.h
 > new file mode 100644
 > index 0000000..4633ef9
 > --- /dev/null
@@ -144,8 +134,7 @@ o/gyro/adxrs450.h
 > +};
 > +
 > +#endif /* SPI_ADXRS450_H_ */
-> diff --git a/drivers/staging/iio/gyro/adxrs450_core.c b/drivers/stagi=
-ng/iio/gyro/adxrs450_core.c
+> diff --git a/drivers/staging/iio/gyro/adxrs450_core.c b/drivers/staging/iio/gyro/adxrs450_core.c
 > new file mode 100644
 > index 0000000..f4f9d49
 > --- /dev/null
@@ -183,10 +172,8 @@ This is only used in one place, I'd hard code it there.
 > +
 > +/**
 > + * adxrs450_spi_read_reg_16() - read 2 bytes from a register pair
-> + * @dev: device associated with child of actual device (iio_dev or i=
-io_trig)
-> + * @reg_address: the address of the lower of the two registers,which=
- should be an even address,
+> + * @dev: device associated with child of actual device (iio_dev or iio_trig)
+> + * @reg_address: the address of the lower of the two registers,which should be an even address,
 > + * Second register's address is reg_address + 1.
 > + * @val: somewhere to pass back the value read
 > + **/
@@ -195,46 +182,43 @@ io_trig)
 > +		u16 *val)
 > +{
 > +	struct spi_message msg;
-> +	struct iio_dev *indio_dev =3D dev_get_drvdata(dev);
-> +	struct adxrs450_state *st =3D iio_dev_get_devdata(indio_dev);
+> +	struct iio_dev *indio_dev = dev_get_drvdata(dev);
+> +	struct adxrs450_state *st = iio_dev_get_devdata(indio_dev);
 > +	int ret;
   The array only has one element. Please make it not be an array.
-> +	struct spi_transfer xfers[] =3D {
+> +	struct spi_transfer xfers[] = {
 > +		{
-> +			.tx_buf =3D st->tx,
-> +			.rx_buf =3D st->rx,
-> +			.bits_per_word =3D 8,
-> +			.len =3D 4,
+> +			.tx_buf = st->tx,
+> +			.rx_buf = st->rx,
+> +			.bits_per_word = 8,
+> +			.len = 4,
 > +		},
 > +	};
 > +	/* Needs to send the command twice to get the wanted value */
 > +	mutex_lock(&st->buf_lock);
-> +	st->tx[0] =3D ADXRS450_READ_DATA | reg_address >> 7;
-> +	st->tx[1] =3D reg_address << 1;
-> +	st->tx[2] =3D 0;
-> +	st->tx[3] =3D 0;
+> +	st->tx[0] = ADXRS450_READ_DATA | reg_address >> 7;
+> +	st->tx[1] = reg_address << 1;
+> +	st->tx[2] = 0;
+> +	st->tx[3] = 0;
 > +	spi_message_init(&msg);
 > +	spi_message_add_tail(&xfers[0], &msg);
-> +	ret =3D spi_sync(st->us, &msg);
+> +	ret = spi_sync(st->us, &msg);
 > +	if (ret) {
-> +		dev_err(&st->us->dev, "problem while reading 16 bit register 0x%02=
-x\n",
+> +		dev_err(&st->us->dev, "problem while reading 16 bit register 0x%02x\n",
 > +				reg_address);
 > +		goto error_ret;
 > +	}
 > +
 > +	spi_message_init(&msg);
 > +	spi_message_add_tail(&xfers[0], &msg);
-> +	ret =3D spi_sync(st->us, &msg);
+> +	ret = spi_sync(st->us, &msg);
 > +	if (ret) {
-> +		dev_err(&st->us->dev, "problem while reading 16 bit register 0x%02=
-x\n",
+> +		dev_err(&st->us->dev, "problem while reading 16 bit register 0x%02x\n",
 > +				reg_address);
 > +		goto error_ret;
 > +	}
 > +
-> +	*val =3D (st->rx[1] & 0x1f) << 11 | st->rx[2] << 3 | (st->rx[3] & 0=
-xe0) >> 5;
+> +	*val = (st->rx[1] & 0x1f) << 11 | st->rx[2] << 3 | (st->rx[3] & 0xe0) >> 5;
 > +
 > +error_ret:
 > +	mutex_unlock(&st->buf_lock);
@@ -242,15 +226,11 @@ xe0) >> 5;
 > +}
 > +
 > +/**
-> + * adxrs450_spi_write_reg_16() - write 2 bytes data to a register pa=
-ir
-> + * @dev: device associated with child of actual device (iio_dev or i=
-io_trig)
-If it's an iio_trig, casting it to an iio_dev will give you somewhat in=
-terresting
+> + * adxrs450_spi_write_reg_16() - write 2 bytes data to a register pair
+> + * @dev: device associated with child of actual device (iio_dev or iio_trig)
+If it's an iio_trig, casting it to an iio_dev will give you somewhat interresting
 results!
-> + * @reg_address: the address of the lower of the two registers,which=
- should be an even address,
+> + * @reg_address: the address of the lower of the two registers,which should be an even address,
 > + * Second register's address is reg_address + 1.
 > + * @val: value to be written.
 > + **/
@@ -259,34 +239,32 @@ results!
 > +		u16 *val)
 > +{
 > +	struct spi_message msg;
-> +	struct iio_dev *indio_dev =3D dev_get_drvdata(dev);
-> +	struct adxrs450_state *st =3D iio_dev_get_devdata(indio_dev);
+> +	struct iio_dev *indio_dev = dev_get_drvdata(dev);
+> +	struct adxrs450_state *st = iio_dev_get_devdata(indio_dev);
 > +	int ret;
 Again, shouldn't be an array.
-> +	struct spi_transfer xfers[] =3D {
+> +	struct spi_transfer xfers[] = {
 > +		{
-> +			.tx_buf =3D st->tx,
-> +			.rx_buf =3D st->rx,
-> +			.bits_per_word =3D 8,
-> +			.len =3D 4,
+> +			.tx_buf = st->tx,
+> +			.rx_buf = st->rx,
+> +			.bits_per_word = 8,
+> +			.len = 4,
 > +		},
 > +	};
 > +
 > +	mutex_lock(&st->buf_lock);
-> +	st->tx[0] =3D ADXRS450_WRITE_DATA | reg_address >> 7;
-> +	st->tx[1] =3D reg_address << 1 | *val >> 15;
-> +	st->tx[2] =3D *val >> 7;
-> +	st->tx[3] =3D *val << 1;
+> +	st->tx[0] = ADXRS450_WRITE_DATA | reg_address >> 7;
+> +	st->tx[1] = reg_address << 1 | *val >> 15;
+> +	st->tx[2] = *val >> 7;
+> +	st->tx[3] = *val << 1;
 > +	spi_message_init(&msg);
 > +	spi_message_add_tail(&xfers[0], &msg);
-> +	ret =3D spi_sync(st->us, &msg);
+> +	ret = spi_sync(st->us, &msg);
 > +	if (ret) {
-> +		dev_err(&st->us->dev, "problem while writing 16 bit register 0x%02=
-x\n",
+> +		dev_err(&st->us->dev, "problem while writing 16 bit register 0x%02x\n",
 > +				reg_address);
 > +		goto error_ret;
-only going to next line so don't need the goto and as a result no need =
-for the brackets
+only going to next line so don't need the goto and as a result no need for the brackets
 either.
 > +	}
 > +
@@ -297,35 +275,34 @@ either.
 > +
 > +/**
 > + * adxrs450_spi_sensor_data() - read 2 bytes sensor data
-> + * @dev: device associated with child of actual device (iio_dev or i=
-io_trig)
+> + * @dev: device associated with child of actual device (iio_dev or iio_trig)
 > + * @val: somewhere to pass back the value read
 > + **/
 > +static int adxrs450_spi_sensor_data(struct device *dev, u16 *val)
 > +{
 > +	struct spi_message msg;
-> +	struct iio_dev *indio_dev =3D dev_get_drvdata(dev);
-> +	struct adxrs450_state *st =3D iio_dev_get_devdata(indio_dev);
+> +	struct iio_dev *indio_dev = dev_get_drvdata(dev);
+> +	struct adxrs450_state *st = iio_dev_get_devdata(indio_dev);
 > +	int ret;
 Same array comment.
-> +	struct spi_transfer xfers[] =3D {
+> +	struct spi_transfer xfers[] = {
 > +		{
-> +			.tx_buf =3D st->tx,
-> +			.rx_buf =3D st->rx,
-> +			.bits_per_word =3D 8,
-> +			.len =3D 4,
+> +			.tx_buf = st->tx,
+> +			.rx_buf = st->rx,
+> +			.bits_per_word = 8,
+> +			.len = 4,
 > +		}
 > +	};
 > +
 > +	mutex_lock(&st->buf_lock);
-> +	st->tx[0] =3D ADXRS450_SENSOR_DATA;
-> +	st->tx[1] =3D 0;
-> +	st->tx[2] =3D 0;
-> +	st->tx[3] =3D 0;
+> +	st->tx[0] = ADXRS450_SENSOR_DATA;
+> +	st->tx[1] = 0;
+> +	st->tx[2] = 0;
+> +	st->tx[3] = 0;
 > +
 > +	spi_message_init(&msg);
 > +	spi_message_add_tail(&xfers[0], &msg);
-> +	ret =3D spi_sync(st->us, &msg);
+> +	ret = spi_sync(st->us, &msg);
 > +	if (ret) {
 > +		dev_err(&st->us->dev, "Problem while reading sensor data\n");
 > +		goto error_ret;
@@ -333,14 +310,13 @@ Same array comment.
 > +
 > +	spi_message_init(&msg);
 > +	spi_message_add_tail(&xfers[0], &msg);
-> +	ret =3D spi_sync(st->us, &msg);
+> +	ret = spi_sync(st->us, &msg);
 > +	if (ret) {
 > +		dev_err(&st->us->dev, "Problem while reading sensor data\n");
 > +		goto error_ret;
 > +	}
 > +
-> +	*val =3D (st->rx[0] & 0x03) << 14 | st->rx[1] << 6 | (st->rx[2] & 0=
-xfc) >> 2;
+> +	*val = (st->rx[0] & 0x03) << 14 | st->rx[1] << 6 | (st->rx[2] & 0xfc) >> 2;
 > +error_ret:
 > +	mutex_unlock(&st->buf_lock);
 > +	return ret;
@@ -348,54 +324,49 @@ xfc) >> 2;
 > +
 
 This looks to only be called from initial setup. Might as well just
-make it take an adxrs450_state directly and save the careful indirectio=
-n
-that is currently going on to ensure it gets the same dev as the other =
-write
+make it take an adxrs450_state directly and save the careful indirection
+that is currently going on to ensure it gets the same dev as the other write
 functions.
 > +/**
 > + * adxrs450_spi_initial() - use for initializing procedure.
-> + * @dev: device associated with child of actual device (iio_dev or i=
-io_trig)
+> + * @dev: device associated with child of actual device (iio_dev or iio_trig)
 > + * @val: somewhere to pass back the value read
 > + **/
 > +static int adxrs450_spi_initial(struct device *dev,
 > +		u32 *val, char chk)
 > +{
 > +	struct spi_message msg;
-> +	struct iio_dev *indio_dev =3D dev_get_drvdata(dev);
-> +	struct adxrs450_state *st =3D iio_dev_get_devdata(indio_dev);
+> +	struct iio_dev *indio_dev = dev_get_drvdata(dev);
+> +	struct adxrs450_state *st = iio_dev_get_devdata(indio_dev);
 > +	int ret;
 Another unneeded array.
-> +	struct spi_transfer xfers[] =3D {
+> +	struct spi_transfer xfers[] = {
 > +		{
-> +			.tx_buf =3D st->tx,
-> +			.rx_buf =3D st->rx,
-> +			.bits_per_word =3D 8,
-> +			.len =3D 4,
+> +			.tx_buf = st->tx,
+> +			.rx_buf = st->rx,
+> +			.bits_per_word = 8,
+> +			.len = 4,
 > +		},
 > +	};
 > +
 > +	mutex_lock(&st->buf_lock);
-> +	st->tx[0] =3D ADXRS450_SENSOR_DATA;
-> +	st->tx[1] =3D 0;
-> +	st->tx[2] =3D 0;
-> +	st->tx[3] =3D 0;
+> +	st->tx[0] = ADXRS450_SENSOR_DATA;
+> +	st->tx[1] = 0;
+> +	st->tx[2] = 0;
+> +	st->tx[3] = 0;
 > +	if (chk)
-> +		st->tx[3] |=3D (ADXRS450_CHK | ADXRS450_P);
+> +		st->tx[3] |= (ADXRS450_CHK | ADXRS450_P);
 > +	spi_message_init(&msg);
 > +	spi_message_add_tail(&xfers[0], &msg);
-> +	ret =3D spi_sync(st->us, &msg);
+> +	ret = spi_sync(st->us, &msg);
 > +	if (ret) {
-> +		dev_err(&st->us->dev, "Problem while reading initializing data\n")=
-;
+> +		dev_err(&st->us->dev, "Problem while reading initializing data\n");
 > +		goto error_ret;
 > +	}
 > +
 Looks like an endinaness conversion to me. be32tocpu.
 
-> +	*val =3D st->rx[0] << 24 | st->rx[1] << 16 | st->rx[2] << 8 | st->r=
-x[3];
+> +	*val = st->rx[0] << 24 | st->rx[1] << 16 | st->rx[2] << 8 | st->rx[3];
 > +
 > +error_ret:
 > +	mutex_unlock(&st->buf_lock);
@@ -406,15 +377,15 @@ x[3];
 > +		struct device_attribute *attr,
 > +		char *buf)
 > +{
-> +	int ret, len =3D 0;
+> +	int ret, len = 0;
 No need to initialize len.
 > +	u16 t;
-> +	ret =3D adxrs450_spi_read_reg_16(dev,
+> +	ret = adxrs450_spi_read_reg_16(dev,
 > +			ADXRS450_TEMP1,
 > +			&t);
 > +	if (ret)
 > +		return ret;
-> +	len =3D sprintf(buf, "%d\n", t);
+> +	len = sprintf(buf, "%d\n", t);
 > +	return len;
 > +}
 > +
@@ -422,15 +393,15 @@ No need to initialize len.
 > +		struct device_attribute *attr,
 > +		char *buf)
 > +{
-> +	int ret, len =3D 0;
+> +	int ret, len = 0;
 Same for this len
 > +	u16 t;
-> +	ret =3D adxrs450_spi_read_reg_16(dev,
+> +	ret = adxrs450_spi_read_reg_16(dev,
 > +			ADXRS450_QUAD1,
 > +			&t);
 > +	if (ret)
 > +		return ret;
-> +	len =3D sprintf(buf, "%d\n", t);
+> +	len = sprintf(buf, "%d\n", t);
 > +	return len;
 > +}
 > +
@@ -442,10 +413,10 @@ Same for this len
 > +	int ret;
 > +	u16 val;
 > +
-> +	if (len =3D=3D 0 || len > 2)
+> +	if (len == 0 || len > 2)
 > +		return -EINVAL;
 > +	memcpy(&val, buf, len);
-> +	ret =3D adxrs450_spi_write_reg_16(dev,
+> +	ret = adxrs450_spi_write_reg_16(dev,
 > +			ADXRS450_DNC1,
 > +			&val);
 Err, so what is meant to be written to this?  Looks like you'll be
@@ -459,15 +430,15 @@ Documentation would clear this up.
 > +		struct device_attribute *attr,
 > +		char *buf)
 > +{
-> +	int ret, len =3D 0;
+> +	int ret, len = 0;
 another unneeded init of len
 > +	u16 t;
 > +
-> +	ret =3D adxrs450_spi_sensor_data(dev, &t);
+> +	ret = adxrs450_spi_sensor_data(dev, &t);
 > +	if (ret)
 > +		return ret;
 > +
-> +	len =3D sprintf(buf, "%d\n", t);
+> +	len = sprintf(buf, "%d\n", t);
 > +	return len;
 > +}
 > +
@@ -477,60 +448,60 @@ another unneeded init of len
 > +	u32 t;
 > +	u16 data;
 > +	int ret;
-> +	struct device *dev =3D &st->indio_dev->dev;
+> +	struct device *dev = &st->indio_dev->dev;
 > +
 > +	msleep(ADXRS450_STARTUP_DELAY*2);
-> +	ret =3D adxrs450_spi_initial(dev, &t, 1);
+> +	ret = adxrs450_spi_initial(dev, &t, 1);
 > +	if (ret)
 > +		return ret;
-> +	if (t !=3D 0x01) {
+> +	if (t != 0x01) {
 > +		dev_err(&st->us->dev, "The initial response is not correct!\n");
 > +		return -ENODEV;
 > +
 > +	}
 > +
 > +	msleep(ADXRS450_STARTUP_DELAY);
-> +	ret =3D adxrs450_spi_initial(dev, &t, 0);
+> +	ret = adxrs450_spi_initial(dev, &t, 0);
 > +	if (ret)
 > +		return ret;
 > +
 > +	msleep(ADXRS450_STARTUP_DELAY);
-> +	ret =3D adxrs450_spi_initial(dev, &t, 0);
+> +	ret = adxrs450_spi_initial(dev, &t, 0);
 > +	if (ret)
 > +		return ret;
-> +	if (((t & 0xff) | 0x01) !=3D 0xff || ADXRS450_GET_ST(t) !=3D 2) {
+> +	if (((t & 0xff) | 0x01) != 0xff || ADXRS450_GET_ST(t) != 2) {
 > +		dev_err(&st->us->dev, "The second response is not correct!\n");
 > +		return -EIO;
 > +
 > +	}
-> +	ret =3D adxrs450_spi_initial(dev, &t, 0);
+> +	ret = adxrs450_spi_initial(dev, &t, 0);
 > +	if (ret)
 > +		return ret;
-> +	if (((t & 0xff) | 0x01) !=3D 0xff || ADXRS450_GET_ST(t) !=3D 2) {
+> +	if (((t & 0xff) | 0x01) != 0xff || ADXRS450_GET_ST(t) != 2) {
 > +		dev_err(&st->us->dev, "The third response is not correct!\n");
 > +		return -EIO;
 > +
 > +	}
-> +	ret =3D adxrs450_spi_read_reg_16(dev, ADXRS450_FAULT1, &data);
+> +	ret = adxrs450_spi_read_reg_16(dev, ADXRS450_FAULT1, &data);
 > +	if (ret)
 > +		return ret;
 > +	if (data & 0x0fff) {
 > +		dev_err(&st->us->dev, "The device is not in normal status!\n");
 > +		return -EINVAL;
 > +	}
-> +	ret =3D adxrs450_spi_read_reg_16(dev, ADXRS450_PID1, &data);
+> +	ret = adxrs450_spi_read_reg_16(dev, ADXRS450_PID1, &data);
 > +	if (ret)
 > +		return ret;
 > +	dev_info(&st->us->dev, "The Part ID is 0x%x\n", data);
 > +
-> +	ret =3D adxrs450_spi_read_reg_16(dev, ADXRS450_SNL, &data);
+> +	ret = adxrs450_spi_read_reg_16(dev, ADXRS450_SNL, &data);
 > +	if (ret)
 > +		return ret;
-> +	t =3D data;
-> +	ret =3D adxrs450_spi_read_reg_16(dev, ADXRS450_SNH, &data);
+> +	t = data;
+> +	ret = adxrs450_spi_read_reg_16(dev, ADXRS450_SNH, &data);
 > +	if (ret)
 > +		return ret;
-> +	t |=3D data << 16;
+> +	t |= data << 16;
 > +	dev_info(&st->us->dev, "The Serial Number is 0x%x\n", t);
 > +
 > +	dev_info(&st->us->dev, "%s at CS%d\n", DRIVER_NAME,
@@ -555,7 +526,7 @@ than that.
 > +		NULL, adxrs450_write_dnc, 0);
 > +static IIO_CONST_ATTR(name, "adxrs450");
 > +
-> +static struct attribute *adxrs450_attributes[] =3D {
+> +static struct attribute *adxrs450_attributes[] = {
 bonus blank line here. Please remove.
 > +
 > +	&iio_dev_attr_gyro_z_raw.dev_attr.attr,
@@ -566,54 +537,54 @@ bonus blank line here. Please remove.
 > +	NULL
 > +};
 > +
-> +static const struct attribute_group adxrs450_attribute_group =3D {
-> +	.attrs =3D adxrs450_attributes,
+> +static const struct attribute_group adxrs450_attribute_group = {
+> +	.attrs = adxrs450_attributes,
 > +};
 > +
 > +static int __devinit adxrs450_probe(struct spi_device *spi)
 > +{
-> +	int ret, regdone =3D 0;
-> +	struct adxrs450_state *st =3D kzalloc(sizeof *st, GFP_KERNEL);
+> +	int ret, regdone = 0;
+> +	struct adxrs450_state *st = kzalloc(sizeof *st, GFP_KERNEL);
 > +	if (!st) {
-> +		ret =3D  -ENOMEM;
+> +		ret =  -ENOMEM;
 > +		goto error_ret;
 > +	}
 > +	/* This is only used for removal purposes */
 > +	spi_set_drvdata(spi, st);
 > +
 > +	/* Allocate the comms buffers */
-> +	st->rx =3D kzalloc(sizeof(*st->rx)*ADXRS450_MAX_RX, GFP_KERNEL);
-> +	if (st->rx =3D=3D NULL) {
-> +		ret =3D -ENOMEM;
+> +	st->rx = kzalloc(sizeof(*st->rx)*ADXRS450_MAX_RX, GFP_KERNEL);
+> +	if (st->rx == NULL) {
+> +		ret = -ENOMEM;
 > +		goto error_free_st;
 > +	}
-> +	st->tx =3D kzalloc(sizeof(*st->tx)*ADXRS450_MAX_TX, GFP_KERNEL);
-> +	if (st->tx =3D=3D NULL) {
-> +		ret =3D -ENOMEM;
+> +	st->tx = kzalloc(sizeof(*st->tx)*ADXRS450_MAX_TX, GFP_KERNEL);
+> +	if (st->tx == NULL) {
+> +		ret = -ENOMEM;
 > +		goto error_free_rx;
 > +	}
-> +	st->us =3D spi;
+> +	st->us = spi;
 > +	mutex_init(&st->buf_lock);
 > +	/* setup the industrialio driver allocated elements */
-> +	st->indio_dev =3D iio_allocate_device();
-> +	if (st->indio_dev =3D=3D NULL) {
-> +		ret =3D -ENOMEM;
+> +	st->indio_dev = iio_allocate_device();
+> +	if (st->indio_dev == NULL) {
+> +		ret = -ENOMEM;
 > +		goto error_free_tx;
 > +	}
 > +
-> +	st->indio_dev->dev.parent =3D &spi->dev;
-> +	st->indio_dev->attrs =3D &adxrs450_attribute_group;
-> +	st->indio_dev->dev_data =3D (void *)(st);
-> +	st->indio_dev->driver_module =3D THIS_MODULE;
-> +	st->indio_dev->modes =3D INDIO_DIRECT_MODE;
+> +	st->indio_dev->dev.parent = &spi->dev;
+> +	st->indio_dev->attrs = &adxrs450_attribute_group;
+> +	st->indio_dev->dev_data = (void *)(st);
+> +	st->indio_dev->driver_module = THIS_MODULE;
+> +	st->indio_dev->modes = INDIO_DIRECT_MODE;
 > +
-> +	ret =3D iio_device_register(st->indio_dev);
+> +	ret = iio_device_register(st->indio_dev);
 > +	if (ret)
 > +		goto error_free_dev;
-> +	regdone =3D 1;
+> +	regdone = 1;
 > +
 > +	/* Get the device into a sane initial state */
-> +	ret =3D adxrs450_initial_setup(st);
+> +	ret = adxrs450_initial_setup(st);
 > +	if (ret)
 > +		goto error_initial;
 > +	return 0;
@@ -637,12 +608,12 @@ bonus blank line here. Please remove.
 > +/* fixme, confirm ordering in this function */
 > +static int adxrs450_remove(struct spi_device *spi)
 > +{
-> +	struct adxrs450_state *st =3D spi_get_drvdata(spi);
+> +	struct adxrs450_state *st = spi_get_drvdata(spi);
 
 Might as well just go with
 
 iio_device_unregister(st->indio_dev);
-> +	struct iio_dev *indio_dev =3D st->indio_dev;
+> +	struct iio_dev *indio_dev = st->indio_dev;
 > +
 > +	iio_device_unregister(indio_dev);
 > +	kfree(st->tx);
@@ -652,13 +623,13 @@ iio_device_unregister(st->indio_dev);
 > +	return 0;
 > +}
 > +
-> +static struct spi_driver adxrs450_driver =3D {
-> +	.driver =3D {
-> +		.name =3D "adxrs450",
-> +		.owner =3D THIS_MODULE,
+> +static struct spi_driver adxrs450_driver = {
+> +	.driver = {
+> +		.name = "adxrs450",
+> +		.owner = THIS_MODULE,
 > +	},
-> +	.probe =3D adxrs450_probe,
-> +	.remove =3D __devexit_p(adxrs450_remove),
+> +	.probe = adxrs450_probe,
+> +	.remove = __devexit_p(adxrs450_remove),
 > +};
 > +
 > +static __init int adxrs450_init(void)
diff --git a/a/content_digest b/N1/content_digest
index fdb7c39..975490b 100644
--- a/a/content_digest
+++ b/N1/content_digest
@@ -12,32 +12,28 @@
  "b\0"
  "On 03/19/11 09:27, cliff.cai@analog.com wrote:\n"
  "> From: Cliff Cai <cliff.cai@analog.com>\n"
- ">=20\n"
+ "> \n"
  "> Change v2:v1:\n"
- ">=20\n"
+ "> \n"
  "> Make modification according to Michael Hennerich's comments,\n"
  "> correct the spi transfer way,use existing sysfs interfaces.\n"
  "Hi Cliff,\n"
  "\n"
- "As you are proposing a couple of new interfaces we need to have documen=\n"
- "tation\n"
+ "As you are proposing a couple of new interfaces we need to have documentation\n"
  "for them. They are quad and dynamic_null_correction.\n"
- "We need to first establish whether they are of general utility and henc=\n"
- "e\n"
+ "We need to first establish whether they are of general utility and hence\n"
  "should be in the main abi doc. The quadrature one isn't something I've\n"
  "seen before. Is it common in gyros?\n"
  "\n"
  "Dynamic null correction looks like it should be gyro_z_calibbias to me\n"
  "but I could be wrong.  The doc says\n"
  "\"\n"
- "The user can make small adjustments to the rateout of the device by ass=\n"
- "erting\n"
+ "The user can make small adjustments to the rateout of the device by asserting\n"
  "these bits. This 10-bit register allows the user to adjust the static\n"
- "rateout of the device by up to =B16.4=B0/sec.\n"
+ "rateout of the device by up to \302\2616.4\302\260/sec.\n"
  "\"\n"
  "\n"
- "which makes me think it is an internally applied offset on the output s=\n"
- "ignal\n"
+ "which makes me think it is an internally applied offset on the output signal\n"
  "and hence calibbias in our abi.\n"
  "\n"
  "Other than that, various minor nitpicks inline.\n"
@@ -45,53 +41,47 @@
  "Jonathan\n"
  "\n"
  "\n"
- ">=20\n"
+ "> \n"
  "> Signed-off-by: Cliff Cai<cliff@analog.com>\n"
  "> ---\n"
  ">  drivers/staging/iio/gyro/Kconfig         |   10 +\n"
  ">  drivers/staging/iio/gyro/Makefile        |    3 +\n"
  ">  drivers/staging/iio/gyro/adxrs450.h      |   59 ++++\n"
- ">  drivers/staging/iio/gyro/adxrs450_core.c |  471 ++++++++++++++++++++=\n"
- "++++++++++\n"
+ ">  drivers/staging/iio/gyro/adxrs450_core.c |  471 ++++++++++++++++++++++++++++++\n"
  ">  4 files changed, 543 insertions(+), 0 deletions(-)\n"
  ">  create mode 100644 drivers/staging/iio/gyro/adxrs450.h\n"
  ">  create mode 100644 drivers/staging/iio/gyro/adxrs450_core.c\n"
- ">=20\n"
- "> diff --git a/drivers/staging/iio/gyro/Kconfig b/drivers/staging/iio/g=\n"
- "yro/Kconfig\n"
+ "> \n"
+ "> diff --git a/drivers/staging/iio/gyro/Kconfig b/drivers/staging/iio/gyro/Kconfig\n"
  "> index 236f15f..3432967 100644\n"
  "> --- a/drivers/staging/iio/gyro/Kconfig\n"
  "> +++ b/drivers/staging/iio/gyro/Kconfig\n"
  "> @@ -45,3 +45,13 @@ config ADIS16251\n"
- "> =20\n"
+ ">  \n"
  ">  \t  This driver can also be built as a module.  If so, the module\n"
  ">  \t  will be called adis16251.\n"
  "> +\n"
  "> +config ADXRS450\n"
- "> +\ttristate \"Analog Devices ADXRS450 Digital Output Gyroscope SPI driv=\n"
- "er\"\n"
+ "> +\ttristate \"Analog Devices ADXRS450 Digital Output Gyroscope SPI driver\"\n"
  "> +\tdepends on SPI\n"
  "> +\thelp\n"
- "> +\t  Say yes here to build support for Analog Devices ADXRS450 program=\n"
- "mable\n"
+ "> +\t  Say yes here to build support for Analog Devices ADXRS450 programmable\n"
  "> +\t  digital output gyroscope.\n"
  "> +\n"
  "> +\t  This driver can also be built as a module.  If so, the module\n"
  "> +\t  will be called adxrs450.\n"
- "> diff --git a/drivers/staging/iio/gyro/Makefile b/drivers/staging/iio/=\n"
- "gyro/Makefile\n"
+ "> diff --git a/drivers/staging/iio/gyro/Makefile b/drivers/staging/iio/gyro/Makefile\n"
  "> index 2764c15..2212240 100644\n"
  "> --- a/drivers/staging/iio/gyro/Makefile\n"
  "> +++ b/drivers/staging/iio/gyro/Makefile\n"
- "> @@ -17,3 +17,6 @@ obj-$(CONFIG_ADIS16260) +=3D adis16260.o\n"
- "> =20\n"
- ">  adis16251-y             :=3D adis16251_core.o\n"
- ">  obj-$(CONFIG_ADIS16251) +=3D adis16251.o\n"
- "> +\n"
- "> +adxrs450-y             :=3D adxrs450_core.o\n"
- "> +obj-$(CONFIG_ADXRS450) +=3D adxrs450.o\n"
- "> diff --git a/drivers/staging/iio/gyro/adxrs450.h b/drivers/staging/ii=\n"
- "o/gyro/adxrs450.h\n"
+ "> @@ -17,3 +17,6 @@ obj-$(CONFIG_ADIS16260) += adis16260.o\n"
+ ">  \n"
+ ">  adis16251-y             := adis16251_core.o\n"
+ ">  obj-$(CONFIG_ADIS16251) += adis16251.o\n"
+ "> +\n"
+ "> +adxrs450-y             := adxrs450_core.o\n"
+ "> +obj-$(CONFIG_ADXRS450) += adxrs450.o\n"
+ "> diff --git a/drivers/staging/iio/gyro/adxrs450.h b/drivers/staging/iio/gyro/adxrs450.h\n"
  "> new file mode 100644\n"
  "> index 0000000..4633ef9\n"
  "> --- /dev/null\n"
@@ -156,8 +146,7 @@
  "> +};\n"
  "> +\n"
  "> +#endif /* SPI_ADXRS450_H_ */\n"
- "> diff --git a/drivers/staging/iio/gyro/adxrs450_core.c b/drivers/stagi=\n"
- "ng/iio/gyro/adxrs450_core.c\n"
+ "> diff --git a/drivers/staging/iio/gyro/adxrs450_core.c b/drivers/staging/iio/gyro/adxrs450_core.c\n"
  "> new file mode 100644\n"
  "> index 0000000..f4f9d49\n"
  "> --- /dev/null\n"
@@ -195,10 +184,8 @@
  "> +\n"
  "> +/**\n"
  "> + * adxrs450_spi_read_reg_16() - read 2 bytes from a register pair\n"
- "> + * @dev: device associated with child of actual device (iio_dev or i=\n"
- "io_trig)\n"
- "> + * @reg_address: the address of the lower of the two registers,which=\n"
- " should be an even address,\n"
+ "> + * @dev: device associated with child of actual device (iio_dev or iio_trig)\n"
+ "> + * @reg_address: the address of the lower of the two registers,which should be an even address,\n"
  "> + * Second register's address is reg_address + 1.\n"
  "> + * @val: somewhere to pass back the value read\n"
  "> + **/\n"
@@ -207,46 +194,43 @@
  "> +\t\tu16 *val)\n"
  "> +{\n"
  "> +\tstruct spi_message msg;\n"
- "> +\tstruct iio_dev *indio_dev =3D dev_get_drvdata(dev);\n"
- "> +\tstruct adxrs450_state *st =3D iio_dev_get_devdata(indio_dev);\n"
+ "> +\tstruct iio_dev *indio_dev = dev_get_drvdata(dev);\n"
+ "> +\tstruct adxrs450_state *st = iio_dev_get_devdata(indio_dev);\n"
  "> +\tint ret;\n"
  "  The array only has one element. Please make it not be an array.\n"
- "> +\tstruct spi_transfer xfers[] =3D {\n"
+ "> +\tstruct spi_transfer xfers[] = {\n"
  "> +\t\t{\n"
- "> +\t\t\t.tx_buf =3D st->tx,\n"
- "> +\t\t\t.rx_buf =3D st->rx,\n"
- "> +\t\t\t.bits_per_word =3D 8,\n"
- "> +\t\t\t.len =3D 4,\n"
+ "> +\t\t\t.tx_buf = st->tx,\n"
+ "> +\t\t\t.rx_buf = st->rx,\n"
+ "> +\t\t\t.bits_per_word = 8,\n"
+ "> +\t\t\t.len = 4,\n"
  "> +\t\t},\n"
  "> +\t};\n"
  "> +\t/* Needs to send the command twice to get the wanted value */\n"
  "> +\tmutex_lock(&st->buf_lock);\n"
- "> +\tst->tx[0] =3D ADXRS450_READ_DATA | reg_address >> 7;\n"
- "> +\tst->tx[1] =3D reg_address << 1;\n"
- "> +\tst->tx[2] =3D 0;\n"
- "> +\tst->tx[3] =3D 0;\n"
+ "> +\tst->tx[0] = ADXRS450_READ_DATA | reg_address >> 7;\n"
+ "> +\tst->tx[1] = reg_address << 1;\n"
+ "> +\tst->tx[2] = 0;\n"
+ "> +\tst->tx[3] = 0;\n"
  "> +\tspi_message_init(&msg);\n"
  "> +\tspi_message_add_tail(&xfers[0], &msg);\n"
- "> +\tret =3D spi_sync(st->us, &msg);\n"
+ "> +\tret = spi_sync(st->us, &msg);\n"
  "> +\tif (ret) {\n"
- "> +\t\tdev_err(&st->us->dev, \"problem while reading 16 bit register 0x%02=\n"
- "x\\n\",\n"
+ "> +\t\tdev_err(&st->us->dev, \"problem while reading 16 bit register 0x%02x\\n\",\n"
  "> +\t\t\t\treg_address);\n"
  "> +\t\tgoto error_ret;\n"
  "> +\t}\n"
  "> +\n"
  "> +\tspi_message_init(&msg);\n"
  "> +\tspi_message_add_tail(&xfers[0], &msg);\n"
- "> +\tret =3D spi_sync(st->us, &msg);\n"
+ "> +\tret = spi_sync(st->us, &msg);\n"
  "> +\tif (ret) {\n"
- "> +\t\tdev_err(&st->us->dev, \"problem while reading 16 bit register 0x%02=\n"
- "x\\n\",\n"
+ "> +\t\tdev_err(&st->us->dev, \"problem while reading 16 bit register 0x%02x\\n\",\n"
  "> +\t\t\t\treg_address);\n"
  "> +\t\tgoto error_ret;\n"
  "> +\t}\n"
  "> +\n"
- "> +\t*val =3D (st->rx[1] & 0x1f) << 11 | st->rx[2] << 3 | (st->rx[3] & 0=\n"
- "xe0) >> 5;\n"
+ "> +\t*val = (st->rx[1] & 0x1f) << 11 | st->rx[2] << 3 | (st->rx[3] & 0xe0) >> 5;\n"
  "> +\n"
  "> +error_ret:\n"
  "> +\tmutex_unlock(&st->buf_lock);\n"
@@ -254,15 +238,11 @@
  "> +}\n"
  "> +\n"
  "> +/**\n"
- "> + * adxrs450_spi_write_reg_16() - write 2 bytes data to a register pa=\n"
- "ir\n"
- "> + * @dev: device associated with child of actual device (iio_dev or i=\n"
- "io_trig)\n"
- "If it's an iio_trig, casting it to an iio_dev will give you somewhat in=\n"
- "terresting\n"
+ "> + * adxrs450_spi_write_reg_16() - write 2 bytes data to a register pair\n"
+ "> + * @dev: device associated with child of actual device (iio_dev or iio_trig)\n"
+ "If it's an iio_trig, casting it to an iio_dev will give you somewhat interresting\n"
  "results!\n"
- "> + * @reg_address: the address of the lower of the two registers,which=\n"
- " should be an even address,\n"
+ "> + * @reg_address: the address of the lower of the two registers,which should be an even address,\n"
  "> + * Second register's address is reg_address + 1.\n"
  "> + * @val: value to be written.\n"
  "> + **/\n"
@@ -271,34 +251,32 @@
  "> +\t\tu16 *val)\n"
  "> +{\n"
  "> +\tstruct spi_message msg;\n"
- "> +\tstruct iio_dev *indio_dev =3D dev_get_drvdata(dev);\n"
- "> +\tstruct adxrs450_state *st =3D iio_dev_get_devdata(indio_dev);\n"
+ "> +\tstruct iio_dev *indio_dev = dev_get_drvdata(dev);\n"
+ "> +\tstruct adxrs450_state *st = iio_dev_get_devdata(indio_dev);\n"
  "> +\tint ret;\n"
  "Again, shouldn't be an array.\n"
- "> +\tstruct spi_transfer xfers[] =3D {\n"
+ "> +\tstruct spi_transfer xfers[] = {\n"
  "> +\t\t{\n"
- "> +\t\t\t.tx_buf =3D st->tx,\n"
- "> +\t\t\t.rx_buf =3D st->rx,\n"
- "> +\t\t\t.bits_per_word =3D 8,\n"
- "> +\t\t\t.len =3D 4,\n"
+ "> +\t\t\t.tx_buf = st->tx,\n"
+ "> +\t\t\t.rx_buf = st->rx,\n"
+ "> +\t\t\t.bits_per_word = 8,\n"
+ "> +\t\t\t.len = 4,\n"
  "> +\t\t},\n"
  "> +\t};\n"
  "> +\n"
  "> +\tmutex_lock(&st->buf_lock);\n"
- "> +\tst->tx[0] =3D ADXRS450_WRITE_DATA | reg_address >> 7;\n"
- "> +\tst->tx[1] =3D reg_address << 1 | *val >> 15;\n"
- "> +\tst->tx[2] =3D *val >> 7;\n"
- "> +\tst->tx[3] =3D *val << 1;\n"
+ "> +\tst->tx[0] = ADXRS450_WRITE_DATA | reg_address >> 7;\n"
+ "> +\tst->tx[1] = reg_address << 1 | *val >> 15;\n"
+ "> +\tst->tx[2] = *val >> 7;\n"
+ "> +\tst->tx[3] = *val << 1;\n"
  "> +\tspi_message_init(&msg);\n"
  "> +\tspi_message_add_tail(&xfers[0], &msg);\n"
- "> +\tret =3D spi_sync(st->us, &msg);\n"
+ "> +\tret = spi_sync(st->us, &msg);\n"
  "> +\tif (ret) {\n"
- "> +\t\tdev_err(&st->us->dev, \"problem while writing 16 bit register 0x%02=\n"
- "x\\n\",\n"
+ "> +\t\tdev_err(&st->us->dev, \"problem while writing 16 bit register 0x%02x\\n\",\n"
  "> +\t\t\t\treg_address);\n"
  "> +\t\tgoto error_ret;\n"
- "only going to next line so don't need the goto and as a result no need =\n"
- "for the brackets\n"
+ "only going to next line so don't need the goto and as a result no need for the brackets\n"
  "either.\n"
  "> +\t}\n"
  "> +\n"
@@ -309,35 +287,34 @@
  "> +\n"
  "> +/**\n"
  "> + * adxrs450_spi_sensor_data() - read 2 bytes sensor data\n"
- "> + * @dev: device associated with child of actual device (iio_dev or i=\n"
- "io_trig)\n"
+ "> + * @dev: device associated with child of actual device (iio_dev or iio_trig)\n"
  "> + * @val: somewhere to pass back the value read\n"
  "> + **/\n"
  "> +static int adxrs450_spi_sensor_data(struct device *dev, u16 *val)\n"
  "> +{\n"
  "> +\tstruct spi_message msg;\n"
- "> +\tstruct iio_dev *indio_dev =3D dev_get_drvdata(dev);\n"
- "> +\tstruct adxrs450_state *st =3D iio_dev_get_devdata(indio_dev);\n"
+ "> +\tstruct iio_dev *indio_dev = dev_get_drvdata(dev);\n"
+ "> +\tstruct adxrs450_state *st = iio_dev_get_devdata(indio_dev);\n"
  "> +\tint ret;\n"
  "Same array comment.\n"
- "> +\tstruct spi_transfer xfers[] =3D {\n"
+ "> +\tstruct spi_transfer xfers[] = {\n"
  "> +\t\t{\n"
- "> +\t\t\t.tx_buf =3D st->tx,\n"
- "> +\t\t\t.rx_buf =3D st->rx,\n"
- "> +\t\t\t.bits_per_word =3D 8,\n"
- "> +\t\t\t.len =3D 4,\n"
+ "> +\t\t\t.tx_buf = st->tx,\n"
+ "> +\t\t\t.rx_buf = st->rx,\n"
+ "> +\t\t\t.bits_per_word = 8,\n"
+ "> +\t\t\t.len = 4,\n"
  "> +\t\t}\n"
  "> +\t};\n"
  "> +\n"
  "> +\tmutex_lock(&st->buf_lock);\n"
- "> +\tst->tx[0] =3D ADXRS450_SENSOR_DATA;\n"
- "> +\tst->tx[1] =3D 0;\n"
- "> +\tst->tx[2] =3D 0;\n"
- "> +\tst->tx[3] =3D 0;\n"
+ "> +\tst->tx[0] = ADXRS450_SENSOR_DATA;\n"
+ "> +\tst->tx[1] = 0;\n"
+ "> +\tst->tx[2] = 0;\n"
+ "> +\tst->tx[3] = 0;\n"
  "> +\n"
  "> +\tspi_message_init(&msg);\n"
  "> +\tspi_message_add_tail(&xfers[0], &msg);\n"
- "> +\tret =3D spi_sync(st->us, &msg);\n"
+ "> +\tret = spi_sync(st->us, &msg);\n"
  "> +\tif (ret) {\n"
  "> +\t\tdev_err(&st->us->dev, \"Problem while reading sensor data\\n\");\n"
  "> +\t\tgoto error_ret;\n"
@@ -345,14 +322,13 @@
  "> +\n"
  "> +\tspi_message_init(&msg);\n"
  "> +\tspi_message_add_tail(&xfers[0], &msg);\n"
- "> +\tret =3D spi_sync(st->us, &msg);\n"
+ "> +\tret = spi_sync(st->us, &msg);\n"
  "> +\tif (ret) {\n"
  "> +\t\tdev_err(&st->us->dev, \"Problem while reading sensor data\\n\");\n"
  "> +\t\tgoto error_ret;\n"
  "> +\t}\n"
  "> +\n"
- "> +\t*val =3D (st->rx[0] & 0x03) << 14 | st->rx[1] << 6 | (st->rx[2] & 0=\n"
- "xfc) >> 2;\n"
+ "> +\t*val = (st->rx[0] & 0x03) << 14 | st->rx[1] << 6 | (st->rx[2] & 0xfc) >> 2;\n"
  "> +error_ret:\n"
  "> +\tmutex_unlock(&st->buf_lock);\n"
  "> +\treturn ret;\n"
@@ -360,54 +336,49 @@
  "> +\n"
  "\n"
  "This looks to only be called from initial setup. Might as well just\n"
- "make it take an adxrs450_state directly and save the careful indirectio=\n"
- "n\n"
- "that is currently going on to ensure it gets the same dev as the other =\n"
- "write\n"
+ "make it take an adxrs450_state directly and save the careful indirection\n"
+ "that is currently going on to ensure it gets the same dev as the other write\n"
  "functions.\n"
  "> +/**\n"
  "> + * adxrs450_spi_initial() - use for initializing procedure.\n"
- "> + * @dev: device associated with child of actual device (iio_dev or i=\n"
- "io_trig)\n"
+ "> + * @dev: device associated with child of actual device (iio_dev or iio_trig)\n"
  "> + * @val: somewhere to pass back the value read\n"
  "> + **/\n"
  "> +static int adxrs450_spi_initial(struct device *dev,\n"
  "> +\t\tu32 *val, char chk)\n"
  "> +{\n"
  "> +\tstruct spi_message msg;\n"
- "> +\tstruct iio_dev *indio_dev =3D dev_get_drvdata(dev);\n"
- "> +\tstruct adxrs450_state *st =3D iio_dev_get_devdata(indio_dev);\n"
+ "> +\tstruct iio_dev *indio_dev = dev_get_drvdata(dev);\n"
+ "> +\tstruct adxrs450_state *st = iio_dev_get_devdata(indio_dev);\n"
  "> +\tint ret;\n"
  "Another unneeded array.\n"
- "> +\tstruct spi_transfer xfers[] =3D {\n"
+ "> +\tstruct spi_transfer xfers[] = {\n"
  "> +\t\t{\n"
- "> +\t\t\t.tx_buf =3D st->tx,\n"
- "> +\t\t\t.rx_buf =3D st->rx,\n"
- "> +\t\t\t.bits_per_word =3D 8,\n"
- "> +\t\t\t.len =3D 4,\n"
+ "> +\t\t\t.tx_buf = st->tx,\n"
+ "> +\t\t\t.rx_buf = st->rx,\n"
+ "> +\t\t\t.bits_per_word = 8,\n"
+ "> +\t\t\t.len = 4,\n"
  "> +\t\t},\n"
  "> +\t};\n"
  "> +\n"
  "> +\tmutex_lock(&st->buf_lock);\n"
- "> +\tst->tx[0] =3D ADXRS450_SENSOR_DATA;\n"
- "> +\tst->tx[1] =3D 0;\n"
- "> +\tst->tx[2] =3D 0;\n"
- "> +\tst->tx[3] =3D 0;\n"
+ "> +\tst->tx[0] = ADXRS450_SENSOR_DATA;\n"
+ "> +\tst->tx[1] = 0;\n"
+ "> +\tst->tx[2] = 0;\n"
+ "> +\tst->tx[3] = 0;\n"
  "> +\tif (chk)\n"
- "> +\t\tst->tx[3] |=3D (ADXRS450_CHK | ADXRS450_P);\n"
+ "> +\t\tst->tx[3] |= (ADXRS450_CHK | ADXRS450_P);\n"
  "> +\tspi_message_init(&msg);\n"
  "> +\tspi_message_add_tail(&xfers[0], &msg);\n"
- "> +\tret =3D spi_sync(st->us, &msg);\n"
+ "> +\tret = spi_sync(st->us, &msg);\n"
  "> +\tif (ret) {\n"
- "> +\t\tdev_err(&st->us->dev, \"Problem while reading initializing data\\n\")=\n"
- ";\n"
+ "> +\t\tdev_err(&st->us->dev, \"Problem while reading initializing data\\n\");\n"
  "> +\t\tgoto error_ret;\n"
  "> +\t}\n"
  "> +\n"
  "Looks like an endinaness conversion to me. be32tocpu.\n"
  "\n"
- "> +\t*val =3D st->rx[0] << 24 | st->rx[1] << 16 | st->rx[2] << 8 | st->r=\n"
- "x[3];\n"
+ "> +\t*val = st->rx[0] << 24 | st->rx[1] << 16 | st->rx[2] << 8 | st->rx[3];\n"
  "> +\n"
  "> +error_ret:\n"
  "> +\tmutex_unlock(&st->buf_lock);\n"
@@ -418,15 +389,15 @@
  "> +\t\tstruct device_attribute *attr,\n"
  "> +\t\tchar *buf)\n"
  "> +{\n"
- "> +\tint ret, len =3D 0;\n"
+ "> +\tint ret, len = 0;\n"
  "No need to initialize len.\n"
  "> +\tu16 t;\n"
- "> +\tret =3D adxrs450_spi_read_reg_16(dev,\n"
+ "> +\tret = adxrs450_spi_read_reg_16(dev,\n"
  "> +\t\t\tADXRS450_TEMP1,\n"
  "> +\t\t\t&t);\n"
  "> +\tif (ret)\n"
  "> +\t\treturn ret;\n"
- "> +\tlen =3D sprintf(buf, \"%d\\n\", t);\n"
+ "> +\tlen = sprintf(buf, \"%d\\n\", t);\n"
  "> +\treturn len;\n"
  "> +}\n"
  "> +\n"
@@ -434,15 +405,15 @@
  "> +\t\tstruct device_attribute *attr,\n"
  "> +\t\tchar *buf)\n"
  "> +{\n"
- "> +\tint ret, len =3D 0;\n"
+ "> +\tint ret, len = 0;\n"
  "Same for this len\n"
  "> +\tu16 t;\n"
- "> +\tret =3D adxrs450_spi_read_reg_16(dev,\n"
+ "> +\tret = adxrs450_spi_read_reg_16(dev,\n"
  "> +\t\t\tADXRS450_QUAD1,\n"
  "> +\t\t\t&t);\n"
  "> +\tif (ret)\n"
  "> +\t\treturn ret;\n"
- "> +\tlen =3D sprintf(buf, \"%d\\n\", t);\n"
+ "> +\tlen = sprintf(buf, \"%d\\n\", t);\n"
  "> +\treturn len;\n"
  "> +}\n"
  "> +\n"
@@ -454,10 +425,10 @@
  "> +\tint ret;\n"
  "> +\tu16 val;\n"
  "> +\n"
- "> +\tif (len =3D=3D 0 || len > 2)\n"
+ "> +\tif (len == 0 || len > 2)\n"
  "> +\t\treturn -EINVAL;\n"
  "> +\tmemcpy(&val, buf, len);\n"
- "> +\tret =3D adxrs450_spi_write_reg_16(dev,\n"
+ "> +\tret = adxrs450_spi_write_reg_16(dev,\n"
  "> +\t\t\tADXRS450_DNC1,\n"
  "> +\t\t\t&val);\n"
  "Err, so what is meant to be written to this?  Looks like you'll be\n"
@@ -471,15 +442,15 @@
  "> +\t\tstruct device_attribute *attr,\n"
  "> +\t\tchar *buf)\n"
  "> +{\n"
- "> +\tint ret, len =3D 0;\n"
+ "> +\tint ret, len = 0;\n"
  "another unneeded init of len\n"
  "> +\tu16 t;\n"
  "> +\n"
- "> +\tret =3D adxrs450_spi_sensor_data(dev, &t);\n"
+ "> +\tret = adxrs450_spi_sensor_data(dev, &t);\n"
  "> +\tif (ret)\n"
  "> +\t\treturn ret;\n"
  "> +\n"
- "> +\tlen =3D sprintf(buf, \"%d\\n\", t);\n"
+ "> +\tlen = sprintf(buf, \"%d\\n\", t);\n"
  "> +\treturn len;\n"
  "> +}\n"
  "> +\n"
@@ -489,60 +460,60 @@
  "> +\tu32 t;\n"
  "> +\tu16 data;\n"
  "> +\tint ret;\n"
- "> +\tstruct device *dev =3D &st->indio_dev->dev;\n"
+ "> +\tstruct device *dev = &st->indio_dev->dev;\n"
  "> +\n"
  "> +\tmsleep(ADXRS450_STARTUP_DELAY*2);\n"
- "> +\tret =3D adxrs450_spi_initial(dev, &t, 1);\n"
+ "> +\tret = adxrs450_spi_initial(dev, &t, 1);\n"
  "> +\tif (ret)\n"
  "> +\t\treturn ret;\n"
- "> +\tif (t !=3D 0x01) {\n"
+ "> +\tif (t != 0x01) {\n"
  "> +\t\tdev_err(&st->us->dev, \"The initial response is not correct!\\n\");\n"
  "> +\t\treturn -ENODEV;\n"
  "> +\n"
  "> +\t}\n"
  "> +\n"
  "> +\tmsleep(ADXRS450_STARTUP_DELAY);\n"
- "> +\tret =3D adxrs450_spi_initial(dev, &t, 0);\n"
+ "> +\tret = adxrs450_spi_initial(dev, &t, 0);\n"
  "> +\tif (ret)\n"
  "> +\t\treturn ret;\n"
  "> +\n"
  "> +\tmsleep(ADXRS450_STARTUP_DELAY);\n"
- "> +\tret =3D adxrs450_spi_initial(dev, &t, 0);\n"
+ "> +\tret = adxrs450_spi_initial(dev, &t, 0);\n"
  "> +\tif (ret)\n"
  "> +\t\treturn ret;\n"
- "> +\tif (((t & 0xff) | 0x01) !=3D 0xff || ADXRS450_GET_ST(t) !=3D 2) {\n"
+ "> +\tif (((t & 0xff) | 0x01) != 0xff || ADXRS450_GET_ST(t) != 2) {\n"
  "> +\t\tdev_err(&st->us->dev, \"The second response is not correct!\\n\");\n"
  "> +\t\treturn -EIO;\n"
  "> +\n"
  "> +\t}\n"
- "> +\tret =3D adxrs450_spi_initial(dev, &t, 0);\n"
+ "> +\tret = adxrs450_spi_initial(dev, &t, 0);\n"
  "> +\tif (ret)\n"
  "> +\t\treturn ret;\n"
- "> +\tif (((t & 0xff) | 0x01) !=3D 0xff || ADXRS450_GET_ST(t) !=3D 2) {\n"
+ "> +\tif (((t & 0xff) | 0x01) != 0xff || ADXRS450_GET_ST(t) != 2) {\n"
  "> +\t\tdev_err(&st->us->dev, \"The third response is not correct!\\n\");\n"
  "> +\t\treturn -EIO;\n"
  "> +\n"
  "> +\t}\n"
- "> +\tret =3D adxrs450_spi_read_reg_16(dev, ADXRS450_FAULT1, &data);\n"
+ "> +\tret = adxrs450_spi_read_reg_16(dev, ADXRS450_FAULT1, &data);\n"
  "> +\tif (ret)\n"
  "> +\t\treturn ret;\n"
  "> +\tif (data & 0x0fff) {\n"
  "> +\t\tdev_err(&st->us->dev, \"The device is not in normal status!\\n\");\n"
  "> +\t\treturn -EINVAL;\n"
  "> +\t}\n"
- "> +\tret =3D adxrs450_spi_read_reg_16(dev, ADXRS450_PID1, &data);\n"
+ "> +\tret = adxrs450_spi_read_reg_16(dev, ADXRS450_PID1, &data);\n"
  "> +\tif (ret)\n"
  "> +\t\treturn ret;\n"
  "> +\tdev_info(&st->us->dev, \"The Part ID is 0x%x\\n\", data);\n"
  "> +\n"
- "> +\tret =3D adxrs450_spi_read_reg_16(dev, ADXRS450_SNL, &data);\n"
+ "> +\tret = adxrs450_spi_read_reg_16(dev, ADXRS450_SNL, &data);\n"
  "> +\tif (ret)\n"
  "> +\t\treturn ret;\n"
- "> +\tt =3D data;\n"
- "> +\tret =3D adxrs450_spi_read_reg_16(dev, ADXRS450_SNH, &data);\n"
+ "> +\tt = data;\n"
+ "> +\tret = adxrs450_spi_read_reg_16(dev, ADXRS450_SNH, &data);\n"
  "> +\tif (ret)\n"
  "> +\t\treturn ret;\n"
- "> +\tt |=3D data << 16;\n"
+ "> +\tt |= data << 16;\n"
  "> +\tdev_info(&st->us->dev, \"The Serial Number is 0x%x\\n\", t);\n"
  "> +\n"
  "> +\tdev_info(&st->us->dev, \"%s at CS%d\\n\", DRIVER_NAME,\n"
@@ -567,7 +538,7 @@
  "> +\t\tNULL, adxrs450_write_dnc, 0);\n"
  "> +static IIO_CONST_ATTR(name, \"adxrs450\");\n"
  "> +\n"
- "> +static struct attribute *adxrs450_attributes[] =3D {\n"
+ "> +static struct attribute *adxrs450_attributes[] = {\n"
  "bonus blank line here. Please remove.\n"
  "> +\n"
  "> +\t&iio_dev_attr_gyro_z_raw.dev_attr.attr,\n"
@@ -578,54 +549,54 @@
  "> +\tNULL\n"
  "> +};\n"
  "> +\n"
- "> +static const struct attribute_group adxrs450_attribute_group =3D {\n"
- "> +\t.attrs =3D adxrs450_attributes,\n"
+ "> +static const struct attribute_group adxrs450_attribute_group = {\n"
+ "> +\t.attrs = adxrs450_attributes,\n"
  "> +};\n"
  "> +\n"
  "> +static int __devinit adxrs450_probe(struct spi_device *spi)\n"
  "> +{\n"
- "> +\tint ret, regdone =3D 0;\n"
- "> +\tstruct adxrs450_state *st =3D kzalloc(sizeof *st, GFP_KERNEL);\n"
+ "> +\tint ret, regdone = 0;\n"
+ "> +\tstruct adxrs450_state *st = kzalloc(sizeof *st, GFP_KERNEL);\n"
  "> +\tif (!st) {\n"
- "> +\t\tret =3D  -ENOMEM;\n"
+ "> +\t\tret =  -ENOMEM;\n"
  "> +\t\tgoto error_ret;\n"
  "> +\t}\n"
  "> +\t/* This is only used for removal purposes */\n"
  "> +\tspi_set_drvdata(spi, st);\n"
  "> +\n"
  "> +\t/* Allocate the comms buffers */\n"
- "> +\tst->rx =3D kzalloc(sizeof(*st->rx)*ADXRS450_MAX_RX, GFP_KERNEL);\n"
- "> +\tif (st->rx =3D=3D NULL) {\n"
- "> +\t\tret =3D -ENOMEM;\n"
+ "> +\tst->rx = kzalloc(sizeof(*st->rx)*ADXRS450_MAX_RX, GFP_KERNEL);\n"
+ "> +\tif (st->rx == NULL) {\n"
+ "> +\t\tret = -ENOMEM;\n"
  "> +\t\tgoto error_free_st;\n"
  "> +\t}\n"
- "> +\tst->tx =3D kzalloc(sizeof(*st->tx)*ADXRS450_MAX_TX, GFP_KERNEL);\n"
- "> +\tif (st->tx =3D=3D NULL) {\n"
- "> +\t\tret =3D -ENOMEM;\n"
+ "> +\tst->tx = kzalloc(sizeof(*st->tx)*ADXRS450_MAX_TX, GFP_KERNEL);\n"
+ "> +\tif (st->tx == NULL) {\n"
+ "> +\t\tret = -ENOMEM;\n"
  "> +\t\tgoto error_free_rx;\n"
  "> +\t}\n"
- "> +\tst->us =3D spi;\n"
+ "> +\tst->us = spi;\n"
  "> +\tmutex_init(&st->buf_lock);\n"
  "> +\t/* setup the industrialio driver allocated elements */\n"
- "> +\tst->indio_dev =3D iio_allocate_device();\n"
- "> +\tif (st->indio_dev =3D=3D NULL) {\n"
- "> +\t\tret =3D -ENOMEM;\n"
+ "> +\tst->indio_dev = iio_allocate_device();\n"
+ "> +\tif (st->indio_dev == NULL) {\n"
+ "> +\t\tret = -ENOMEM;\n"
  "> +\t\tgoto error_free_tx;\n"
  "> +\t}\n"
  "> +\n"
- "> +\tst->indio_dev->dev.parent =3D &spi->dev;\n"
- "> +\tst->indio_dev->attrs =3D &adxrs450_attribute_group;\n"
- "> +\tst->indio_dev->dev_data =3D (void *)(st);\n"
- "> +\tst->indio_dev->driver_module =3D THIS_MODULE;\n"
- "> +\tst->indio_dev->modes =3D INDIO_DIRECT_MODE;\n"
+ "> +\tst->indio_dev->dev.parent = &spi->dev;\n"
+ "> +\tst->indio_dev->attrs = &adxrs450_attribute_group;\n"
+ "> +\tst->indio_dev->dev_data = (void *)(st);\n"
+ "> +\tst->indio_dev->driver_module = THIS_MODULE;\n"
+ "> +\tst->indio_dev->modes = INDIO_DIRECT_MODE;\n"
  "> +\n"
- "> +\tret =3D iio_device_register(st->indio_dev);\n"
+ "> +\tret = iio_device_register(st->indio_dev);\n"
  "> +\tif (ret)\n"
  "> +\t\tgoto error_free_dev;\n"
- "> +\tregdone =3D 1;\n"
+ "> +\tregdone = 1;\n"
  "> +\n"
  "> +\t/* Get the device into a sane initial state */\n"
- "> +\tret =3D adxrs450_initial_setup(st);\n"
+ "> +\tret = adxrs450_initial_setup(st);\n"
  "> +\tif (ret)\n"
  "> +\t\tgoto error_initial;\n"
  "> +\treturn 0;\n"
@@ -649,12 +620,12 @@
  "> +/* fixme, confirm ordering in this function */\n"
  "> +static int adxrs450_remove(struct spi_device *spi)\n"
  "> +{\n"
- "> +\tstruct adxrs450_state *st =3D spi_get_drvdata(spi);\n"
+ "> +\tstruct adxrs450_state *st = spi_get_drvdata(spi);\n"
  "\n"
  "Might as well just go with\n"
  "\n"
  "iio_device_unregister(st->indio_dev);\n"
- "> +\tstruct iio_dev *indio_dev =3D st->indio_dev;\n"
+ "> +\tstruct iio_dev *indio_dev = st->indio_dev;\n"
  "> +\n"
  "> +\tiio_device_unregister(indio_dev);\n"
  "> +\tkfree(st->tx);\n"
@@ -664,13 +635,13 @@
  "> +\treturn 0;\n"
  "> +}\n"
  "> +\n"
- "> +static struct spi_driver adxrs450_driver =3D {\n"
- "> +\t.driver =3D {\n"
- "> +\t\t.name =3D \"adxrs450\",\n"
- "> +\t\t.owner =3D THIS_MODULE,\n"
+ "> +static struct spi_driver adxrs450_driver = {\n"
+ "> +\t.driver = {\n"
+ "> +\t\t.name = \"adxrs450\",\n"
+ "> +\t\t.owner = THIS_MODULE,\n"
  "> +\t},\n"
- "> +\t.probe =3D adxrs450_probe,\n"
- "> +\t.remove =3D __devexit_p(adxrs450_remove),\n"
+ "> +\t.probe = adxrs450_probe,\n"
+ "> +\t.remove = __devexit_p(adxrs450_remove),\n"
  "> +};\n"
  "> +\n"
  "> +static __init int adxrs450_init(void)\n"
@@ -689,4 +660,4 @@
  "> +MODULE_DESCRIPTION(\"Analog Devices ADXRS450 Gyroscope SPI driver\");\n"
  "> +MODULE_LICENSE(\"GPL v2\");"
 
-32ce5bc6fa5c7f9201b48d7a6066665b1c81f6eb0ed3dcf8658178a75e30b40f
+77681b489bc671e5fbdc7d95b50cac47101af5aa9889e71f5bb5b9f456454da1

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.