[3/4] mn88472: elaborate debug printout

Message ID 1418429925-16342-3-git-send-email-benjamin@southpole.se (mailing list archive)
State Rejected, archived
Headers

Commit Message

Benjamin Larsson Dec. 13, 2014, 12:18 a.m. UTC
  Signed-off-by: Benjamin Larsson <benjamin@southpole.se>
---
 drivers/staging/media/mn88472/mn88472.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
  

Comments

Antti Palosaari Dec. 13, 2014, 4:05 a.m. UTC | #1
That patch is simply wrong. Kernel logging system is able to add 
function name automatically - it should not be defined manually for 
debug logging.

See kernel documentation:
Documentation/dynamic-debug-howto.txt

around the line 213.

----------------------------------
The flags are:

   p    enables the pr_debug() callsite.
   f    Include the function name in the printed message
   l    Include line number in the printed message
   m    Include module name in the printed message
   t    Include thread ID in messages not generated from interrupt context
   _    No flags are set. (Or'd with others on input)
----------------------------------

Antti




On 12/13/2014 02:18 AM, Benjamin Larsson wrote:
> Signed-off-by: Benjamin Larsson <benjamin@southpole.se>
> ---
>   drivers/staging/media/mn88472/mn88472.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/media/mn88472/mn88472.c b/drivers/staging/media/mn88472/mn88472.c
> index 4d80046..746cc94 100644
> --- a/drivers/staging/media/mn88472/mn88472.c
> +++ b/drivers/staging/media/mn88472/mn88472.c
> @@ -33,6 +33,7 @@ static int mn88472_set_frontend(struct dvb_frontend *fe)
>   	u64 tmp;
>   	u8 delivery_system_val, if_val[3], bw_val[7], bw_val2;
>
> +	dev_dbg(&client->dev, "%s:\n", __func__);
>   	dev_dbg(&client->dev,
>   			"delivery_system=%d modulation=%d frequency=%d symbol_rate=%d inversion=%d\n",
>   			c->delivery_system, c->modulation,
> @@ -288,7 +289,7 @@ static int mn88472_init(struct dvb_frontend *fe)
>   	u8 *fw_file = MN88472_FIRMWARE;
>   	unsigned int csum;
>
> -	dev_dbg(&client->dev, "\n");
> +	dev_dbg(&client->dev, "%s:\n", __func__);
>
>   	/* set cold state by default */
>   	dev->warm = false;
> @@ -371,7 +372,7 @@ static int mn88472_sleep(struct dvb_frontend *fe)
>   	struct mn88472_dev *dev = i2c_get_clientdata(client);
>   	int ret;
>
> -	dev_dbg(&client->dev, "\n");
> +	dev_dbg(&client->dev, "%s:\n", __func__);
>
>   	/* power off */
>   	ret = regmap_write(dev->regmap[2], 0x0b, 0x30);
>
  

Patch

diff --git a/drivers/staging/media/mn88472/mn88472.c b/drivers/staging/media/mn88472/mn88472.c
index 4d80046..746cc94 100644
--- a/drivers/staging/media/mn88472/mn88472.c
+++ b/drivers/staging/media/mn88472/mn88472.c
@@ -33,6 +33,7 @@  static int mn88472_set_frontend(struct dvb_frontend *fe)
 	u64 tmp;
 	u8 delivery_system_val, if_val[3], bw_val[7], bw_val2;
 
+	dev_dbg(&client->dev, "%s:\n", __func__);
 	dev_dbg(&client->dev,
 			"delivery_system=%d modulation=%d frequency=%d symbol_rate=%d inversion=%d\n",
 			c->delivery_system, c->modulation,
@@ -288,7 +289,7 @@  static int mn88472_init(struct dvb_frontend *fe)
 	u8 *fw_file = MN88472_FIRMWARE;
 	unsigned int csum;
 
-	dev_dbg(&client->dev, "\n");
+	dev_dbg(&client->dev, "%s:\n", __func__);
 
 	/* set cold state by default */
 	dev->warm = false;
@@ -371,7 +372,7 @@  static int mn88472_sleep(struct dvb_frontend *fe)
 	struct mn88472_dev *dev = i2c_get_clientdata(client);
 	int ret;
 
-	dev_dbg(&client->dev, "\n");
+	dev_dbg(&client->dev, "%s:\n", __func__);
 
 	/* power off */
 	ret = regmap_write(dev->regmap[2], 0x0b, 0x30);