Commit 03a51687 authored by Geordan Neukum's avatar Geordan Neukum Committed by Greg Kroah-Hartman

staging: kpc2000: kpc_i2c: use %s with __func__ identifier in log messages

Throughout i2c_driver.c, there are instances where the log strings
contain the function's name hardcoded into the string. Instead, use the
printk conversion specifier '%s' with the __func__ preprocessor
identifier to more maintainably print the function's name.
Signed-off-by: default avatarGeordan Neukum <gneukum1@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 63306de0
...@@ -142,7 +142,7 @@ static int i801_check_pre(struct i2c_device *priv) ...@@ -142,7 +142,7 @@ static int i801_check_pre(struct i2c_device *priv)
{ {
int status; int status;
dev_dbg(&priv->adapter.dev, "i801_check_pre\n"); dev_dbg(&priv->adapter.dev, "%s\n", __func__);
status = inb_p(SMBHSTSTS(priv)); status = inb_p(SMBHSTSTS(priv));
if (status & SMBHSTSTS_HOST_BUSY) { if (status & SMBHSTSTS_HOST_BUSY) {
...@@ -168,7 +168,7 @@ static int i801_check_post(struct i2c_device *priv, int status, int timeout) ...@@ -168,7 +168,7 @@ static int i801_check_post(struct i2c_device *priv, int status, int timeout)
{ {
int result = 0; int result = 0;
dev_dbg(&priv->adapter.dev, "i801_check_post\n"); dev_dbg(&priv->adapter.dev, "%s\n", __func__);
/* If the SMBus is still busy, we give up */ /* If the SMBus is still busy, we give up */
if (timeout) { if (timeout) {
...@@ -219,7 +219,7 @@ static int i801_transaction(struct i2c_device *priv, int xact) ...@@ -219,7 +219,7 @@ static int i801_transaction(struct i2c_device *priv, int xact)
int result; int result;
int timeout = 0; int timeout = 0;
dev_dbg(&priv->adapter.dev, "i801_transaction\n"); dev_dbg(&priv->adapter.dev, "%s\n", __func__);
result = i801_check_pre(priv); result = i801_check_pre(priv);
if (result < 0) { if (result < 0) {
...@@ -250,7 +250,7 @@ static void i801_wait_hwpec(struct i2c_device *priv) ...@@ -250,7 +250,7 @@ static void i801_wait_hwpec(struct i2c_device *priv)
int timeout = 0; int timeout = 0;
int status; int status;
dev_dbg(&priv->adapter.dev, "i801_wait_hwpec\n"); dev_dbg(&priv->adapter.dev, "%s\n", __func__);
do { do {
usleep_range(250, 500); usleep_range(250, 500);
...@@ -269,7 +269,7 @@ static int i801_block_transaction_by_block(struct i2c_device *priv, union i2c_sm ...@@ -269,7 +269,7 @@ static int i801_block_transaction_by_block(struct i2c_device *priv, union i2c_sm
int i, len; int i, len;
int status; int status;
dev_dbg(&priv->adapter.dev, "i801_block_transaction_by_block\n"); dev_dbg(&priv->adapter.dev, "%s\n", __func__);
inb_p(SMBHSTCNT(priv)); /* reset the data buffer index */ inb_p(SMBHSTCNT(priv)); /* reset the data buffer index */
...@@ -309,7 +309,7 @@ static int i801_block_transaction_byte_by_byte(struct i2c_device *priv, union i2 ...@@ -309,7 +309,7 @@ static int i801_block_transaction_byte_by_byte(struct i2c_device *priv, union i2
int result; int result;
int timeout; int timeout;
dev_dbg(&priv->adapter.dev, "i801_block_transaction_byte_by_byte\n"); dev_dbg(&priv->adapter.dev, "%s\n", __func__);
result = i801_check_pre(priv); result = i801_check_pre(priv);
if (result < 0) { if (result < 0) {
...@@ -383,7 +383,7 @@ static int i801_block_transaction_byte_by_byte(struct i2c_device *priv, union i2 ...@@ -383,7 +383,7 @@ static int i801_block_transaction_byte_by_byte(struct i2c_device *priv, union i2
static int i801_set_block_buffer_mode(struct i2c_device *priv) static int i801_set_block_buffer_mode(struct i2c_device *priv)
{ {
dev_dbg(&priv->adapter.dev, "i801_set_block_buffer_mode\n"); dev_dbg(&priv->adapter.dev, "%s\n", __func__);
outb_p(inb_p(SMBAUXCTL(priv)) | SMBAUXCTL_E32B, SMBAUXCTL(priv)); outb_p(inb_p(SMBAUXCTL(priv)) | SMBAUXCTL_E32B, SMBAUXCTL(priv));
if ((inb_p(SMBAUXCTL(priv)) & SMBAUXCTL_E32B) == 0) { if ((inb_p(SMBAUXCTL(priv)) & SMBAUXCTL_E32B) == 0) {
...@@ -398,7 +398,7 @@ static int i801_block_transaction(struct i2c_device *priv, union i2c_smbus_data ...@@ -398,7 +398,7 @@ static int i801_block_transaction(struct i2c_device *priv, union i2c_smbus_data
int result = 0; int result = 0;
//unsigned char hostc; //unsigned char hostc;
dev_dbg(&priv->adapter.dev, "i801_block_transaction\n"); dev_dbg(&priv->adapter.dev, "%s\n", __func__);
if (command == I2C_SMBUS_I2C_BLOCK_DATA) { if (command == I2C_SMBUS_I2C_BLOCK_DATA) {
if (read_write == I2C_SMBUS_WRITE) { if (read_write == I2C_SMBUS_WRITE) {
...@@ -450,8 +450,9 @@ static s32 i801_access(struct i2c_adapter *adap, u16 addr, unsigned short flags, ...@@ -450,8 +450,9 @@ static s32 i801_access(struct i2c_adapter *adap, u16 addr, unsigned short flags,
int ret, xact = 0; int ret, xact = 0;
struct i2c_device *priv = i2c_get_adapdata(adap); struct i2c_device *priv = i2c_get_adapdata(adap);
dev_dbg(&priv->adapter.dev, "i801_access (addr=%0d) flags=%x read_write=%x command=%x size=%x", dev_dbg(&priv->adapter.dev,
addr, flags, read_write, command, size ); "%s (addr=%0d) flags=%x read_write=%x command=%x size=%x",
__func__, addr, flags, read_write, command, size);
hwpec = (priv->features & FEATURE_SMBUS_PEC) && (flags & I2C_CLIENT_PEC) && size != I2C_SMBUS_QUICK && size != I2C_SMBUS_I2C_BLOCK_DATA; hwpec = (priv->features & FEATURE_SMBUS_PEC) && (flags & I2C_CLIENT_PEC) && size != I2C_SMBUS_QUICK && size != I2C_SMBUS_I2C_BLOCK_DATA;
...@@ -626,7 +627,8 @@ int pi2c_probe(struct platform_device *pldev) ...@@ -626,7 +627,8 @@ int pi2c_probe(struct platform_device *pldev)
struct i2c_device *priv; struct i2c_device *priv;
struct resource *res; struct resource *res;
dev_dbg(&pldev->dev, "pi2c_probe(pldev = %p '%s')\n", pldev, pldev->name); dev_dbg(&pldev->dev, "%s(pldev = %p '%s')\n", __func__, pldev,
pldev->name);
priv = devm_kzalloc(&pldev->dev, sizeof(*priv), GFP_KERNEL); priv = devm_kzalloc(&pldev->dev, sizeof(*priv), GFP_KERNEL);
if (!priv) { if (!priv) {
...@@ -673,7 +675,8 @@ int pi2c_probe(struct platform_device *pldev) ...@@ -673,7 +675,8 @@ int pi2c_probe(struct platform_device *pldev)
int pi2c_remove(struct platform_device *pldev) int pi2c_remove(struct platform_device *pldev)
{ {
struct i2c_device *lddev; struct i2c_device *lddev;
dev_dbg(&pldev->dev, "pi2c_remove(pldev = %p '%s')\n", pldev, pldev->name); dev_dbg(&pldev->dev, "%s(pldev = %p '%s')\n", __func__, pldev,
pldev->name);
lddev = (struct i2c_device *)pldev->dev.platform_data; lddev = (struct i2c_device *)pldev->dev.platform_data;
......
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