diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2012-03-06 14:43:45 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-03-07 16:26:52 -0500 |
commit | 4fee7e168ba08ed067ee9aafe4a0a19387117be4 (patch) | |
tree | 61269e82498bbbcebb2e29c62840cc1293d0d2b9 /drivers/staging | |
parent | 624b225035b24e9d7c22cc214f449fc2ec2491c9 (diff) |
staging:iio: Fix compile error without CONFIG_DEBUG_FS
commit e553f182d ("staging: iio: core: Introduce debugfs support, add support
for direct register access") added a '#if defined(CONFIG_DEBUG_FS)' around
iio_read_channel_ext_info and iio_write_channel_ext_info causing the following
compile error if CONFIG_DEBUG_FS is not defined.
drivers/staging/iio/industrialio-core.c:621:11: error: 'iio_read_channel_ext_info' undeclared (first use in this function)
drivers/staging/iio/industrialio-core.c:623:11: error: 'iio_write_channel_ext_info' undeclared (first use in this function)
This patch fixes the issue by moving the functions out of the '#if
defined(CONFIG_DEBUG_FS)' section again.
Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/iio/industrialio-core.c | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/drivers/staging/iio/industrialio-core.c b/drivers/staging/iio/industrialio-core.c index 27695dffb17..d303bfbff27 100644 --- a/drivers/staging/iio/industrialio-core.c +++ b/drivers/staging/iio/industrialio-core.c | |||
@@ -227,33 +227,6 @@ static void iio_device_unregister_debugfs(struct iio_dev *indio_dev) | |||
227 | debugfs_remove_recursive(indio_dev->debugfs_dentry); | 227 | debugfs_remove_recursive(indio_dev->debugfs_dentry); |
228 | } | 228 | } |
229 | 229 | ||
230 | static ssize_t iio_read_channel_ext_info(struct device *dev, | ||
231 | struct device_attribute *attr, | ||
232 | char *buf) | ||
233 | { | ||
234 | struct iio_dev *indio_dev = dev_get_drvdata(dev); | ||
235 | struct iio_dev_attr *this_attr = to_iio_dev_attr(attr); | ||
236 | const struct iio_chan_spec_ext_info *ext_info; | ||
237 | |||
238 | ext_info = &this_attr->c->ext_info[this_attr->address]; | ||
239 | |||
240 | return ext_info->read(indio_dev, this_attr->c, buf); | ||
241 | } | ||
242 | |||
243 | static ssize_t iio_write_channel_ext_info(struct device *dev, | ||
244 | struct device_attribute *attr, | ||
245 | const char *buf, | ||
246 | size_t len) | ||
247 | { | ||
248 | struct iio_dev *indio_dev = dev_get_drvdata(dev); | ||
249 | struct iio_dev_attr *this_attr = to_iio_dev_attr(attr); | ||
250 | const struct iio_chan_spec_ext_info *ext_info; | ||
251 | |||
252 | ext_info = &this_attr->c->ext_info[this_attr->address]; | ||
253 | |||
254 | return ext_info->write(indio_dev, this_attr->c, buf, len); | ||
255 | } | ||
256 | |||
257 | static int iio_device_register_debugfs(struct iio_dev *indio_dev) | 230 | static int iio_device_register_debugfs(struct iio_dev *indio_dev) |
258 | { | 231 | { |
259 | struct dentry *d; | 232 | struct dentry *d; |
@@ -297,6 +270,33 @@ static void iio_device_unregister_debugfs(struct iio_dev *indio_dev) | |||
297 | } | 270 | } |
298 | #endif /* CONFIG_DEBUG_FS */ | 271 | #endif /* CONFIG_DEBUG_FS */ |
299 | 272 | ||
273 | static ssize_t iio_read_channel_ext_info(struct device *dev, | ||
274 | struct device_attribute *attr, | ||
275 | char *buf) | ||
276 | { | ||
277 | struct iio_dev *indio_dev = dev_get_drvdata(dev); | ||
278 | struct iio_dev_attr *this_attr = to_iio_dev_attr(attr); | ||
279 | const struct iio_chan_spec_ext_info *ext_info; | ||
280 | |||
281 | ext_info = &this_attr->c->ext_info[this_attr->address]; | ||
282 | |||
283 | return ext_info->read(indio_dev, this_attr->c, buf); | ||
284 | } | ||
285 | |||
286 | static ssize_t iio_write_channel_ext_info(struct device *dev, | ||
287 | struct device_attribute *attr, | ||
288 | const char *buf, | ||
289 | size_t len) | ||
290 | { | ||
291 | struct iio_dev *indio_dev = dev_get_drvdata(dev); | ||
292 | struct iio_dev_attr *this_attr = to_iio_dev_attr(attr); | ||
293 | const struct iio_chan_spec_ext_info *ext_info; | ||
294 | |||
295 | ext_info = &this_attr->c->ext_info[this_attr->address]; | ||
296 | |||
297 | return ext_info->write(indio_dev, this_attr->c, buf, len); | ||
298 | } | ||
299 | |||
300 | static ssize_t iio_read_channel_info(struct device *dev, | 300 | static ssize_t iio_read_channel_info(struct device *dev, |
301 | struct device_attribute *attr, | 301 | struct device_attribute *attr, |
302 | char *buf) | 302 | char *buf) |