diff mbox series

[20/24] pata_pdc202xx_old: move DPRINTK to ata debugging

Message ID 20181213104716.31930-32-hare@suse.de
State Not Applicable
Delegated to: David Miller
Headers show
Series ata: move DPRINTK to dynamic debugging | expand

Commit Message

Hannes Reinecke Dec. 13, 2018, 10:47 a.m. UTC
Replace all DPRINTK calls with the ata_XXX_dbg functions.

Signed-off-by: Hannes Reinecke <hare@suse.com>
---
 drivers/ata/pata_pdc202xx_old.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Sergei Shtylyov Dec. 14, 2018, 8:15 a.m. UTC | #1
Hello!

On 13.12.2018 13:47, Hannes Reinecke wrote:

> Replace all DPRINTK calls with the ata_XXX_dbg functions.
> 
> Signed-off-by: Hannes Reinecke <hare@suse.com>
> ---
>   drivers/ata/pata_pdc202xx_old.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/ata/pata_pdc202xx_old.c b/drivers/ata/pata_pdc202xx_old.c
> index 9001991d2830..6d52b1bb1b9e 100644
> --- a/drivers/ata/pata_pdc202xx_old.c
> +++ b/drivers/ata/pata_pdc202xx_old.c
> @@ -37,7 +37,7 @@ static int pdc2026x_cable_detect(struct ata_port *ap)
>   static void pdc202xx_exec_command(struct ata_port *ap,
>   				  const struct ata_taskfile *tf)
>   {
> -	DPRINTK("ata%u: cmd 0x%X\n", ap->print_id, tf->command);
> +	ata_port_dbg(ap, "ata%u: cmd 0x%X\n", ap->print_id, tf->command);

    Mhm, you remove printing of ap->print_id in the other patches...

[...]

MBR, Sergei
Hannes Reinecke Dec. 14, 2018, 8:19 a.m. UTC | #2
On 12/14/18 9:15 AM, Sergei Shtylyov wrote:
> Hello!
> 
> On 13.12.2018 13:47, Hannes Reinecke wrote:
> 
>> Replace all DPRINTK calls with the ata_XXX_dbg functions.
>>
>> Signed-off-by: Hannes Reinecke <hare@suse.com>
>> ---
>>   drivers/ata/pata_pdc202xx_old.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/ata/pata_pdc202xx_old.c 
>> b/drivers/ata/pata_pdc202xx_old.c
>> index 9001991d2830..6d52b1bb1b9e 100644
>> --- a/drivers/ata/pata_pdc202xx_old.c
>> +++ b/drivers/ata/pata_pdc202xx_old.c
>> @@ -37,7 +37,7 @@ static int pdc2026x_cable_detect(struct ata_port *ap)
>>   static void pdc202xx_exec_command(struct ata_port *ap,
>>                     const struct ata_taskfile *tf)
>>   {
>> -    DPRINTK("ata%u: cmd 0x%X\n", ap->print_id, tf->command);
>> +    ata_port_dbg(ap, "ata%u: cmd 0x%X\n", ap->print_id, tf->command);
> 
>     Mhm, you remove printing of ap->print_id in the other patches...
> 
> [...]
> 
> MBR, Sergei
> 
Correct.

dev_dbg (and, by inference, ata_port_dbg()) does it for you as it grabs 
the device name.
Which is formatted using 'ap->print_id' :

int ata_tport_add(struct device *parent,
		  struct ata_port *ap)
{
	int error;
	struct device *dev = &ap->tdev;

	device_initialize(dev);
	dev->type = &ata_port_type;

	dev->parent = parent;
	ata_host_get(ap->host);
	dev->release = ata_tport_release;
	dev_set_name(dev, "ata%d", ap->print_id);
	transport_setup_device(dev);
	ata_acpi_bind_port(ap);

Cheers,

Hannes
Bartlomiej Zolnierkiewicz Jan. 30, 2020, 11:55 a.m. UTC | #3
On 12/13/18 11:47 AM, Hannes Reinecke wrote:
> Replace all DPRINTK calls with the ata_XXX_dbg functions.

Please preserve __func__ printing in the conversion.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

> Signed-off-by: Hannes Reinecke <hare@suse.com>
> ---
>  drivers/ata/pata_pdc202xx_old.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/ata/pata_pdc202xx_old.c b/drivers/ata/pata_pdc202xx_old.c
> index 9001991d2830..6d52b1bb1b9e 100644
> --- a/drivers/ata/pata_pdc202xx_old.c
> +++ b/drivers/ata/pata_pdc202xx_old.c
> @@ -37,7 +37,7 @@ static int pdc2026x_cable_detect(struct ata_port *ap)
>  static void pdc202xx_exec_command(struct ata_port *ap,
>  				  const struct ata_taskfile *tf)
>  {
> -	DPRINTK("ata%u: cmd 0x%X\n", ap->print_id, tf->command);
> +	ata_port_dbg(ap, "ata%u: cmd 0x%X\n", ap->print_id, tf->command);
>  
>  	iowrite8(tf->command, ap->ioaddr.command_addr);
>  	ndelay(400);
diff mbox series

Patch

diff --git a/drivers/ata/pata_pdc202xx_old.c b/drivers/ata/pata_pdc202xx_old.c
index 9001991d2830..6d52b1bb1b9e 100644
--- a/drivers/ata/pata_pdc202xx_old.c
+++ b/drivers/ata/pata_pdc202xx_old.c
@@ -37,7 +37,7 @@  static int pdc2026x_cable_detect(struct ata_port *ap)
 static void pdc202xx_exec_command(struct ata_port *ap,
 				  const struct ata_taskfile *tf)
 {
-	DPRINTK("ata%u: cmd 0x%X\n", ap->print_id, tf->command);
+	ata_port_dbg(ap, "ata%u: cmd 0x%X\n", ap->print_id, tf->command);
 
 	iowrite8(tf->command, ap->ioaddr.command_addr);
 	ndelay(400);