summaryrefslogtreecommitdiff
path: root/drivers/iio/industrialio-core.c
diff options
context:
space:
mode:
authorSachin Kamat <sachin.kamat@linaro.org>2013-10-24 15:53:00 +0400
committerJonathan Cameron <jic23@kernel.org>2013-10-24 17:39:48 +0400
commit3176dd5d3b591b22abe28dc0f3aace089f10ebe7 (patch)
treec6ba12b2b3c17ecf6c1613cd2839318165125d76 /drivers/iio/industrialio-core.c
parentd141ab776b670a0c9ac46b174f4c207a81f89f60 (diff)
downloadlinux-3176dd5d3b591b22abe28dc0f3aace089f10ebe7.tar.xz
iio: core: Use pr_err instead of printk
Use of pr_err is preferred to printk. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/industrialio-core.c')
-rw-r--r--drivers/iio/industrialio-core.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c
index f7211576abe5..e4780b41ae04 100644
--- a/drivers/iio/industrialio-core.c
+++ b/drivers/iio/industrialio-core.c
@@ -9,6 +9,8 @@
* Based on elements of hwmon and input subsystems.
*/
+#define pr_fmt(fmt) "iio-core: " fmt
+
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/idr.h>
@@ -132,16 +134,13 @@ static int __init iio_init(void)
/* Register sysfs bus */
ret = bus_register(&iio_bus_type);
if (ret < 0) {
- printk(KERN_ERR
- "%s could not register bus type\n",
- __FILE__);
+ pr_err("could not register bus type\n");
goto error_nothing;
}
ret = alloc_chrdev_region(&iio_devt, 0, IIO_DEV_MAX, "iio");
if (ret < 0) {
- printk(KERN_ERR "%s: failed to allocate char dev region\n",
- __FILE__);
+ pr_err("failed to allocate char dev region\n");
goto error_unregister_bus_type;
}
@@ -951,7 +950,7 @@ struct iio_dev *iio_device_alloc(int sizeof_priv)
dev->id = ida_simple_get(&iio_ida, 0, 0, GFP_KERNEL);
if (dev->id < 0) {
/* cannot use a dev_err as the name isn't available */
- printk(KERN_ERR "Failed to get id\n");
+ pr_err("failed to get device id\n");
kfree(dev);
return NULL;
}