All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Add/Remove spaces
@ 2017-04-01  4:28 Arushi Singhal
  2017-04-01  4:28 ` [PATCH 1/2] iio: adc: replace comma with a semicolon Arushi Singhal
  2017-04-01  4:28 ` [PATCH 2/2] staging: iio: meter: Replace mlock with driver private buf_lock Arushi Singhal
  0 siblings, 2 replies; 3+ messages in thread
From: Arushi Singhal @ 2017-04-01  4:28 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Arushi Singhal

Add and remove spaces to follow kernel coding style.

Arushi Singhal (2):
  iio: adc: replace comma with a semicolon
  staging: iio: meter: Replace mlock with driver private buf_lock

 drivers/iio/adc/max11100.c          | 4 ++--
 drivers/staging/iio/meter/ade7759.c | 9 ++++++---
 2 files changed, 8 insertions(+), 5 deletions(-)

-- 
2.11.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] iio: adc: replace comma with a semicolon
  2017-04-01  4:28 [PATCH 0/2] Add/Remove spaces Arushi Singhal
@ 2017-04-01  4:28 ` Arushi Singhal
  2017-04-01  4:28 ` [PATCH 2/2] staging: iio: meter: Replace mlock with driver private buf_lock Arushi Singhal
  1 sibling, 0 replies; 3+ messages in thread
From: Arushi Singhal @ 2017-04-01  4:28 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Arushi Singhal

Replace a comma between expression statements by a semicolon. This
changes the semantics of the code, but given the current indentation
appears to be what is intended.
A simplified version of the Coccinelle semantic patch that performs this
transformation is as follows:

// <smpl>
@r@
expression e1,e2;
@@

 e1
-,
+;
 e2;
// </smpl>

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
---
 drivers/iio/adc/max11100.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/adc/max11100.c b/drivers/iio/adc/max11100.c
index 23c060e1b663..1180bcc22ff1 100644
--- a/drivers/iio/adc/max11100.c
+++ b/drivers/iio/adc/max11100.c
@@ -124,8 +124,8 @@ static int max11100_probe(struct spi_device *spi)
 	indio_dev->name = "max11100";
 	indio_dev->info = &max11100_info;
 	indio_dev->modes = INDIO_DIRECT_MODE;
-	indio_dev->channels = max11100_channels,
-	indio_dev->num_channels = ARRAY_SIZE(max11100_channels),
+	indio_dev->channels = max11100_channels;
+	indio_dev->num_channels = ARRAY_SIZE(max11100_channels);
 
 	state->vref_reg = devm_regulator_get(&spi->dev, "vref");
 	if (IS_ERR(state->vref_reg))
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] staging: iio: meter: Replace mlock with driver private buf_lock
  2017-04-01  4:28 [PATCH 0/2] Add/Remove spaces Arushi Singhal
  2017-04-01  4:28 ` [PATCH 1/2] iio: adc: replace comma with a semicolon Arushi Singhal
@ 2017-04-01  4:28 ` Arushi Singhal
  1 sibling, 0 replies; 3+ messages in thread
From: Arushi Singhal @ 2017-04-01  4:28 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Arushi Singhal

The driver needs to insure atomicity during frequency
changes of bus and device. The iiodev->mlock as used
was not doing that. Replace it with the drivers existing
buffer lock and execute spi_write directly.

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
---
 drivers/staging/iio/meter/ade7759.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/iio/meter/ade7759.c b/drivers/staging/iio/meter/ade7759.c
index 0b65f1847510..a5ee4501d30a 100644
--- a/drivers/staging/iio/meter/ade7759.c
+++ b/drivers/staging/iio/meter/ade7759.c
@@ -429,7 +429,7 @@ static ssize_t ade7759_write_frequency(struct device *dev,
 	if (!val)
 		return -EINVAL;
 
-	mutex_lock(&indio_dev->mlock);
+	mutex_lock(&st->buf_lock);
 
 	t = 27900 / val;
 	if (t > 0)
@@ -447,10 +447,13 @@ static ssize_t ade7759_write_frequency(struct device *dev,
 	reg &= ~(3 << 13);
 	reg |= t << 13;
 
-	ret = ade7759_spi_write_reg_16(dev, ADE7759_MODE, reg);
+	st->tx[0] = ADE7759_WRITE_REG(ADE7759_MODE);
+	st->tx[1] = reg;
+
+	ret = spi_write(st->us, st->tx, 2);
 
 out:
-	mutex_unlock(&indio_dev->mlock);
+	mutex_unlock(&st->buf_lock);
 
 	return ret ? ret : len;
 }
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-04-01  4:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-01  4:28 [PATCH 0/2] Add/Remove spaces Arushi Singhal
2017-04-01  4:28 ` [PATCH 1/2] iio: adc: replace comma with a semicolon Arushi Singhal
2017-04-01  4:28 ` [PATCH 2/2] staging: iio: meter: Replace mlock with driver private buf_lock Arushi Singhal

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.