Re: [PATCH] iio:magnetometer:mag3110: Fix unreachable code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 25/02/14 19:53, Peter Meerwald wrote:
         drivers/iio/magnetometer/mag3110.c:197 mag3110_read_raw()
         info: ignoring unreachable code.

drivers/iio/magnetometer/mag3110.c
    185          case IIO_CHAN_INFO_SCALE:
    186                  switch (chan->type) {
    187                  case IIO_MAGN:
    188                          *val = 0;
    189                          *val2 = 1000;
    190                          return IIO_VAL_INT_PLUS_MICRO;
    191                  case IIO_TEMP:
    192                          *val = 1000;
    193                          return IIO_VAL_INT;
    194                  default:
    195                          return -EINVAL;
    196                  }
    197                  return IIO_VAL_INT_PLUS_MICRO;
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

introduced by f9279d3a, mag3110: Scale factor missing

Signed-off-by: Peter Meerwald <pmeerw@xxxxxxxxxx>
Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Applied to the togreg branch of iio.git

Thanks,
---
  drivers/iio/magnetometer/mag3110.c | 1 -
  1 file changed, 1 deletion(-)

diff --git a/drivers/iio/magnetometer/mag3110.c b/drivers/iio/magnetometer/mag3110.c
index 9f260a5..e3106b4 100644
--- a/drivers/iio/magnetometer/mag3110.c
+++ b/drivers/iio/magnetometer/mag3110.c
@@ -194,7 +194,6 @@ static int mag3110_read_raw(struct iio_dev *indio_dev,
  		default:
  			return -EINVAL;
  		}
-		return IIO_VAL_INT_PLUS_MICRO;
  	case IIO_CHAN_INFO_SAMP_FREQ:
  		i = data->ctrl_reg1 >> MAG3110_CTRL_DR_SHIFT;
  		*val = mag3110_samp_freq[i][0];


--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux