linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Baluta <daniel.baluta@intel.com>
To: jic23@kernel.org
Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 1/2] kmx61: Use uscale instead of scale
Date: Mon, 17 Nov 2014 15:18:35 +0200	[thread overview]
Message-ID: <1416230316-14511-2-git-send-email-daniel.baluta@intel.com> (raw)
In-Reply-To: <1416230316-14511-1-git-send-email-daniel.baluta@intel.com>

This makes it easier to notice that we only use
the micro part for scale.

Signed-off-by: Daniel Baluta <daniel.baluta@intel.com>
---
 drivers/iio/imu/kmx61.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/iio/imu/kmx61.c b/drivers/iio/imu/kmx61.c
index 2bd77dd..e49b1cc 100644
--- a/drivers/iio/imu/kmx61.c
+++ b/drivers/iio/imu/kmx61.c
@@ -90,7 +90,7 @@ enum kmx61_scan {
 };
 
 static const struct {
-	u16 scale;
+	u16 uscale;
 	u8 gsel0;
 	u8 gsel1;
 } kmx61_scale_table[] = {
@@ -337,13 +337,13 @@ static int kmx61_set_range(struct kmx61_data *data, int range)
 	return 0;
 }
 
-static int kmx61_set_scale(struct kmx61_data *data, int val)
+static int kmx61_set_scale(struct kmx61_data *data, int uscale)
 {
 	int ret, i;
 	u8  mode;
 
 	for (i = 0; i < ARRAY_SIZE(kmx61_scale_table); i++) {
-		if (kmx61_scale_table[i].scale == val) {
+		if (kmx61_scale_table[i].uscale == uscale) {
 			ret = kmx61_get_mode(data, &mode,
 					     KMX61_ACC | KMX61_MAG);
 			if (ret < 0)
@@ -441,7 +441,7 @@ static int kmx61_read_raw(struct iio_dev *indio_dev,
 		switch (chan->type) {
 		case IIO_ACCEL:
 			*val = 0;
-			*val2 = kmx61_scale_table[data->range].scale;
+			*val2 = kmx61_scale_table[data->range].uscale;
 			return IIO_VAL_INT_PLUS_MICRO;
 		case IIO_MAGN:
 			/* 14 bits res, 1465 microGauss per magn count */
-- 
1.9.1

  reply	other threads:[~2014-11-17 13:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-17 13:18 [PATCH 0/2] kmx61: Small cleanups Daniel Baluta
2014-11-17 13:18 ` Daniel Baluta [this message]
2014-11-17 13:18 ` [PATCH 2/2] kmx61: Use KMX61_DRV_NAME instead of hardcoded value Daniel Baluta
2014-11-17 14:59 ` [PATCH 0/2] kmx61: Small cleanups Jonathan Cameron
2014-11-17 15:09   ` Daniel Baluta
2014-11-22 11:49     ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1416230316-14511-2-git-send-email-daniel.baluta@intel.com \
    --to=daniel.baluta@intel.com \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).