All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/7] iio: hid-sensor-press: Fix return values
@ 2014-07-03  6:44 Sachin Kamat
  2014-07-03  6:44 ` [PATCH 2/7] iio: hid-sensor-accel-3d: " Sachin Kamat
                   ` (7 more replies)
  0 siblings, 8 replies; 16+ messages in thread
From: Sachin Kamat @ 2014-07-03  6:44 UTC (permalink / raw)
  To: linux-iio; +Cc: jic23, spk.linux, Srinivas Pandruvada

IIO_CHAN_INFO_SAMP_FREQ and IIO_CHAN_INFO_HYSTERESIS cases ignored
the actual return values (which could be -EINVAL) and instead
returned IIO_VAL_INT_PLUS_MICRO always. Return the actual value
obtained from the functions. Both functions return IIO_VAL_INT_PLUS_MICRO
upon success.

Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com>
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
---
 drivers/iio/pressure/hid-sensor-press.c |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/iio/pressure/hid-sensor-press.c b/drivers/iio/pressure/hid-sensor-press.c
index 1cd190c..2c0d2a4 100644
--- a/drivers/iio/pressure/hid-sensor-press.c
+++ b/drivers/iio/pressure/hid-sensor-press.c
@@ -78,7 +78,6 @@ static int press_read_raw(struct iio_dev *indio_dev,
 	struct press_state *press_state = iio_priv(indio_dev);
 	int report_id = -1;
 	u32 address;
-	int ret;
 	int ret_type;
 	s32 poll_value;
 
@@ -128,14 +127,12 @@ static int press_read_raw(struct iio_dev *indio_dev,
 		ret_type = IIO_VAL_INT;
 		break;
 	case IIO_CHAN_INFO_SAMP_FREQ:
-		ret = hid_sensor_read_samp_freq_value(
+		ret_type = hid_sensor_read_samp_freq_value(
 				&press_state->common_attributes, val, val2);
-		ret_type = IIO_VAL_INT_PLUS_MICRO;
 		break;
 	case IIO_CHAN_INFO_HYSTERESIS:
-		ret = hid_sensor_read_raw_hyst_value(
+		ret_type = hid_sensor_read_raw_hyst_value(
 				&press_state->common_attributes, val, val2);
-		ret_type = IIO_VAL_INT_PLUS_MICRO;
 		break;
 	default:
 		ret_type = -EINVAL;
-- 
1.7.9.5

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

* [PATCH 2/7] iio: hid-sensor-accel-3d: Fix return values
  2014-07-03  6:44 [PATCH 1/7] iio: hid-sensor-press: Fix return values Sachin Kamat
@ 2014-07-03  6:44 ` Sachin Kamat
  2014-07-05 10:09   ` Jonathan Cameron
  2014-07-03  6:44 ` [PATCH 3/7] iio: hid-sensor-magn-3d: " Sachin Kamat
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 16+ messages in thread
From: Sachin Kamat @ 2014-07-03  6:44 UTC (permalink / raw)
  To: linux-iio; +Cc: jic23, spk.linux, Srinivas Pandruvada

IIO_CHAN_INFO_SAMP_FREQ and IIO_CHAN_INFO_HYSTERESIS cases ignored
the actual return values (which could be -EINVAL) and instead
returned IIO_VAL_INT_PLUS_MICRO always. Return the actual value
obtained from the functions. Both functions return IIO_VAL_INT_PLUS_MICRO
upon success.

Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com>
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
---
 drivers/iio/accel/hid-sensor-accel-3d.c |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/iio/accel/hid-sensor-accel-3d.c b/drivers/iio/accel/hid-sensor-accel-3d.c
index 69abf91..54e464e 100644
--- a/drivers/iio/accel/hid-sensor-accel-3d.c
+++ b/drivers/iio/accel/hid-sensor-accel-3d.c
@@ -110,7 +110,6 @@ static int accel_3d_read_raw(struct iio_dev *indio_dev,
 	struct accel_3d_state *accel_state = iio_priv(indio_dev);
 	int report_id = -1;
 	u32 address;
-	int ret;
 	int ret_type;
 	s32 poll_value;
 
@@ -151,14 +150,12 @@ static int accel_3d_read_raw(struct iio_dev *indio_dev,
 		ret_type = IIO_VAL_INT;
 		break;
 	case IIO_CHAN_INFO_SAMP_FREQ:
-		ret = hid_sensor_read_samp_freq_value(
+		ret_type = hid_sensor_read_samp_freq_value(
 			&accel_state->common_attributes, val, val2);
-		ret_type = IIO_VAL_INT_PLUS_MICRO;
 		break;
 	case IIO_CHAN_INFO_HYSTERESIS:
-		ret = hid_sensor_read_raw_hyst_value(
+		ret_type = hid_sensor_read_raw_hyst_value(
 			&accel_state->common_attributes, val, val2);
-		ret_type = IIO_VAL_INT_PLUS_MICRO;
 		break;
 	default:
 		ret_type = -EINVAL;
-- 
1.7.9.5


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

* [PATCH 3/7] iio: hid-sensor-magn-3d: Fix return values
  2014-07-03  6:44 [PATCH 1/7] iio: hid-sensor-press: Fix return values Sachin Kamat
  2014-07-03  6:44 ` [PATCH 2/7] iio: hid-sensor-accel-3d: " Sachin Kamat
@ 2014-07-03  6:44 ` Sachin Kamat
  2014-07-05 10:09   ` Jonathan Cameron
  2014-07-03  6:44 ` [PATCH 4/7] iio: hid-sensor-als: " Sachin Kamat
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 16+ messages in thread
From: Sachin Kamat @ 2014-07-03  6:44 UTC (permalink / raw)
  To: linux-iio; +Cc: jic23, spk.linux, Srinivas Pandruvada

IIO_CHAN_INFO_SAMP_FREQ and IIO_CHAN_INFO_HYSTERESIS cases ignored
the actual return values (which could be -EINVAL) and instead
returned IIO_VAL_INT_PLUS_MICRO always. Return the actual value
obtained from the functions. Both functions return IIO_VAL_INT_PLUS_MICRO
upon success.

Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com>
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
---
 drivers/iio/magnetometer/hid-sensor-magn-3d.c |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/iio/magnetometer/hid-sensor-magn-3d.c b/drivers/iio/magnetometer/hid-sensor-magn-3d.c
index 41cf29e..b2b0937 100644
--- a/drivers/iio/magnetometer/hid-sensor-magn-3d.c
+++ b/drivers/iio/magnetometer/hid-sensor-magn-3d.c
@@ -110,7 +110,6 @@ static int magn_3d_read_raw(struct iio_dev *indio_dev,
 	struct magn_3d_state *magn_state = iio_priv(indio_dev);
 	int report_id = -1;
 	u32 address;
-	int ret;
 	int ret_type;
 	s32 poll_value;
 
@@ -153,14 +152,12 @@ static int magn_3d_read_raw(struct iio_dev *indio_dev,
 		ret_type = IIO_VAL_INT;
 		break;
 	case IIO_CHAN_INFO_SAMP_FREQ:
-		ret = hid_sensor_read_samp_freq_value(
+		ret_type = hid_sensor_read_samp_freq_value(
 			&magn_state->common_attributes, val, val2);
-		ret_type = IIO_VAL_INT_PLUS_MICRO;
 		break;
 	case IIO_CHAN_INFO_HYSTERESIS:
-		ret = hid_sensor_read_raw_hyst_value(
+		ret_type = hid_sensor_read_raw_hyst_value(
 			&magn_state->common_attributes, val, val2);
-		ret_type = IIO_VAL_INT_PLUS_MICRO;
 		break;
 	default:
 		ret_type = -EINVAL;
-- 
1.7.9.5


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

* [PATCH 4/7] iio: hid-sensor-als: Fix return values
  2014-07-03  6:44 [PATCH 1/7] iio: hid-sensor-press: Fix return values Sachin Kamat
  2014-07-03  6:44 ` [PATCH 2/7] iio: hid-sensor-accel-3d: " Sachin Kamat
  2014-07-03  6:44 ` [PATCH 3/7] iio: hid-sensor-magn-3d: " Sachin Kamat
@ 2014-07-03  6:44 ` Sachin Kamat
  2014-07-05 10:10   ` Jonathan Cameron
  2014-07-03  6:44 ` [PATCH 5/7] iio: hid-sensor-gyro-3d: " Sachin Kamat
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 16+ messages in thread
From: Sachin Kamat @ 2014-07-03  6:44 UTC (permalink / raw)
  To: linux-iio; +Cc: jic23, spk.linux, Srinivas Pandruvada

IIO_CHAN_INFO_SAMP_FREQ and IIO_CHAN_INFO_HYSTERESIS cases ignored
the actual return values (which could be -EINVAL) and instead
returned IIO_VAL_INT_PLUS_MICRO always. Return the actual value
obtained from the functions. Both functions return IIO_VAL_INT_PLUS_MICRO
upon success.

Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com>
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
---
 drivers/iio/light/hid-sensor-als.c |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/iio/light/hid-sensor-als.c b/drivers/iio/light/hid-sensor-als.c
index f34c943..96e71e1 100644
--- a/drivers/iio/light/hid-sensor-als.c
+++ b/drivers/iio/light/hid-sensor-als.c
@@ -79,7 +79,6 @@ static int als_read_raw(struct iio_dev *indio_dev,
 	struct als_state *als_state = iio_priv(indio_dev);
 	int report_id = -1;
 	u32 address;
-	int ret;
 	int ret_type;
 	s32 poll_value;
 
@@ -129,14 +128,12 @@ static int als_read_raw(struct iio_dev *indio_dev,
 		ret_type = IIO_VAL_INT;
 		break;
 	case IIO_CHAN_INFO_SAMP_FREQ:
-		ret = hid_sensor_read_samp_freq_value(
+		ret_type = hid_sensor_read_samp_freq_value(
 				&als_state->common_attributes, val, val2);
-		ret_type = IIO_VAL_INT_PLUS_MICRO;
 		break;
 	case IIO_CHAN_INFO_HYSTERESIS:
-		ret = hid_sensor_read_raw_hyst_value(
+		ret_type = hid_sensor_read_raw_hyst_value(
 				&als_state->common_attributes, val, val2);
-		ret_type = IIO_VAL_INT_PLUS_MICRO;
 		break;
 	default:
 		ret_type = -EINVAL;
-- 
1.7.9.5


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

* [PATCH 5/7] iio: hid-sensor-gyro-3d: Fix return values
  2014-07-03  6:44 [PATCH 1/7] iio: hid-sensor-press: Fix return values Sachin Kamat
                   ` (2 preceding siblings ...)
  2014-07-03  6:44 ` [PATCH 4/7] iio: hid-sensor-als: " Sachin Kamat
@ 2014-07-03  6:44 ` Sachin Kamat
  2014-07-05 10:10   ` Jonathan Cameron
  2014-07-03  6:44 ` [PATCH 6/7] iio: hid-sensor-prox: " Sachin Kamat
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 16+ messages in thread
From: Sachin Kamat @ 2014-07-03  6:44 UTC (permalink / raw)
  To: linux-iio; +Cc: jic23, spk.linux, Srinivas Pandruvada

IIO_CHAN_INFO_SAMP_FREQ and IIO_CHAN_INFO_HYSTERESIS cases ignored
the actual return values (which could be -EINVAL) and instead
returned IIO_VAL_INT_PLUS_MICRO always. Return the actual value
obtained from the functions. Both functions return IIO_VAL_INT_PLUS_MICRO
upon success.

Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com>
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
---
 drivers/iio/gyro/hid-sensor-gyro-3d.c |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/iio/gyro/hid-sensor-gyro-3d.c b/drivers/iio/gyro/hid-sensor-gyro-3d.c
index 40f4e49..fa034a3 100644
--- a/drivers/iio/gyro/hid-sensor-gyro-3d.c
+++ b/drivers/iio/gyro/hid-sensor-gyro-3d.c
@@ -110,7 +110,6 @@ static int gyro_3d_read_raw(struct iio_dev *indio_dev,
 	struct gyro_3d_state *gyro_state = iio_priv(indio_dev);
 	int report_id = -1;
 	u32 address;
-	int ret;
 	int ret_type;
 	s32 poll_value;
 
@@ -151,14 +150,12 @@ static int gyro_3d_read_raw(struct iio_dev *indio_dev,
 		ret_type = IIO_VAL_INT;
 		break;
 	case IIO_CHAN_INFO_SAMP_FREQ:
-		ret = hid_sensor_read_samp_freq_value(
+		ret_type = hid_sensor_read_samp_freq_value(
 			&gyro_state->common_attributes, val, val2);
-			ret_type = IIO_VAL_INT_PLUS_MICRO;
 		break;
 	case IIO_CHAN_INFO_HYSTERESIS:
-		ret = hid_sensor_read_raw_hyst_value(
+		ret_type = hid_sensor_read_raw_hyst_value(
 			&gyro_state->common_attributes, val, val2);
-		ret_type = IIO_VAL_INT_PLUS_MICRO;
 		break;
 	default:
 		ret_type = -EINVAL;
-- 
1.7.9.5


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

* [PATCH 6/7] iio: hid-sensor-prox: Fix return values
  2014-07-03  6:44 [PATCH 1/7] iio: hid-sensor-press: Fix return values Sachin Kamat
                   ` (3 preceding siblings ...)
  2014-07-03  6:44 ` [PATCH 5/7] iio: hid-sensor-gyro-3d: " Sachin Kamat
@ 2014-07-03  6:44 ` Sachin Kamat
  2014-07-05 10:11   ` Jonathan Cameron
  2014-07-03  6:44 ` [PATCH 7/7] iio: hid-sensors: Fix compilation warning Sachin Kamat
                   ` (2 subsequent siblings)
  7 siblings, 1 reply; 16+ messages in thread
From: Sachin Kamat @ 2014-07-03  6:44 UTC (permalink / raw)
  To: linux-iio; +Cc: jic23, spk.linux, Srinivas Pandruvada

IIO_CHAN_INFO_SAMP_FREQ and IIO_CHAN_INFO_HYSTERESIS cases ignored
the actual return values (which could be -EINVAL) and instead
returned IIO_VAL_INT_PLUS_MICRO always. Return the actual value
obtained from the functions. Both functions return IIO_VAL_INT_PLUS_MICRO
upon success.

Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com>
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
---
 drivers/iio/light/hid-sensor-prox.c |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/iio/light/hid-sensor-prox.c b/drivers/iio/light/hid-sensor-prox.c
index d203ef4..412bae8 100644
--- a/drivers/iio/light/hid-sensor-prox.c
+++ b/drivers/iio/light/hid-sensor-prox.c
@@ -74,7 +74,6 @@ static int prox_read_raw(struct iio_dev *indio_dev,
 	struct prox_state *prox_state = iio_priv(indio_dev);
 	int report_id = -1;
 	u32 address;
-	int ret;
 	int ret_type;
 	s32 poll_value;
 
@@ -125,14 +124,12 @@ static int prox_read_raw(struct iio_dev *indio_dev,
 		ret_type = IIO_VAL_INT;
 		break;
 	case IIO_CHAN_INFO_SAMP_FREQ:
-		ret = hid_sensor_read_samp_freq_value(
+		ret_type = hid_sensor_read_samp_freq_value(
 				&prox_state->common_attributes, val, val2);
-		ret_type = IIO_VAL_INT_PLUS_MICRO;
 		break;
 	case IIO_CHAN_INFO_HYSTERESIS:
-		ret = hid_sensor_read_raw_hyst_value(
+		ret_type = hid_sensor_read_raw_hyst_value(
 				&prox_state->common_attributes, val, val2);
-		ret_type = IIO_VAL_INT_PLUS_MICRO;
 		break;
 	default:
 		ret_type = -EINVAL;
-- 
1.7.9.5


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

* [PATCH 7/7] iio: hid-sensors: Fix compilation warning
  2014-07-03  6:44 [PATCH 1/7] iio: hid-sensor-press: Fix return values Sachin Kamat
                   ` (4 preceding siblings ...)
  2014-07-03  6:44 ` [PATCH 6/7] iio: hid-sensor-prox: " Sachin Kamat
@ 2014-07-03  6:44 ` Sachin Kamat
  2014-07-05 10:21   ` Jonathan Cameron
  2014-07-03 23:01 ` [PATCH 1/7] iio: hid-sensor-press: Fix return values Srinivas Pandruvada
  2014-07-05 10:08 ` Jonathan Cameron
  7 siblings, 1 reply; 16+ messages in thread
From: Sachin Kamat @ 2014-07-03  6:44 UTC (permalink / raw)
  To: linux-iio; +Cc: jic23, spk.linux, Srinivas Pandruvada

Move the 'static' keyword to beginning of definition to silence the
following compilation warning:
drivers/iio/common/hid-sensors/hid-sensor-attributes.c:34:1: warning: ‘static’ is not at beginning of declaration [-Wold-style-declaration]

Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com>
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
---
 .../iio/common/hid-sensors/hid-sensor-attributes.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
index 403dd3d..1614340 100644
--- a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
+++ b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
@@ -26,12 +26,12 @@
 #include <linux/iio/iio.h>
 #include <linux/iio/sysfs.h>
 
-struct {
+static struct {
 	u32 usage_id;
 	int unit; /* 0 for default others from HID sensor spec */
 	int scale_val0; /* scale, whole number */
 	int scale_val1; /* scale, fraction in micros */
-} static unit_conversion[] = {
+} unit_conversion[] = {
 	{HID_USAGE_SENSOR_ACCEL_3D, 0, 9, 806650},
 	{HID_USAGE_SENSOR_ACCEL_3D,
 		HID_USAGE_SENSOR_UNITS_METERS_PER_SEC_SQRD, 1, 0},
-- 
1.7.9.5


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

* Re: [PATCH 1/7] iio: hid-sensor-press: Fix return values
  2014-07-03  6:44 [PATCH 1/7] iio: hid-sensor-press: Fix return values Sachin Kamat
                   ` (5 preceding siblings ...)
  2014-07-03  6:44 ` [PATCH 7/7] iio: hid-sensors: Fix compilation warning Sachin Kamat
@ 2014-07-03 23:01 ` Srinivas Pandruvada
  2014-07-04  5:51   ` Jonathan Cameron
  2014-07-05 10:08 ` Jonathan Cameron
  7 siblings, 1 reply; 16+ messages in thread
From: Srinivas Pandruvada @ 2014-07-03 23:01 UTC (permalink / raw)
  To: Sachin Kamat, linux-iio; +Cc: jic23, spk.linux

Thanks for the fix. Agree with the whole series.

Thanks,
Srinivas

On 07/02/2014 11:44 PM, Sachin Kamat wrote:
> IIO_CHAN_INFO_SAMP_FREQ and IIO_CHAN_INFO_HYSTERESIS cases ignored
> the actual return values (which could be -EINVAL) and instead
> returned IIO_VAL_INT_PLUS_MICRO always. Return the actual value
> obtained from the functions. Both functions return IIO_VAL_INT_PLUS_MICRO
> upon success.
>
> Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com>
> Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> ---
>   drivers/iio/pressure/hid-sensor-press.c |    7 ++-----
>   1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/iio/pressure/hid-sensor-press.c b/drivers/iio/pressure/hid-sensor-press.c
> index 1cd190c..2c0d2a4 100644
> --- a/drivers/iio/pressure/hid-sensor-press.c
> +++ b/drivers/iio/pressure/hid-sensor-press.c
> @@ -78,7 +78,6 @@ static int press_read_raw(struct iio_dev *indio_dev,
>   	struct press_state *press_state = iio_priv(indio_dev);
>   	int report_id = -1;
>   	u32 address;
> -	int ret;
>   	int ret_type;
>   	s32 poll_value;
>   
> @@ -128,14 +127,12 @@ static int press_read_raw(struct iio_dev *indio_dev,
>   		ret_type = IIO_VAL_INT;
>   		break;
>   	case IIO_CHAN_INFO_SAMP_FREQ:
> -		ret = hid_sensor_read_samp_freq_value(
> +		ret_type = hid_sensor_read_samp_freq_value(
>   				&press_state->common_attributes, val, val2);
> -		ret_type = IIO_VAL_INT_PLUS_MICRO;
>   		break;
>   	case IIO_CHAN_INFO_HYSTERESIS:
> -		ret = hid_sensor_read_raw_hyst_value(
> +		ret_type = hid_sensor_read_raw_hyst_value(
>   				&press_state->common_attributes, val, val2);
> -		ret_type = IIO_VAL_INT_PLUS_MICRO;
>   		break;
>   	default:
>   		ret_type = -EINVAL;

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

* Re: [PATCH 1/7] iio: hid-sensor-press: Fix return values
  2014-07-03 23:01 ` [PATCH 1/7] iio: hid-sensor-press: Fix return values Srinivas Pandruvada
@ 2014-07-04  5:51   ` Jonathan Cameron
  0 siblings, 0 replies; 16+ messages in thread
From: Jonathan Cameron @ 2014-07-04  5:51 UTC (permalink / raw)
  To: Srinivas Pandruvada, Sachin Kamat, linux-iio; +Cc: spk.linux

Acked-by ? 

I'll take it with the vague agreement but nice to have a formal note of it in git!

On July 4, 2014 12:01:25 AM GMT+01:00, Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> wrote:
>Thanks for the fix. Agree with the whole series.
>
>Thanks,
>Srinivas
>
>On 07/02/2014 11:44 PM, Sachin Kamat wrote:
>> IIO_CHAN_INFO_SAMP_FREQ and IIO_CHAN_INFO_HYSTERESIS cases ignored
>> the actual return values (which could be -EINVAL) and instead
>> returned IIO_VAL_INT_PLUS_MICRO always. Return the actual value
>> obtained from the functions. Both functions return
>IIO_VAL_INT_PLUS_MICRO
>> upon success.
>>
>> Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com>
>> Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
>> ---
>>   drivers/iio/pressure/hid-sensor-press.c |    7 ++-----
>>   1 file changed, 2 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/iio/pressure/hid-sensor-press.c
>b/drivers/iio/pressure/hid-sensor-press.c
>> index 1cd190c..2c0d2a4 100644
>> --- a/drivers/iio/pressure/hid-sensor-press.c
>> +++ b/drivers/iio/pressure/hid-sensor-press.c
>> @@ -78,7 +78,6 @@ static int press_read_raw(struct iio_dev
>*indio_dev,
>>   	struct press_state *press_state = iio_priv(indio_dev);
>>   	int report_id = -1;
>>   	u32 address;
>> -	int ret;
>>   	int ret_type;
>>   	s32 poll_value;
>>   
>> @@ -128,14 +127,12 @@ static int press_read_raw(struct iio_dev
>*indio_dev,
>>   		ret_type = IIO_VAL_INT;
>>   		break;
>>   	case IIO_CHAN_INFO_SAMP_FREQ:
>> -		ret = hid_sensor_read_samp_freq_value(
>> +		ret_type = hid_sensor_read_samp_freq_value(
>>   				&press_state->common_attributes, val, val2);
>> -		ret_type = IIO_VAL_INT_PLUS_MICRO;
>>   		break;
>>   	case IIO_CHAN_INFO_HYSTERESIS:
>> -		ret = hid_sensor_read_raw_hyst_value(
>> +		ret_type = hid_sensor_read_raw_hyst_value(
>>   				&press_state->common_attributes, val, val2);
>> -		ret_type = IIO_VAL_INT_PLUS_MICRO;
>>   		break;
>>   	default:
>>   		ret_type = -EINVAL;

-- 
Sent from my Android phone with K-9 Mail. Please excuse my brevity.

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

* Re: [PATCH 1/7] iio: hid-sensor-press: Fix return values
  2014-07-03  6:44 [PATCH 1/7] iio: hid-sensor-press: Fix return values Sachin Kamat
                   ` (6 preceding siblings ...)
  2014-07-03 23:01 ` [PATCH 1/7] iio: hid-sensor-press: Fix return values Srinivas Pandruvada
@ 2014-07-05 10:08 ` Jonathan Cameron
  7 siblings, 0 replies; 16+ messages in thread
From: Jonathan Cameron @ 2014-07-05 10:08 UTC (permalink / raw)
  To: Sachin Kamat, linux-iio; +Cc: spk.linux, Srinivas Pandruvada

On 03/07/14 07:44, Sachin Kamat wrote:
> IIO_CHAN_INFO_SAMP_FREQ and IIO_CHAN_INFO_HYSTERESIS cases ignored
> the actual return values (which could be -EINVAL) and instead
> returned IIO_VAL_INT_PLUS_MICRO always. Return the actual value
> obtained from the functions. Both functions return IIO_VAL_INT_PLUS_MICRO
> upon success.
>
> Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com>
> Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Applied to fixes-togreg with a brief note saying Srinivas 'approved' the patch.
> ---
>   drivers/iio/pressure/hid-sensor-press.c |    7 ++-----
>   1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/iio/pressure/hid-sensor-press.c b/drivers/iio/pressure/hid-sensor-press.c
> index 1cd190c..2c0d2a4 100644
> --- a/drivers/iio/pressure/hid-sensor-press.c
> +++ b/drivers/iio/pressure/hid-sensor-press.c
> @@ -78,7 +78,6 @@ static int press_read_raw(struct iio_dev *indio_dev,
>   	struct press_state *press_state = iio_priv(indio_dev);
>   	int report_id = -1;
>   	u32 address;
> -	int ret;
>   	int ret_type;
>   	s32 poll_value;
>
> @@ -128,14 +127,12 @@ static int press_read_raw(struct iio_dev *indio_dev,
>   		ret_type = IIO_VAL_INT;
>   		break;
>   	case IIO_CHAN_INFO_SAMP_FREQ:
> -		ret = hid_sensor_read_samp_freq_value(
> +		ret_type = hid_sensor_read_samp_freq_value(
>   				&press_state->common_attributes, val, val2);
> -		ret_type = IIO_VAL_INT_PLUS_MICRO;
>   		break;
>   	case IIO_CHAN_INFO_HYSTERESIS:
> -		ret = hid_sensor_read_raw_hyst_value(
> +		ret_type = hid_sensor_read_raw_hyst_value(
>   				&press_state->common_attributes, val, val2);
> -		ret_type = IIO_VAL_INT_PLUS_MICRO;
>   		break;
>   	default:
>   		ret_type = -EINVAL;
>


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

* Re: [PATCH 2/7] iio: hid-sensor-accel-3d: Fix return values
  2014-07-03  6:44 ` [PATCH 2/7] iio: hid-sensor-accel-3d: " Sachin Kamat
@ 2014-07-05 10:09   ` Jonathan Cameron
  0 siblings, 0 replies; 16+ messages in thread
From: Jonathan Cameron @ 2014-07-05 10:09 UTC (permalink / raw)
  To: Sachin Kamat, linux-iio; +Cc: spk.linux, Srinivas Pandruvada

On 03/07/14 07:44, Sachin Kamat wrote:
> IIO_CHAN_INFO_SAMP_FREQ and IIO_CHAN_INFO_HYSTERESIS cases ignored
> the actual return values (which could be -EINVAL) and instead
> returned IIO_VAL_INT_PLUS_MICRO always. Return the actual value
> obtained from the functions. Both functions return IIO_VAL_INT_PLUS_MICRO
> upon success.
>
> Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com>
> Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Applied to the fixes-togreg branch of iio.git

Thanks
> ---
>   drivers/iio/accel/hid-sensor-accel-3d.c |    7 ++-----
>   1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/iio/accel/hid-sensor-accel-3d.c b/drivers/iio/accel/hid-sensor-accel-3d.c
> index 69abf91..54e464e 100644
> --- a/drivers/iio/accel/hid-sensor-accel-3d.c
> +++ b/drivers/iio/accel/hid-sensor-accel-3d.c
> @@ -110,7 +110,6 @@ static int accel_3d_read_raw(struct iio_dev *indio_dev,
>   	struct accel_3d_state *accel_state = iio_priv(indio_dev);
>   	int report_id = -1;
>   	u32 address;
> -	int ret;
>   	int ret_type;
>   	s32 poll_value;
>
> @@ -151,14 +150,12 @@ static int accel_3d_read_raw(struct iio_dev *indio_dev,
>   		ret_type = IIO_VAL_INT;
>   		break;
>   	case IIO_CHAN_INFO_SAMP_FREQ:
> -		ret = hid_sensor_read_samp_freq_value(
> +		ret_type = hid_sensor_read_samp_freq_value(
>   			&accel_state->common_attributes, val, val2);
> -		ret_type = IIO_VAL_INT_PLUS_MICRO;
>   		break;
>   	case IIO_CHAN_INFO_HYSTERESIS:
> -		ret = hid_sensor_read_raw_hyst_value(
> +		ret_type = hid_sensor_read_raw_hyst_value(
>   			&accel_state->common_attributes, val, val2);
> -		ret_type = IIO_VAL_INT_PLUS_MICRO;
>   		break;
>   	default:
>   		ret_type = -EINVAL;
>


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

* Re: [PATCH 3/7] iio: hid-sensor-magn-3d: Fix return values
  2014-07-03  6:44 ` [PATCH 3/7] iio: hid-sensor-magn-3d: " Sachin Kamat
@ 2014-07-05 10:09   ` Jonathan Cameron
  0 siblings, 0 replies; 16+ messages in thread
From: Jonathan Cameron @ 2014-07-05 10:09 UTC (permalink / raw)
  To: Sachin Kamat, linux-iio; +Cc: spk.linux, Srinivas Pandruvada

On 03/07/14 07:44, Sachin Kamat wrote:
> IIO_CHAN_INFO_SAMP_FREQ and IIO_CHAN_INFO_HYSTERESIS cases ignored
> the actual return values (which could be -EINVAL) and instead
> returned IIO_VAL_INT_PLUS_MICRO always. Return the actual value
> obtained from the functions. Both functions return IIO_VAL_INT_PLUS_MICRO
> upon success.
>
> Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com>
> Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Applied to the fixes-togreg branch of iio.git

Thanks,
> ---
>   drivers/iio/magnetometer/hid-sensor-magn-3d.c |    7 ++-----
>   1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/iio/magnetometer/hid-sensor-magn-3d.c b/drivers/iio/magnetometer/hid-sensor-magn-3d.c
> index 41cf29e..b2b0937 100644
> --- a/drivers/iio/magnetometer/hid-sensor-magn-3d.c
> +++ b/drivers/iio/magnetometer/hid-sensor-magn-3d.c
> @@ -110,7 +110,6 @@ static int magn_3d_read_raw(struct iio_dev *indio_dev,
>   	struct magn_3d_state *magn_state = iio_priv(indio_dev);
>   	int report_id = -1;
>   	u32 address;
> -	int ret;
>   	int ret_type;
>   	s32 poll_value;
>
> @@ -153,14 +152,12 @@ static int magn_3d_read_raw(struct iio_dev *indio_dev,
>   		ret_type = IIO_VAL_INT;
>   		break;
>   	case IIO_CHAN_INFO_SAMP_FREQ:
> -		ret = hid_sensor_read_samp_freq_value(
> +		ret_type = hid_sensor_read_samp_freq_value(
>   			&magn_state->common_attributes, val, val2);
> -		ret_type = IIO_VAL_INT_PLUS_MICRO;
>   		break;
>   	case IIO_CHAN_INFO_HYSTERESIS:
> -		ret = hid_sensor_read_raw_hyst_value(
> +		ret_type = hid_sensor_read_raw_hyst_value(
>   			&magn_state->common_attributes, val, val2);
> -		ret_type = IIO_VAL_INT_PLUS_MICRO;
>   		break;
>   	default:
>   		ret_type = -EINVAL;
>


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

* Re: [PATCH 4/7] iio: hid-sensor-als: Fix return values
  2014-07-03  6:44 ` [PATCH 4/7] iio: hid-sensor-als: " Sachin Kamat
@ 2014-07-05 10:10   ` Jonathan Cameron
  0 siblings, 0 replies; 16+ messages in thread
From: Jonathan Cameron @ 2014-07-05 10:10 UTC (permalink / raw)
  To: Sachin Kamat, linux-iio; +Cc: spk.linux, Srinivas Pandruvada

On 03/07/14 07:44, Sachin Kamat wrote:
> IIO_CHAN_INFO_SAMP_FREQ and IIO_CHAN_INFO_HYSTERESIS cases ignored
> the actual return values (which could be -EINVAL) and instead
> returned IIO_VAL_INT_PLUS_MICRO always. Return the actual value
> obtained from the functions. Both functions return IIO_VAL_INT_PLUS_MICRO
> upon success.
>
> Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com>
> Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Applied to the fixes-togreg branch of iio.git.

Thanks
> ---
>   drivers/iio/light/hid-sensor-als.c |    7 ++-----
>   1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/iio/light/hid-sensor-als.c b/drivers/iio/light/hid-sensor-als.c
> index f34c943..96e71e1 100644
> --- a/drivers/iio/light/hid-sensor-als.c
> +++ b/drivers/iio/light/hid-sensor-als.c
> @@ -79,7 +79,6 @@ static int als_read_raw(struct iio_dev *indio_dev,
>   	struct als_state *als_state = iio_priv(indio_dev);
>   	int report_id = -1;
>   	u32 address;
> -	int ret;
>   	int ret_type;
>   	s32 poll_value;
>
> @@ -129,14 +128,12 @@ static int als_read_raw(struct iio_dev *indio_dev,
>   		ret_type = IIO_VAL_INT;
>   		break;
>   	case IIO_CHAN_INFO_SAMP_FREQ:
> -		ret = hid_sensor_read_samp_freq_value(
> +		ret_type = hid_sensor_read_samp_freq_value(
>   				&als_state->common_attributes, val, val2);
> -		ret_type = IIO_VAL_INT_PLUS_MICRO;
>   		break;
>   	case IIO_CHAN_INFO_HYSTERESIS:
> -		ret = hid_sensor_read_raw_hyst_value(
> +		ret_type = hid_sensor_read_raw_hyst_value(
>   				&als_state->common_attributes, val, val2);
> -		ret_type = IIO_VAL_INT_PLUS_MICRO;
>   		break;
>   	default:
>   		ret_type = -EINVAL;
>


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

* Re: [PATCH 5/7] iio: hid-sensor-gyro-3d: Fix return values
  2014-07-03  6:44 ` [PATCH 5/7] iio: hid-sensor-gyro-3d: " Sachin Kamat
@ 2014-07-05 10:10   ` Jonathan Cameron
  0 siblings, 0 replies; 16+ messages in thread
From: Jonathan Cameron @ 2014-07-05 10:10 UTC (permalink / raw)
  To: Sachin Kamat, linux-iio; +Cc: spk.linux, Srinivas Pandruvada

On 03/07/14 07:44, Sachin Kamat wrote:
> IIO_CHAN_INFO_SAMP_FREQ and IIO_CHAN_INFO_HYSTERESIS cases ignored
> the actual return values (which could be -EINVAL) and instead
> returned IIO_VAL_INT_PLUS_MICRO always. Return the actual value
> obtained from the functions. Both functions return IIO_VAL_INT_PLUS_MICRO
> upon success.
>
> Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com>
> Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Applied to the fixes-togreg branch of iio.git

Thanks,
> ---
>   drivers/iio/gyro/hid-sensor-gyro-3d.c |    7 ++-----
>   1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/iio/gyro/hid-sensor-gyro-3d.c b/drivers/iio/gyro/hid-sensor-gyro-3d.c
> index 40f4e49..fa034a3 100644
> --- a/drivers/iio/gyro/hid-sensor-gyro-3d.c
> +++ b/drivers/iio/gyro/hid-sensor-gyro-3d.c
> @@ -110,7 +110,6 @@ static int gyro_3d_read_raw(struct iio_dev *indio_dev,
>   	struct gyro_3d_state *gyro_state = iio_priv(indio_dev);
>   	int report_id = -1;
>   	u32 address;
> -	int ret;
>   	int ret_type;
>   	s32 poll_value;
>
> @@ -151,14 +150,12 @@ static int gyro_3d_read_raw(struct iio_dev *indio_dev,
>   		ret_type = IIO_VAL_INT;
>   		break;
>   	case IIO_CHAN_INFO_SAMP_FREQ:
> -		ret = hid_sensor_read_samp_freq_value(
> +		ret_type = hid_sensor_read_samp_freq_value(
>   			&gyro_state->common_attributes, val, val2);
> -			ret_type = IIO_VAL_INT_PLUS_MICRO;
>   		break;
>   	case IIO_CHAN_INFO_HYSTERESIS:
> -		ret = hid_sensor_read_raw_hyst_value(
> +		ret_type = hid_sensor_read_raw_hyst_value(
>   			&gyro_state->common_attributes, val, val2);
> -		ret_type = IIO_VAL_INT_PLUS_MICRO;
>   		break;
>   	default:
>   		ret_type = -EINVAL;
>


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

* Re: [PATCH 6/7] iio: hid-sensor-prox: Fix return values
  2014-07-03  6:44 ` [PATCH 6/7] iio: hid-sensor-prox: " Sachin Kamat
@ 2014-07-05 10:11   ` Jonathan Cameron
  0 siblings, 0 replies; 16+ messages in thread
From: Jonathan Cameron @ 2014-07-05 10:11 UTC (permalink / raw)
  To: Sachin Kamat, linux-iio; +Cc: spk.linux, Srinivas Pandruvada

On 03/07/14 07:44, Sachin Kamat wrote:
> IIO_CHAN_INFO_SAMP_FREQ and IIO_CHAN_INFO_HYSTERESIS cases ignored
> the actual return values (which could be -EINVAL) and instead
> returned IIO_VAL_INT_PLUS_MICRO always. Return the actual value
> obtained from the functions. Both functions return IIO_VAL_INT_PLUS_MICRO
> upon success.
>
> Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com>
> Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Applied to the fixes-togreg branch of iio.git

Thanks,
> ---
>   drivers/iio/light/hid-sensor-prox.c |    7 ++-----
>   1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/iio/light/hid-sensor-prox.c b/drivers/iio/light/hid-sensor-prox.c
> index d203ef4..412bae8 100644
> --- a/drivers/iio/light/hid-sensor-prox.c
> +++ b/drivers/iio/light/hid-sensor-prox.c
> @@ -74,7 +74,6 @@ static int prox_read_raw(struct iio_dev *indio_dev,
>   	struct prox_state *prox_state = iio_priv(indio_dev);
>   	int report_id = -1;
>   	u32 address;
> -	int ret;
>   	int ret_type;
>   	s32 poll_value;
>
> @@ -125,14 +124,12 @@ static int prox_read_raw(struct iio_dev *indio_dev,
>   		ret_type = IIO_VAL_INT;
>   		break;
>   	case IIO_CHAN_INFO_SAMP_FREQ:
> -		ret = hid_sensor_read_samp_freq_value(
> +		ret_type = hid_sensor_read_samp_freq_value(
>   				&prox_state->common_attributes, val, val2);
> -		ret_type = IIO_VAL_INT_PLUS_MICRO;
>   		break;
>   	case IIO_CHAN_INFO_HYSTERESIS:
> -		ret = hid_sensor_read_raw_hyst_value(
> +		ret_type = hid_sensor_read_raw_hyst_value(
>   				&prox_state->common_attributes, val, val2);
> -		ret_type = IIO_VAL_INT_PLUS_MICRO;
>   		break;
>   	default:
>   		ret_type = -EINVAL;
>


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

* Re: [PATCH 7/7] iio: hid-sensors: Fix compilation warning
  2014-07-03  6:44 ` [PATCH 7/7] iio: hid-sensors: Fix compilation warning Sachin Kamat
@ 2014-07-05 10:21   ` Jonathan Cameron
  0 siblings, 0 replies; 16+ messages in thread
From: Jonathan Cameron @ 2014-07-05 10:21 UTC (permalink / raw)
  To: Sachin Kamat, linux-iio; +Cc: spk.linux, Srinivas Pandruvada

On 03/07/14 07:44, Sachin Kamat wrote:
> Move the 'static' keyword to beginning of definition to silence the
> following compilation warning:
> drivers/iio/common/hid-sensors/hid-sensor-attributes.c:34:1: warning: ‘static’ is not at beginning of declaration [-Wold-style-declaration]
>
> Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com>
> Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Applied to the togreg branch of iio.git

Thanks,


> ---
>   .../iio/common/hid-sensors/hid-sensor-attributes.c |    4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
> index 403dd3d..1614340 100644
> --- a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
> +++ b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
> @@ -26,12 +26,12 @@
>   #include <linux/iio/iio.h>
>   #include <linux/iio/sysfs.h>
>
> -struct {
> +static struct {
>   	u32 usage_id;
>   	int unit; /* 0 for default others from HID sensor spec */
>   	int scale_val0; /* scale, whole number */
>   	int scale_val1; /* scale, fraction in micros */
> -} static unit_conversion[] = {
> +} unit_conversion[] = {
>   	{HID_USAGE_SENSOR_ACCEL_3D, 0, 9, 806650},
>   	{HID_USAGE_SENSOR_ACCEL_3D,
>   		HID_USAGE_SENSOR_UNITS_METERS_PER_SEC_SQRD, 1, 0},
>


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

end of thread, other threads:[~2014-07-05 10:19 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-03  6:44 [PATCH 1/7] iio: hid-sensor-press: Fix return values Sachin Kamat
2014-07-03  6:44 ` [PATCH 2/7] iio: hid-sensor-accel-3d: " Sachin Kamat
2014-07-05 10:09   ` Jonathan Cameron
2014-07-03  6:44 ` [PATCH 3/7] iio: hid-sensor-magn-3d: " Sachin Kamat
2014-07-05 10:09   ` Jonathan Cameron
2014-07-03  6:44 ` [PATCH 4/7] iio: hid-sensor-als: " Sachin Kamat
2014-07-05 10:10   ` Jonathan Cameron
2014-07-03  6:44 ` [PATCH 5/7] iio: hid-sensor-gyro-3d: " Sachin Kamat
2014-07-05 10:10   ` Jonathan Cameron
2014-07-03  6:44 ` [PATCH 6/7] iio: hid-sensor-prox: " Sachin Kamat
2014-07-05 10:11   ` Jonathan Cameron
2014-07-03  6:44 ` [PATCH 7/7] iio: hid-sensors: Fix compilation warning Sachin Kamat
2014-07-05 10:21   ` Jonathan Cameron
2014-07-03 23:01 ` [PATCH 1/7] iio: hid-sensor-press: Fix return values Srinivas Pandruvada
2014-07-04  5:51   ` Jonathan Cameron
2014-07-05 10:08 ` Jonathan Cameron

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.