Commit 1b183e4b authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Staging: iio: adc: max1363_core: fix up some sparse warnings

Also fix a minor coding style issue.

Cc: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent cb6405b1
...@@ -139,16 +139,15 @@ static const struct max1363_mode max1363_mode_table[] = { ...@@ -139,16 +139,15 @@ static const struct max1363_mode max1363_mode_table[] = {
}; };
const struct max1363_mode const struct max1363_mode
*max1363_match_mode(u32 mask, const struct max1363_chip_info *ci) { *max1363_match_mode(u32 mask, const struct max1363_chip_info *ci)
{
int i; int i;
if (mask) if (mask)
for (i = 0; i < ci->num_modes; i++) for (i = 0; i < ci->num_modes; i++)
if (!((~max1363_mode_table[ci->mode_list[i]] if (!((~max1363_mode_table[ci->mode_list[i]].modemask) &
.modemask) &
mask)) mask))
return &max1363_mode_table[ci return &max1363_mode_table[ci->mode_list[i]];
->mode_list[i]]; return NULL;
return 0;
}; };
static ssize_t max1363_show_precision(struct device *dev, static ssize_t max1363_show_precision(struct device *dev,
...@@ -298,7 +297,7 @@ static ssize_t max1363_show_scale(struct device *dev, ...@@ -298,7 +297,7 @@ static ssize_t max1363_show_scale(struct device *dev,
st->chip_info->int_vref_mv >> st->chip_info->bits); st->chip_info->int_vref_mv >> st->chip_info->bits);
} }
IIO_DEVICE_ATTR(in_scale, S_IRUGO, max1363_show_scale, NULL, 0); static IIO_DEVICE_ATTR(in_scale, S_IRUGO, max1363_show_scale, NULL, 0);
static ssize_t max1363_show_name(struct device *dev, static ssize_t max1363_show_name(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr,
...@@ -309,7 +308,7 @@ static ssize_t max1363_show_name(struct device *dev, ...@@ -309,7 +308,7 @@ static ssize_t max1363_show_name(struct device *dev,
return sprintf(buf, "%s\n", st->chip_info->name); return sprintf(buf, "%s\n", st->chip_info->name);
} }
IIO_DEVICE_ATTR(name, S_IRUGO, max1363_show_name, NULL, 0); static IIO_DEVICE_ATTR(name, S_IRUGO, max1363_show_name, NULL, 0);
/* Applies to max1363 */ /* Applies to max1363 */
static const enum max1363_modes max1363_mode_list[] = { static const enum max1363_modes max1363_mode_list[] = {
......
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