提交 3176dd5d 编写于 作者: S Sachin Kamat 提交者: Jonathan Cameron

iio: core: Use pr_err instead of printk

Use of pr_err is preferred to printk.
Signed-off-by: NSachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: NJonathan Cameron <jic23@kernel.org>
上级 d141ab77
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册