Commit e15fbc91 authored by Michael Hennerich's avatar Michael Hennerich Committed by Greg Kroah-Hartman

iio: introduce type casts to avoid __ucmpdi2 calls

This patch type casts the switch control variable to 32 bits in order to
prevent a call __ucmpdi2 generated by some versions of gcc.

This fixes an undefined reference to `__ucmpdi2' when compiled for arch/blackfin
Signed-off-by: default avatarMichael Hennerich <michael.hennerich@analog.com>
Acked-by: default avatarJonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 53b99be7
...@@ -795,7 +795,7 @@ static ssize_t ad7192_set(struct device *dev, ...@@ -795,7 +795,7 @@ static ssize_t ad7192_set(struct device *dev,
return -EBUSY; return -EBUSY;
} }
switch (this_attr->address) { switch ((u32) this_attr->address) {
case AD7192_REG_GPOCON: case AD7192_REG_GPOCON:
if (val) if (val)
st->gpocon |= AD7192_GPOCON_BPDSW; st->gpocon |= AD7192_GPOCON_BPDSW;
......
...@@ -600,7 +600,7 @@ static ssize_t ad7280_read_channel_config(struct device *dev, ...@@ -600,7 +600,7 @@ static ssize_t ad7280_read_channel_config(struct device *dev,
struct iio_dev_attr *this_attr = to_iio_dev_attr(attr); struct iio_dev_attr *this_attr = to_iio_dev_attr(attr);
unsigned val; unsigned val;
switch (this_attr->address) { switch ((u32) this_attr->address) {
case AD7280A_CELL_OVERVOLTAGE: case AD7280A_CELL_OVERVOLTAGE:
val = 1000 + (st->cell_threshhigh * 1568) / 100; val = 1000 + (st->cell_threshhigh * 1568) / 100;
break; break;
...@@ -636,7 +636,7 @@ static ssize_t ad7280_write_channel_config(struct device *dev, ...@@ -636,7 +636,7 @@ static ssize_t ad7280_write_channel_config(struct device *dev,
if (ret) if (ret)
return ret; return ret;
switch (this_attr->address) { switch ((u32) this_attr->address) {
case AD7280A_CELL_OVERVOLTAGE: case AD7280A_CELL_OVERVOLTAGE:
case AD7280A_CELL_UNDERVOLTAGE: case AD7280A_CELL_UNDERVOLTAGE:
val = ((val - 1000) * 100) / 1568; /* LSB 15.68mV */ val = ((val - 1000) * 100) / 1568; /* LSB 15.68mV */
...@@ -652,7 +652,7 @@ static ssize_t ad7280_write_channel_config(struct device *dev, ...@@ -652,7 +652,7 @@ static ssize_t ad7280_write_channel_config(struct device *dev,
val = clamp(val, 0L, 0xFFL); val = clamp(val, 0L, 0xFFL);
mutex_lock(&indio_dev->mlock); mutex_lock(&indio_dev->mlock);
switch (this_attr->address) { switch ((u32) this_attr->address) {
case AD7280A_CELL_OVERVOLTAGE: case AD7280A_CELL_OVERVOLTAGE:
st->cell_threshhigh = val; st->cell_threshhigh = val;
break; break;
......
...@@ -88,7 +88,7 @@ static ssize_t ad9832_write(struct device *dev, ...@@ -88,7 +88,7 @@ static ssize_t ad9832_write(struct device *dev,
goto error_ret; goto error_ret;
mutex_lock(&indio_dev->mlock); mutex_lock(&indio_dev->mlock);
switch (this_attr->address) { switch ((u32) this_attr->address) {
case AD9832_FREQ0HM: case AD9832_FREQ0HM:
case AD9832_FREQ1HM: case AD9832_FREQ1HM:
ret = ad9832_write_frequency(st, this_attr->address, val); ret = ad9832_write_frequency(st, this_attr->address, val);
......
...@@ -77,7 +77,7 @@ static ssize_t ad9834_write(struct device *dev, ...@@ -77,7 +77,7 @@ static ssize_t ad9834_write(struct device *dev,
goto error_ret; goto error_ret;
mutex_lock(&indio_dev->mlock); mutex_lock(&indio_dev->mlock);
switch (this_attr->address) { switch ((u32) this_attr->address) {
case AD9834_REG_FREQ0: case AD9834_REG_FREQ0:
case AD9834_REG_FREQ1: case AD9834_REG_FREQ1:
ret = ad9834_write_frequency(st, this_attr->address, val); ret = ad9834_write_frequency(st, this_attr->address, val);
...@@ -153,7 +153,7 @@ static ssize_t ad9834_store_wavetype(struct device *dev, ...@@ -153,7 +153,7 @@ static ssize_t ad9834_store_wavetype(struct device *dev,
mutex_lock(&indio_dev->mlock); mutex_lock(&indio_dev->mlock);
switch (this_attr->address) { switch ((u32) this_attr->address) {
case 0: case 0:
if (sysfs_streq(buf, "sine")) { if (sysfs_streq(buf, "sine")) {
st->control &= ~AD9834_MODE; st->control &= ~AD9834_MODE;
......
...@@ -329,7 +329,7 @@ static ssize_t ad5933_show(struct device *dev, ...@@ -329,7 +329,7 @@ static ssize_t ad5933_show(struct device *dev,
int ret = 0, len = 0; int ret = 0, len = 0;
mutex_lock(&indio_dev->mlock); mutex_lock(&indio_dev->mlock);
switch (this_attr->address) { switch ((u32) this_attr->address) {
case AD5933_OUT_RANGE: case AD5933_OUT_RANGE:
len = sprintf(buf, "%d\n", len = sprintf(buf, "%d\n",
st->range_avail[(st->ctrl_hb >> 1) & 0x3]); st->range_avail[(st->ctrl_hb >> 1) & 0x3]);
...@@ -380,7 +380,7 @@ static ssize_t ad5933_store(struct device *dev, ...@@ -380,7 +380,7 @@ static ssize_t ad5933_store(struct device *dev,
} }
mutex_lock(&indio_dev->mlock); mutex_lock(&indio_dev->mlock);
switch (this_attr->address) { switch ((u32) this_attr->address) {
case AD5933_OUT_RANGE: case AD5933_OUT_RANGE:
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
if (val == st->range_avail[i]) { if (val == st->range_avail[i]) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment