Commit 86292572 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman Committed by Tom Rini

[PATCH] I2C: add I2C_DEBUG_CORE config option and convert the i2c core code to use it.

This cleans up the mismatch of ways we could enable debugging messages.
parent 1054e9d6
......@@ -41,5 +41,13 @@ source drivers/i2c/algos/Kconfig
source drivers/i2c/busses/Kconfig
source drivers/i2c/chips/Kconfig
config I2C_DEBUG_CORE
bool "I2C Core debugging messages"
depends on I2C
help
Say Y here if you want the I2C core to produce a bunch of debug
messages to the system log. Select this if you are having a
problem with I2C support and want to see more of what is going on.
endmenu
This diff is collapsed.
......@@ -29,8 +29,10 @@
/* The devfs code is contributed by Philipp Matthias Hahn
<pmhahn@titan.lahn.de> */
/* If you want debugging uncomment: */
/* #define DEBUG 1 */
#include <linux/config.h>
#ifdef CONFIG_I2C_DEBUG_CORE
#define DEBUG 1
#endif
#include <linux/kernel.h>
#include <linux/module.h>
......@@ -137,7 +139,7 @@ static ssize_t i2cdev_read (struct file *file, char __user *buf, size_t count,
if (tmp==NULL)
return -ENOMEM;
pr_debug("i2c-dev.o: i2c-%d reading %d bytes.\n",
pr_debug("i2c-dev: i2c-%d reading %d bytes.\n",
iminor(file->f_dentry->d_inode), count);
ret = i2c_master_recv(client,tmp,count);
......@@ -165,7 +167,7 @@ static ssize_t i2cdev_write (struct file *file, const char __user *buf, size_t c
return -EFAULT;
}
pr_debug("i2c-dev.o: i2c-%d writing %d bytes.\n",
pr_debug("i2c-dev: i2c-%d writing %d bytes.\n",
iminor(file->f_dentry->d_inode), count);
ret = i2c_master_send(client,tmp,count);
......
......@@ -19,7 +19,10 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* #define DEBUG 1 */
#include <linux/config.h>
#ifdef CONFIG_I2C_DEBUG_CORE
#define DEBUG 1
#endif
#include <linux/module.h>
#include <linux/kernel.h>
......
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