diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2010-05-05 01:24:05 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-05-11 14:36:10 -0400 |
commit | 1b183e4b93c4e05160d2c8f08b9546dd4752084b (patch) | |
tree | cc5d1e6fa7b7a22572a0625198eeb9e69f0707c4 /drivers/staging/iio | |
parent | cb6405b15f7b2814f8f5170482b2e13ccfcb6376 (diff) |
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: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/iio')
-rw-r--r-- | drivers/staging/iio/adc/max1363_core.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/staging/iio/adc/max1363_core.c b/drivers/staging/iio/adc/max1363_core.c index fa91cc14c64..4a77657285d 100644 --- a/drivers/staging/iio/adc/max1363_core.c +++ b/drivers/staging/iio/adc/max1363_core.c | |||
@@ -139,16 +139,15 @@ static const struct max1363_mode max1363_mode_table[] = { | |||
139 | }; | 139 | }; |
140 | 140 | ||
141 | const struct max1363_mode | 141 | const struct max1363_mode |
142 | *max1363_match_mode(u32 mask, const struct max1363_chip_info *ci) { | 142 | *max1363_match_mode(u32 mask, const struct max1363_chip_info *ci) |
143 | { | ||
143 | int i; | 144 | int i; |
144 | if (mask) | 145 | if (mask) |
145 | for (i = 0; i < ci->num_modes; i++) | 146 | for (i = 0; i < ci->num_modes; i++) |
146 | if (!((~max1363_mode_table[ci->mode_list[i]] | 147 | if (!((~max1363_mode_table[ci->mode_list[i]].modemask) & |
147 | .modemask) & | ||
148 | mask)) | 148 | mask)) |
149 | return &max1363_mode_table[ci | 149 | return &max1363_mode_table[ci->mode_list[i]]; |
150 | ->mode_list[i]]; | 150 | return NULL; |
151 | return 0; | ||
152 | }; | 151 | }; |
153 | 152 | ||
154 | static ssize_t max1363_show_precision(struct device *dev, | 153 | static ssize_t max1363_show_precision(struct device *dev, |
@@ -298,7 +297,7 @@ static ssize_t max1363_show_scale(struct device *dev, | |||
298 | st->chip_info->int_vref_mv >> st->chip_info->bits); | 297 | st->chip_info->int_vref_mv >> st->chip_info->bits); |
299 | } | 298 | } |
300 | 299 | ||
301 | IIO_DEVICE_ATTR(in_scale, S_IRUGO, max1363_show_scale, NULL, 0); | 300 | static IIO_DEVICE_ATTR(in_scale, S_IRUGO, max1363_show_scale, NULL, 0); |
302 | 301 | ||
303 | static ssize_t max1363_show_name(struct device *dev, | 302 | static ssize_t max1363_show_name(struct device *dev, |
304 | struct device_attribute *attr, | 303 | struct device_attribute *attr, |
@@ -309,7 +308,7 @@ static ssize_t max1363_show_name(struct device *dev, | |||
309 | return sprintf(buf, "%s\n", st->chip_info->name); | 308 | return sprintf(buf, "%s\n", st->chip_info->name); |
310 | } | 309 | } |
311 | 310 | ||
312 | IIO_DEVICE_ATTR(name, S_IRUGO, max1363_show_name, NULL, 0); | 311 | static IIO_DEVICE_ATTR(name, S_IRUGO, max1363_show_name, NULL, 0); |
313 | 312 | ||
314 | /* Applies to max1363 */ | 313 | /* Applies to max1363 */ |
315 | static const enum max1363_modes max1363_mode_list[] = { | 314 | static const enum max1363_modes max1363_mode_list[] = { |