Re: Re: Re: [PATCH 16/16] pcmcia: use dev_dbg and dev_print in pd6729.c

2009-11-07 Thread Komuro
Hi,


>> There are still 3(three) printk in pd6729.c.
>> 
>> >static u_int __devinit pd6729_isa_scan(void)
>> >{
>> >u_int mask0, mask = 0;
>> >int i;
>> >
>> >if (irq_mode == 1) {
>> >printk(KERN_INFO "pd6729: PCI card interrupts, "
>> >"PCI status changes\n");
>> >return 0;
>> >}
>> 
>> 
>
>Well, we don't have a struct device to use here, don't we?
>

Ah, you are right.

Best Regards
Komuro



___
Linux PCMCIA reimplementation list
http://lists.infradead.org/mailman/listinfo/linux-pcmcia


Re: Re: [PATCH 16/16] pcmcia: use dev_dbg and dev_print in pd6729.c

2009-11-07 Thread Dominik Brodowski
On Sat, Nov 07, 2009 at 07:09:31PM +0900, Komuro wrote:
> Hi,
> 
> There are still 3(three) printk in pd6729.c.
> 
> >static u_int __devinit pd6729_isa_scan(void)
> >{
> >u_int mask0, mask = 0;
> >int i;
> >
> >if (irq_mode == 1) {
> >printk(KERN_INFO "pd6729: PCI card interrupts, "
> >"PCI status changes\n");
> >return 0;
> >}
> 
> 

Well, we don't have a struct device to use here, don't we?

Best,
Dominik

___
Linux PCMCIA reimplementation list
http://lists.infradead.org/mailman/listinfo/linux-pcmcia


Re: Re: [PATCH 16/16] pcmcia: use dev_dbg and dev_print in pd6729.c

2009-11-07 Thread Komuro
Hi,

There are still 3(three) printk in pd6729.c.

>static u_int __devinit pd6729_isa_scan(void)
>{
>u_int mask0, mask = 0;
>int i;
>
>if (irq_mode == 1) {
>printk(KERN_INFO "pd6729: PCI card interrupts, "
>"PCI status changes\n");
>return 0;
>}




___
Linux PCMCIA reimplementation list
http://lists.infradead.org/mailman/listinfo/linux-pcmcia


Re: [PATCH 16/16] pcmcia: use dev_dbg and dev_print in pd6729.c

2009-10-27 Thread Wolfram Sang
> Well, one can use dev_* here. So, next try:
> 
> 
> From: Dominik Brodowski 
> Date: Sat, 24 Oct 2009 18:07:16 +0200
> Subject: [PATCH 16/16] pcmcia: use dev_dbg and dev_print in pd6729.c
> 
> As suggested by Wolfram Sang , use dev_dbg(),
> and dev_{err,warn,info}() in pd6729.c, and add some "\n" suggested by
> Komuro . In the ISR, use pr_devel() and
> dev_vdbg() as they are only compiled if DEBUG (or, for dev_vdbg(),
> VERBOSE_DEBUG) are set explicitly.
> 
> CC: Wolfram Sang 
> CC: Komuro 
> Signed-off-by: Dominik Brodowski 

Acked-by: Wolfram Sang  

-- 
Pengutronix e.K.   | Wolfram Sang|
Industrial Linux Solutions | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-5064 |
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |


signature.asc
Description: Digital signature
___
Linux PCMCIA reimplementation list
http://lists.infradead.org/mailman/listinfo/linux-pcmcia


Re: [PATCH 16/16] pcmcia: use dev_dbg and dev_print in pd6729.c

2009-10-26 Thread Dominik Brodowski
On Tue, Oct 27, 2009 at 12:05:17AM +0100, Wolfram Sang wrote:
y> > @@ -478,12 +483,12 @@ static int pd6729_set_mem_map(struct pcmcia_socket 
*sock,
> >  
> > map = mem->map;
> > if (map > 4) {
> > -   printk("pd6729_set_mem_map: invalid map");
> > +   printk("pd6729_set_mem_map: invalid map\n");
> > return -EINVAL;
> > }
> >  
> > if ((mem->res->start > mem->res->end) || (mem->speed > 1000)) {
> > -   printk("pd6729_set_mem_map: invalid address / speed");
> > +   printk("pd6729_set_mem_map: invalid address / speed\n");
> 
> Here are two printk. I assume dev_* is not possible here? But there should be
> some loglevel at least (KERN_ERR?).

Well, one can use dev_* here. So, next try:


From: Dominik Brodowski 
Date: Sat, 24 Oct 2009 18:07:16 +0200
Subject: [PATCH 16/16] pcmcia: use dev_dbg and dev_print in pd6729.c

As suggested by Wolfram Sang , use dev_dbg(),
and dev_{err,warn,info}() in pd6729.c, and add some "\n" suggested by
Komuro . In the ISR, use pr_devel() and
dev_vdbg() as they are only compiled if DEBUG (or, for dev_vdbg(),
VERBOSE_DEBUG) are set explicitly.

CC: Wolfram Sang 
CC: Komuro 
Signed-off-by: Dominik Brodowski 
---
 drivers/pcmcia/pd6729.c |   70 +--
 drivers/pcmcia/pd6729.h |7 -
 2 files changed, 37 insertions(+), 40 deletions(-)

diff --git a/drivers/pcmcia/pd6729.c b/drivers/pcmcia/pd6729.c
index 70a3346..e1741cd 100644
--- a/drivers/pcmcia/pd6729.c
+++ b/drivers/pcmcia/pd6729.c
@@ -213,7 +213,8 @@ static irqreturn_t pd6729_interrupt(int irq, void *dev)
 
if (csc & I365_CSC_DETECT) {
events |= SS_DETECT;
-   dprintk("Card detected in socket %i!\n", i);
+   dev_vdbg(&socket[i].socket.dev,
+   "Card detected in socket %i!\n", i);
}
 
if (indirect_read(&socket[i], I365_INTCTL)
@@ -331,11 +332,11 @@ static int pd6729_set_socket(struct pcmcia_socket *sock, 
socket_state_t *state)
reg = I365_PWR_NORESET; /* default: disable resetdrv on resume */
 
if (state->flags & SS_PWR_AUTO) {
-   dprintk("Auto power\n");
+   dev_dbg(&sock->dev, "Auto power\n");
reg |= I365_PWR_AUTO;   /* automatic power mngmnt */
}
if (state->flags & SS_OUTPUT_ENA) {
-   dprintk("Power Enabled\n");
+   dev_dbg(&sock->dev, "Power Enabled\n");
reg |= I365_PWR_OUT;/* enable power */
}
 
@@ -343,40 +344,44 @@ static int pd6729_set_socket(struct pcmcia_socket *sock, 
socket_state_t *state)
case 0:
break;
case 33:
-   dprintk("setting voltage to Vcc to 3.3V on socket %i\n",
+   dev_dbg(&sock->dev,
+   "setting voltage to Vcc to 3.3V on socket %i\n",
socket->number);
reg |= I365_VCC_5V;
indirect_setbit(socket, PD67_MISC_CTL_1, PD67_MC1_VCC_3V);
break;
case 50:
-   dprintk("setting voltage to Vcc to 5V on socket %i\n",
+   dev_dbg(&sock->dev,
+   "setting voltage to Vcc to 5V on socket %i\n",
socket->number);
reg |= I365_VCC_5V;
indirect_resetbit(socket, PD67_MISC_CTL_1, PD67_MC1_VCC_3V);
break;
default:
-   dprintk("pd6729: pd6729_set_socket called with "
-   "invalid VCC power value: %i\n",
-   state->Vcc);
+   dev_dbg(&sock->dev,
+   "pd6729_set_socket called with invalid VCC power "
+   "value: %i\n", state->Vcc);
return -EINVAL;
}
 
switch (state->Vpp) {
case 0:
-   dprintk("not setting Vpp on socket %i\n", socket->number);
+   dev_dbg(&sock->dev, "not setting Vpp on socket %i\n",
+   socket->number);
break;
case 33:
case 50:
-   dprintk("setting Vpp to Vcc for socket %i\n", socket->number);
+   dev_dbg(&sock->dev, "setting Vpp to Vcc for socket %i\n",
+   socket->number);
reg |= I365_VPP1_5V;
break;
case 120:
-   dprintk("setting Vpp to 12.0\n");

Re: [PATCH 16/16] pcmcia: use dev_dbg and dev_print in pd6729.c

2009-10-26 Thread Wolfram Sang
On Sun, Oct 25, 2009 at 12:23:27PM +0100, Dominik Brodowski wrote:
> New attempt:
> 
> From: Dominik Brodowski 
> Date: Sat, 24 Oct 2009 18:07:16 +0200
> Subject: [PATCH 16/16] pcmcia: use dev_dbg and dev_print in pd6729.c
> 
> As suggested by Wolfram Sang , use dev_dbg(),
> and dev_{err,warn,info}() in pd6729.c, and add some "\n" suggested by
> Komuro . In the ISR, use pr_devel() and
> dev_vdbg() as they are only compiled if DEBUG (or, for dev_vdbg(),
> VERBOSE_DEBUG) are set explicitly.

One issue left, after that you could add my

Acked-by: Wolfram Sang 

> 
> CC: Wolfram Sang 
> CC: Komuro 
> Signed-off-by: Dominik Brodowski 
> ---
>  drivers/pcmcia/pd6729.c |   70 
> +--
>  drivers/pcmcia/pd6729.h |7 -
>  2 files changed, 37 insertions(+), 40 deletions(-)
> 
> diff --git a/drivers/pcmcia/pd6729.c b/drivers/pcmcia/pd6729.c
> index 70a3346..cbb1e43 100644
> --- a/drivers/pcmcia/pd6729.c
> +++ b/drivers/pcmcia/pd6729.c
> @@ -213,7 +213,8 @@ static irqreturn_t pd6729_interrupt(int irq, void *dev)
>  
>   if (csc & I365_CSC_DETECT) {
>   events |= SS_DETECT;
> - dprintk("Card detected in socket %i!\n", i);
> + dev_vdbg(&socket[i].socket.dev,
> + "Card detected in socket %i!\n", i);
>   }
>  
>   if (indirect_read(&socket[i], I365_INTCTL)
> @@ -331,11 +332,11 @@ static int pd6729_set_socket(struct pcmcia_socket 
> *sock, socket_state_t *state)
>   reg = I365_PWR_NORESET; /* default: disable resetdrv on resume */
>  
>   if (state->flags & SS_PWR_AUTO) {
> - dprintk("Auto power\n");
> + dev_dbg(&sock->dev, "Auto power\n");
>   reg |= I365_PWR_AUTO;   /* automatic power mngmnt */
>   }
>   if (state->flags & SS_OUTPUT_ENA) {
> - dprintk("Power Enabled\n");
> + dev_dbg(&sock->dev, "Power Enabled\n");
>   reg |= I365_PWR_OUT;/* enable power */
>   }
>  
> @@ -343,40 +344,44 @@ static int pd6729_set_socket(struct pcmcia_socket 
> *sock, socket_state_t *state)
>   case 0:
>   break;
>   case 33:
> - dprintk("setting voltage to Vcc to 3.3V on socket %i\n",
> + dev_dbg(&sock->dev,
> + "setting voltage to Vcc to 3.3V on socket %i\n",
>   socket->number);
>   reg |= I365_VCC_5V;
>   indirect_setbit(socket, PD67_MISC_CTL_1, PD67_MC1_VCC_3V);
>   break;
>   case 50:
> - dprintk("setting voltage to Vcc to 5V on socket %i\n",
> + dev_dbg(&sock->dev,
> + "setting voltage to Vcc to 5V on socket %i\n",
>   socket->number);
>   reg |= I365_VCC_5V;
>   indirect_resetbit(socket, PD67_MISC_CTL_1, PD67_MC1_VCC_3V);
>   break;
>   default:
> - dprintk("pd6729: pd6729_set_socket called with "
> - "invalid VCC power value: %i\n",
> - state->Vcc);
> + dev_dbg(&sock->dev,
> + "pd6729_set_socket called with invalid VCC power "
> + "value: %i\n", state->Vcc);
>   return -EINVAL;
>   }
>  
>   switch (state->Vpp) {
>   case 0:
> - dprintk("not setting Vpp on socket %i\n", socket->number);
> + dev_dbg(&sock->dev, "not setting Vpp on socket %i\n",
> + socket->number);
>   break;
>   case 33:
>   case 50:
> - dprintk("setting Vpp to Vcc for socket %i\n", socket->number);
> + dev_dbg(&sock->dev, "setting Vpp to Vcc for socket %i\n",
> + socket->number);
>   reg |= I365_VPP1_5V;
>   break;
>   case 120:
> - dprintk("setting Vpp to 12.0\n");
> + dev_dbg(&sock->dev, "setting Vpp to 12.0\n");
>   reg |= I365_VPP1_12V;
>   break;
>   default:
> - dprintk("pd6729: pd6729_set_socket called with invalid VPP 
> power value: %i\n",
> - state->Vpp);
> + dev_dbg(&sock->dev, "pd6729: pd6729_set_

Re: [PATCH 16/16] pcmcia: use dev_dbg and dev_print in pd6729.c

2009-10-25 Thread Dominik Brodowski
New attempt:

From: Dominik Brodowski 
Date: Sat, 24 Oct 2009 18:07:16 +0200
Subject: [PATCH 16/16] pcmcia: use dev_dbg and dev_print in pd6729.c

As suggested by Wolfram Sang , use dev_dbg(),
and dev_{err,warn,info}() in pd6729.c, and add some "\n" suggested by
Komuro . In the ISR, use pr_devel() and
dev_vdbg() as they are only compiled if DEBUG (or, for dev_vdbg(),
VERBOSE_DEBUG) are set explicitly.

CC: Wolfram Sang 
CC: Komuro 
Signed-off-by: Dominik Brodowski 
---
 drivers/pcmcia/pd6729.c |   70 +--
 drivers/pcmcia/pd6729.h |7 -
 2 files changed, 37 insertions(+), 40 deletions(-)

diff --git a/drivers/pcmcia/pd6729.c b/drivers/pcmcia/pd6729.c
index 70a3346..cbb1e43 100644
--- a/drivers/pcmcia/pd6729.c
+++ b/drivers/pcmcia/pd6729.c
@@ -213,7 +213,8 @@ static irqreturn_t pd6729_interrupt(int irq, void *dev)
 
if (csc & I365_CSC_DETECT) {
events |= SS_DETECT;
-   dprintk("Card detected in socket %i!\n", i);
+   dev_vdbg(&socket[i].socket.dev,
+   "Card detected in socket %i!\n", i);
}
 
if (indirect_read(&socket[i], I365_INTCTL)
@@ -331,11 +332,11 @@ static int pd6729_set_socket(struct pcmcia_socket *sock, 
socket_state_t *state)
reg = I365_PWR_NORESET; /* default: disable resetdrv on resume */
 
if (state->flags & SS_PWR_AUTO) {
-   dprintk("Auto power\n");
+   dev_dbg(&sock->dev, "Auto power\n");
reg |= I365_PWR_AUTO;   /* automatic power mngmnt */
}
if (state->flags & SS_OUTPUT_ENA) {
-   dprintk("Power Enabled\n");
+   dev_dbg(&sock->dev, "Power Enabled\n");
reg |= I365_PWR_OUT;/* enable power */
}
 
@@ -343,40 +344,44 @@ static int pd6729_set_socket(struct pcmcia_socket *sock, 
socket_state_t *state)
case 0:
break;
case 33:
-   dprintk("setting voltage to Vcc to 3.3V on socket %i\n",
+   dev_dbg(&sock->dev,
+   "setting voltage to Vcc to 3.3V on socket %i\n",
socket->number);
reg |= I365_VCC_5V;
indirect_setbit(socket, PD67_MISC_CTL_1, PD67_MC1_VCC_3V);
break;
case 50:
-   dprintk("setting voltage to Vcc to 5V on socket %i\n",
+   dev_dbg(&sock->dev,
+   "setting voltage to Vcc to 5V on socket %i\n",
socket->number);
reg |= I365_VCC_5V;
indirect_resetbit(socket, PD67_MISC_CTL_1, PD67_MC1_VCC_3V);
break;
default:
-   dprintk("pd6729: pd6729_set_socket called with "
-   "invalid VCC power value: %i\n",
-   state->Vcc);
+   dev_dbg(&sock->dev,
+   "pd6729_set_socket called with invalid VCC power "
+   "value: %i\n", state->Vcc);
return -EINVAL;
}
 
switch (state->Vpp) {
case 0:
-   dprintk("not setting Vpp on socket %i\n", socket->number);
+   dev_dbg(&sock->dev, "not setting Vpp on socket %i\n",
+   socket->number);
break;
case 33:
case 50:
-   dprintk("setting Vpp to Vcc for socket %i\n", socket->number);
+   dev_dbg(&sock->dev, "setting Vpp to Vcc for socket %i\n",
+   socket->number);
reg |= I365_VPP1_5V;
break;
case 120:
-   dprintk("setting Vpp to 12.0\n");
+   dev_dbg(&sock->dev, "setting Vpp to 12.0\n");
reg |= I365_VPP1_12V;
break;
default:
-   dprintk("pd6729: pd6729_set_socket called with invalid VPP 
power value: %i\n",
-   state->Vpp);
+   dev_dbg(&sock->dev, "pd6729: pd6729_set_socket called with "
+   "invalid VPP power value: %i\n", state->Vpp);
return -EINVAL;
}
 
@@ -438,7 +443,7 @@ static int pd6729_set_io_map(struct pcmcia_socket *sock,
 
/* Check error conditions */
if (map > 1) {
-   dprintk("pd6729_set_io_map with invalid map");
+   dev_dbg(&sock->dev, "pd6729_set_io_map with invalid map\n");
return -EINVAL;
}
 
@@ -446,7 +451,7 @@ stati

Re: [PATCH 16/16] pcmcia: use dev_dbg and dev_print in pd6729.c

2009-10-24 Thread Komuro

Hi,

minir fixes. add "\n" to some dev_dbg.

  
> pd6729_set_io_map
 
>   /* Check error conditions */
>   if (map > 1) {
> - dprintk("pd6729_set_io_map with invalid map");
> + dev_dbg(&sock->dev, "pd6729_set_io_map with invalid map");
>   return -EINVAL;
>   }
>  

if (map > 1) {
 -  dev_dbg(&sock->dev, "pd6729_set_io_map with invalid map");
 +  dev_dbg(&sock->dev, "pd6729_set_io_map with invalid map\n");
return -EINVAL;
}
  

>  pd6729_set_mem_map

   if (map > 4) {
-   printk("pd6729_set_mem_map: invalid map");
+   printk("pd6729_set_mem_map: invalid map\n");
return -EINVAL;
}

if ((mem->res->start > mem->res->end) || (mem->speed > 1000)) {
 -  printk("pd6729_set_mem_map: invalid address / speed");
 +  printk("pd6729_set_mem_map: invalid address / speed\n");
return -EINVAL;
}

Best Regards
Komuro

___
Linux PCMCIA reimplementation list
http://lists.infradead.org/mailman/listinfo/linux-pcmcia


Re: [PATCH 16/16] pcmcia: use dev_dbg and dev_print in pd6729.c

2009-10-24 Thread Wolfram Sang

> > I'd also include dev_err, dev_warn and dev_info :)
> 
> What's their advantage?

They are a bit shorter and much more common AFAICT.

> 
> > >   if (csc & I365_CSC_DETECT) {
> > >   events |= SS_DETECT;
> > > - dprintk("Card detected in socket %i!\n", i);
> > > + dev_dbg(&socket[i].socket.dev,
> > > + "Card detected in socket %i!\n", i);
> > 
> > Dunno, in days of dynamic_printk it might be better to skip debug outputs 
> > in ISRs, no?
> 
> Why?

They may not be compiled out although they are not used. Dunno, maybe I'm a bit
biased because I often fight latencies ;)

Regards,

   Wolfram

-- 
Pengutronix e.K.   | Wolfram Sang|
Industrial Linux Solutions | http://www.pengutronix.de/  |


signature.asc
Description: Digital signature
___
Linux PCMCIA reimplementation list
http://lists.infradead.org/mailman/listinfo/linux-pcmcia


Re: [PATCH 16/16] pcmcia: use dev_dbg and dev_print in pd6729.c

2009-10-24 Thread Dominik Brodowski
On Sun, Oct 25, 2009 at 12:19:25AM +0200, Wolfram Sang wrote:
> On Sat, Oct 24, 2009 at 09:43:06PM +0200, Dominik Brodowski wrote:
> > As suggested by Wolfram Sang , use dev_dbg() and
> > dev_printk() in pd6729.c.
> 
> I'd also include dev_err, dev_warn and dev_info :)

What's their advantage?

> > if (csc & I365_CSC_DETECT) {
> > events |= SS_DETECT;
> > -   dprintk("Card detected in socket %i!\n", i);
> > +   dev_dbg(&socket[i].socket.dev,
> > +   "Card detected in socket %i!\n", i);
> 
> Dunno, in days of dynamic_printk it might be better to skip debug outputs 
> in ISRs, no?

Why?

Best,
Dominik

___
Linux PCMCIA reimplementation list
http://lists.infradead.org/mailman/listinfo/linux-pcmcia


Re: [PATCH 16/16] pcmcia: use dev_dbg and dev_print in pd6729.c

2009-10-24 Thread Wolfram Sang
On Sat, Oct 24, 2009 at 09:43:06PM +0200, Dominik Brodowski wrote:
> As suggested by Wolfram Sang , use dev_dbg() and
> dev_printk() in pd6729.c.

I'd also include dev_err, dev_warn and dev_info :)

> 
> CC: Wolfram Sang 
> Signed-off-by: Dominik Brodowski 
> ---
>  drivers/pcmcia/pd6729.c |   69 
> ++-
>  drivers/pcmcia/pd6729.h |7 -
>  2 files changed, 38 insertions(+), 38 deletions(-)
> 
> diff --git a/drivers/pcmcia/pd6729.c b/drivers/pcmcia/pd6729.c
> index 70a3346..509a648 100644
> --- a/drivers/pcmcia/pd6729.c
> +++ b/drivers/pcmcia/pd6729.c
> @@ -213,7 +213,8 @@ static irqreturn_t pd6729_interrupt(int irq, void *dev)
>  
>   if (csc & I365_CSC_DETECT) {
>   events |= SS_DETECT;
> - dprintk("Card detected in socket %i!\n", i);
> + dev_dbg(&socket[i].socket.dev,
> + "Card detected in socket %i!\n", i);

Dunno, in days of dynamic_printk it might be better to skip debug outputs in 
ISRs, no?

>   }
>  
>   if (indirect_read(&socket[i], I365_INTCTL)
> @@ -331,11 +332,11 @@ static int pd6729_set_socket(struct pcmcia_socket 
> *sock, socket_state_t *state)
>   reg = I365_PWR_NORESET; /* default: disable resetdrv on resume */
>  
>   if (state->flags & SS_PWR_AUTO) {
> - dprintk("Auto power\n");
> + dev_dbg(&sock->dev, "Auto power\n");
>   reg |= I365_PWR_AUTO;   /* automatic power mngmnt */
>   }
>   if (state->flags & SS_OUTPUT_ENA) {
> - dprintk("Power Enabled\n");
> + dev_dbg(&sock->dev, "Power Enabled\n");
>   reg |= I365_PWR_OUT;/* enable power */
>   }
>  
> @@ -343,40 +344,44 @@ static int pd6729_set_socket(struct pcmcia_socket 
> *sock, socket_state_t *state)
>   case 0:
>   break;
>   case 33:
> - dprintk("setting voltage to Vcc to 3.3V on socket %i\n",
> + dev_dbg(&sock->dev,
> + "setting voltage to Vcc to 3.3V on socket %i\n",
>   socket->number);
>   reg |= I365_VCC_5V;
>   indirect_setbit(socket, PD67_MISC_CTL_1, PD67_MC1_VCC_3V);
>   break;
>   case 50:
> - dprintk("setting voltage to Vcc to 5V on socket %i\n",
> + dev_dbg(&sock->dev,
> + "setting voltage to Vcc to 5V on socket %i\n",
>   socket->number);
>   reg |= I365_VCC_5V;
>   indirect_resetbit(socket, PD67_MISC_CTL_1, PD67_MC1_VCC_3V);
>   break;
>   default:
> - dprintk("pd6729: pd6729_set_socket called with "
> - "invalid VCC power value: %i\n",
> - state->Vcc);
> + dev_dbg(&sock->dev,
> + "pd6729_set_socket called with invalid VCC power "
> + "value: %i\n", state->Vcc);
>   return -EINVAL;
>   }
>  
>   switch (state->Vpp) {
>   case 0:
> - dprintk("not setting Vpp on socket %i\n", socket->number);
> + dev_dbg(&sock->dev, "not setting Vpp on socket %i\n",
> + socket->number);
>   break;
>   case 33:
>   case 50:
> - dprintk("setting Vpp to Vcc for socket %i\n", socket->number);
> + dev_dbg(&sock->dev, "setting Vpp to Vcc for socket %i\n",
> + socket->number);
>   reg |= I365_VPP1_5V;
>   break;
>   case 120:
> - dprintk("setting Vpp to 12.0\n");
> + dev_dbg(&sock->dev, "setting Vpp to 12.0\n");
>   reg |= I365_VPP1_12V;
>   break;
>   default:
> - dprintk("pd6729: pd6729_set_socket called with invalid VPP 
> power value: %i\n",
> - state->Vpp);
> + dev_dbg(&sock->dev, "pd6729: pd6729_set_socket called with "
> + "invalid VPP power value: %i\n", state->Vpp);
>   return -EINVAL;
>   }
>  
> @@ -438,7 +443,7 @@ static int pd6729_set_io_map(struct pcmcia_socket *sock,
>  
>   /* Check error conditions */
>   if (map > 1) {
> - dprintk("pd6729_set_io_map with invalid map");
> + dev_dbg(&sock->dev, "pd6729_set_io_map with invalid map");
>   return -EINVAL;
>   }
>  
> @@ -446,7 +451,7 @@ static int pd6729_set_io_map(struct pcmcia_socket *sock,
>   if (indirect_read(socket, I365_ADDRWIN) & I365_ENA_IO(map))
>   indirect_resetbit(socket, I365_ADDRWIN, I365_ENA_IO(map));
>  
> - /* dprintk("set_io_map: Setting range to %x - %x\n",
> + /* dev_dbg(&sock->dev, "set_io_map: Setting range to %x - %x\n",
>  io->start, io->stop);*/
>  
>   /* write the new values */
> @@ -529,12 +534,12 @@ static int pd6729_set_mem_map(stru

[PATCH 16/16] pcmcia: use dev_dbg and dev_print in pd6729.c

2009-10-24 Thread Dominik Brodowski
As suggested by Wolfram Sang , use dev_dbg() and
dev_printk() in pd6729.c.

CC: Wolfram Sang 
Signed-off-by: Dominik Brodowski 
---
 drivers/pcmcia/pd6729.c |   69 ++-
 drivers/pcmcia/pd6729.h |7 -
 2 files changed, 38 insertions(+), 38 deletions(-)

diff --git a/drivers/pcmcia/pd6729.c b/drivers/pcmcia/pd6729.c
index 70a3346..509a648 100644
--- a/drivers/pcmcia/pd6729.c
+++ b/drivers/pcmcia/pd6729.c
@@ -213,7 +213,8 @@ static irqreturn_t pd6729_interrupt(int irq, void *dev)
 
if (csc & I365_CSC_DETECT) {
events |= SS_DETECT;
-   dprintk("Card detected in socket %i!\n", i);
+   dev_dbg(&socket[i].socket.dev,
+   "Card detected in socket %i!\n", i);
}
 
if (indirect_read(&socket[i], I365_INTCTL)
@@ -331,11 +332,11 @@ static int pd6729_set_socket(struct pcmcia_socket *sock, 
socket_state_t *state)
reg = I365_PWR_NORESET; /* default: disable resetdrv on resume */
 
if (state->flags & SS_PWR_AUTO) {
-   dprintk("Auto power\n");
+   dev_dbg(&sock->dev, "Auto power\n");
reg |= I365_PWR_AUTO;   /* automatic power mngmnt */
}
if (state->flags & SS_OUTPUT_ENA) {
-   dprintk("Power Enabled\n");
+   dev_dbg(&sock->dev, "Power Enabled\n");
reg |= I365_PWR_OUT;/* enable power */
}
 
@@ -343,40 +344,44 @@ static int pd6729_set_socket(struct pcmcia_socket *sock, 
socket_state_t *state)
case 0:
break;
case 33:
-   dprintk("setting voltage to Vcc to 3.3V on socket %i\n",
+   dev_dbg(&sock->dev,
+   "setting voltage to Vcc to 3.3V on socket %i\n",
socket->number);
reg |= I365_VCC_5V;
indirect_setbit(socket, PD67_MISC_CTL_1, PD67_MC1_VCC_3V);
break;
case 50:
-   dprintk("setting voltage to Vcc to 5V on socket %i\n",
+   dev_dbg(&sock->dev,
+   "setting voltage to Vcc to 5V on socket %i\n",
socket->number);
reg |= I365_VCC_5V;
indirect_resetbit(socket, PD67_MISC_CTL_1, PD67_MC1_VCC_3V);
break;
default:
-   dprintk("pd6729: pd6729_set_socket called with "
-   "invalid VCC power value: %i\n",
-   state->Vcc);
+   dev_dbg(&sock->dev,
+   "pd6729_set_socket called with invalid VCC power "
+   "value: %i\n", state->Vcc);
return -EINVAL;
}
 
switch (state->Vpp) {
case 0:
-   dprintk("not setting Vpp on socket %i\n", socket->number);
+   dev_dbg(&sock->dev, "not setting Vpp on socket %i\n",
+   socket->number);
break;
case 33:
case 50:
-   dprintk("setting Vpp to Vcc for socket %i\n", socket->number);
+   dev_dbg(&sock->dev, "setting Vpp to Vcc for socket %i\n",
+   socket->number);
reg |= I365_VPP1_5V;
break;
case 120:
-   dprintk("setting Vpp to 12.0\n");
+   dev_dbg(&sock->dev, "setting Vpp to 12.0\n");
reg |= I365_VPP1_12V;
break;
default:
-   dprintk("pd6729: pd6729_set_socket called with invalid VPP 
power value: %i\n",
-   state->Vpp);
+   dev_dbg(&sock->dev, "pd6729: pd6729_set_socket called with "
+   "invalid VPP power value: %i\n", state->Vpp);
return -EINVAL;
}
 
@@ -438,7 +443,7 @@ static int pd6729_set_io_map(struct pcmcia_socket *sock,
 
/* Check error conditions */
if (map > 1) {
-   dprintk("pd6729_set_io_map with invalid map");
+   dev_dbg(&sock->dev, "pd6729_set_io_map with invalid map");
return -EINVAL;
}
 
@@ -446,7 +451,7 @@ static int pd6729_set_io_map(struct pcmcia_socket *sock,
if (indirect_read(socket, I365_ADDRWIN) & I365_ENA_IO(map))
indirect_resetbit(socket, I365_ADDRWIN, I365_ENA_IO(map));
 
-   /* dprintk("set_io_map: Setting range to %x - %x\n",
+   /* dev_dbg(&sock->dev, "set_io_map: Setting range to %x - %x\n",
   io->start, io->stop);*/
 
/* write the new values */
@@ -529,12 +534,12 @@ static int pd6729_set_mem_map(struct pcmcia_socket *sock,
if (mem->flags & MAP_WRPROT)
i |= I365_MEM_WRPROT;
if (mem->flags & MAP_ATTRIB) {
-   /* dprintk("requesting attribute memory for socket %i\n",
-   socket->number);*/
+   /* dev_d