Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1349130 > unrolled thread

[PATCH] iio: adc: imx25-gcq: fix do_div

Started bySudip Mukherjee <sudipm.mukherjee@gmail.com>
First post2016-03-03 14:00 +0100
Last post2016-03-03 14:00 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] iio: adc: imx25-gcq: fix do_div Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2016-03-03 14:00 +0100

#1349130 — [PATCH] iio: adc: imx25-gcq: fix do_div

FromSudip Mukherjee <sudipm.mukherjee@gmail.com>
Date2016-03-03 14:00 +0100
Subject[PATCH] iio: adc: imx25-gcq: fix do_div
Message-ID<r8B1h-7eH-25@gated-at.bofh.it>
We are getting build failure with tilepro allmodconfig with the error:

drivers/iio/adc/fsl-imx25-gcq.c:236:4: note: in expansion of macro 'do_div'
do_div(priv->channel_vref_mv[reg], 1000);
    ^

include/asm-generic/div64.h:198:17: note: expected 'uint64_t *
	{aka long long unsigned int *}' but argument is of type 'u32 *
	{aka unsigned int *}'

Create a temporary variable of type u64 and use that in do_div.

Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
---

tilepro allmodconfig build log is at:
https://travis-ci.org/sudipm-mukherjee/parport/jobs/113325889

 drivers/iio/adc/fsl-imx25-gcq.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/iio/adc/fsl-imx25-gcq.c b/drivers/iio/adc/fsl-imx25-gcq.c
index 2fd1927..e0636d4 100644
--- a/drivers/iio/adc/fsl-imx25-gcq.c
+++ b/drivers/iio/adc/fsl-imx25-gcq.c
@@ -174,6 +174,7 @@ static int mx25_gcq_setup_cfgs(struct platform_device *pdev,
 	struct device *dev = &pdev->dev;
 	unsigned int refp_used[4] = {};
 	int ret, i;
+	u64 temp;
 
 	/*
 	 * Setup all configurations registers with a default conversion
@@ -233,7 +234,9 @@ static int mx25_gcq_setup_cfgs(struct platform_device *pdev,
 			priv->channel_vref_mv[reg] =
 				regulator_get_voltage(priv->vref[refp]);
 			/* Conversion from uV to mV */
-			do_div(priv->channel_vref_mv[reg], 1000);
+			temp = priv->channel_vref_mv[reg];
+			do_div(temp, 1000);
+			priv->channel_vref_mv[reg] = temp;
 			break;
 		case MX25_ADC_REFP_INT:
 			priv->channel_vref_mv[reg] = 2500;
-- 
1.9.1

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web