linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gpio: samsung: use pr_* instead of printk
@ 2012-09-10 11:59 Jingoo Han
  2012-09-11  6:08 ` Ryan Mallon
  2012-09-11  6:30 ` Felipe Balbi
  0 siblings, 2 replies; 8+ messages in thread
From: Jingoo Han @ 2012-09-10 11:59 UTC (permalink / raw)
  To: 'Grant Likely', 'Linus Walleij'
  Cc: linux-kernel, 'Jingoo Han'

This patch uses pr_* instead of printk.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/gpio/gpio-samsung.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpio/gpio-samsung.c b/drivers/gpio/gpio-samsung.c
index ba126cc..e38d990 100644
--- a/drivers/gpio/gpio-samsung.c
+++ b/drivers/gpio/gpio-samsung.c
@@ -45,7 +45,7 @@
 #ifndef DEBUG_GPIO
 #define gpio_dbg(x...) do { } while (0)
 #else
-#define gpio_dbg(x...) printk(KERN_DEBUG x)
+#define gpio_dbg(x...) pr_debug(x)
 #endif
 
 int samsung_gpio_setpull_updown(struct samsung_gpio_chip *chip,
@@ -926,10 +926,10 @@ static void __init samsung_gpiolib_add(struct samsung_gpio_chip *chip)
 #ifdef CONFIG_PM
 	if (chip->pm != NULL) {
 		if (!chip->pm->save || !chip->pm->resume)
-			printk(KERN_ERR "gpio: %s has missing PM functions\n",
+			pr_err("gpio: %s has missing PM functions\n",
 			       gc->label);
 	} else
-		printk(KERN_ERR "gpio: %s has no PM function\n", gc->label);
+		pr_err("gpio: %s has no PM function\n", gc->label);
 #endif
 
 	/* gpiochip_add() prints own failure message on error. */
-- 
1.7.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] gpio: samsung: use pr_* instead of printk
  2012-09-10 11:59 [PATCH] gpio: samsung: use pr_* instead of printk Jingoo Han
@ 2012-09-11  6:08 ` Ryan Mallon
  2012-09-11  6:35   ` Jingoo Han
  2012-09-11  6:30 ` Felipe Balbi
  1 sibling, 1 reply; 8+ messages in thread
From: Ryan Mallon @ 2012-09-11  6:08 UTC (permalink / raw)
  To: Jingoo Han; +Cc: 'Grant Likely', 'Linus Walleij', linux-kernel

On 10/09/12 21:59, Jingoo Han wrote:
> This patch uses pr_* instead of printk.
> 
> Signed-off-by: Jingoo Han <jg1.han@samsung.com> --- 
> drivers/gpio/gpio-samsung.c |    6 +++--- 1 files changed, 3
> insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpio/gpio-samsung.c
> b/drivers/gpio/gpio-samsung.c index ba126cc..e38d990 100644 ---
> a/drivers/gpio/gpio-samsung.c +++ b/drivers/gpio/gpio-samsung.c @@
> -45,7 +45,7 @@ #ifndef DEBUG_GPIO #define gpio_dbg(x...) do { } while
> (0) #else -#define gpio_dbg(x...) printk(KERN_DEBUG x) +#define
> gpio_dbg(x...) pr_debug(x)

This is a functional change since pr_debug compiles away to nothing
unless DEBUG is defined, so now you need to define both DEBUG and
DEBUG_GPIO for this to print.

A better fix would be to just replace calls to gpio_dbg with pr_debug.

~Ryan

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] gpio: samsung: use pr_* instead of printk
  2012-09-10 11:59 [PATCH] gpio: samsung: use pr_* instead of printk Jingoo Han
  2012-09-11  6:08 ` Ryan Mallon
@ 2012-09-11  6:30 ` Felipe Balbi
  2012-09-11  6:39   ` Jingoo Han
  1 sibling, 1 reply; 8+ messages in thread
From: Felipe Balbi @ 2012-09-11  6:30 UTC (permalink / raw)
  To: Jingoo Han; +Cc: 'Grant Likely', 'Linus Walleij', linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1137 bytes --]

Hi,

On Mon, Sep 10, 2012 at 08:59:11PM +0900, Jingoo Han wrote:
> This patch uses pr_* instead of printk.
> 
> Signed-off-by: Jingoo Han <jg1.han@samsung.com>
> ---
>  drivers/gpio/gpio-samsung.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpio/gpio-samsung.c b/drivers/gpio/gpio-samsung.c
> index ba126cc..e38d990 100644
> --- a/drivers/gpio/gpio-samsung.c
> +++ b/drivers/gpio/gpio-samsung.c
> @@ -45,7 +45,7 @@
>  #ifndef DEBUG_GPIO
>  #define gpio_dbg(x...) do { } while (0)
>  #else
> -#define gpio_dbg(x...) printk(KERN_DEBUG x)
> +#define gpio_dbg(x...) pr_debug(x)
>  #endif
>  
>  int samsung_gpio_setpull_updown(struct samsung_gpio_chip *chip,
> @@ -926,10 +926,10 @@ static void __init samsung_gpiolib_add(struct samsung_gpio_chip *chip)
>  #ifdef CONFIG_PM
>  	if (chip->pm != NULL) {
>  		if (!chip->pm->save || !chip->pm->resume)
> -			printk(KERN_ERR "gpio: %s has missing PM functions\n",
> +			pr_err("gpio: %s has missing PM functions\n",
>  			       gc->label);

I would rather see dev_* conversion instead.

my 2 cents

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] gpio: samsung: use pr_* instead of printk
  2012-09-11  6:08 ` Ryan Mallon
@ 2012-09-11  6:35   ` Jingoo Han
  0 siblings, 0 replies; 8+ messages in thread
From: Jingoo Han @ 2012-09-11  6:35 UTC (permalink / raw)
  To: 'Ryan Mallon'
  Cc: 'Grant Likely', 'Linus Walleij',
	linux-kernel, 'Jingoo Han'

On Tuesday, September 11, 2012 3:09 PM Ryan Mallon wrote
> 
> On 10/09/12 21:59, Jingoo Han wrote:
> > This patch uses pr_* instead of printk.
> >
> > Signed-off-by: Jingoo Han <jg1.han@samsung.com> ---
> > drivers/gpio/gpio-samsung.c |    6 +++--- 1 files changed, 3
> > insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/gpio/gpio-samsung.c
> > b/drivers/gpio/gpio-samsung.c index ba126cc..e38d990 100644 ---
> > a/drivers/gpio/gpio-samsung.c +++ b/drivers/gpio/gpio-samsung.c @@
> > -45,7 +45,7 @@ #ifndef DEBUG_GPIO #define gpio_dbg(x...) do { } while
> > (0) #else -#define gpio_dbg(x...) printk(KERN_DEBUG x) +#define
> > gpio_dbg(x...) pr_debug(x)
> 
> This is a functional change since pr_debug compiles away to nothing
> unless DEBUG is defined, so now you need to define both DEBUG and
> DEBUG_GPIO for this to print.
> 
> A better fix would be to just replace calls to gpio_dbg with pr_debug.
> 
> ~Ryan

Hi Ryan Mallon,

OK, I will replace gpio_dbg with pr_debug as you mentioned.
Thank you.

Best regards,
Jingoo Han



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] gpio: samsung: use pr_* instead of printk
  2012-09-11  6:30 ` Felipe Balbi
@ 2012-09-11  6:39   ` Jingoo Han
  2012-09-11  6:48     ` Ryan Mallon
  0 siblings, 1 reply; 8+ messages in thread
From: Jingoo Han @ 2012-09-11  6:39 UTC (permalink / raw)
  To: balbi
  Cc: 'Grant Likely', 'Linus Walleij',
	linux-kernel, 'Ryan Mallon', 'Jingoo Han'

On Tuesday, September 11, 2012 3:31 PM Felipe Balbi wrote

> 
> Hi,
> 
> On Mon, Sep 10, 2012 at 08:59:11PM +0900, Jingoo Han wrote:
> > This patch uses pr_* instead of printk.
> >
> > Signed-off-by: Jingoo Han <jg1.han@samsung.com>
> > ---
> >  drivers/gpio/gpio-samsung.c |    6 +++---
> >  1 files changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/gpio/gpio-samsung.c b/drivers/gpio/gpio-samsung.c
> > index ba126cc..e38d990 100644
> > --- a/drivers/gpio/gpio-samsung.c
> > +++ b/drivers/gpio/gpio-samsung.c
> > @@ -45,7 +45,7 @@
> >  #ifndef DEBUG_GPIO
> >  #define gpio_dbg(x...) do { } while (0)
> >  #else
> > -#define gpio_dbg(x...) printk(KERN_DEBUG x)
> > +#define gpio_dbg(x...) pr_debug(x)
> >  #endif
> >
> >  int samsung_gpio_setpull_updown(struct samsung_gpio_chip *chip,
> > @@ -926,10 +926,10 @@ static void __init samsung_gpiolib_add(struct samsung_gpio_chip *chip)
> >  #ifdef CONFIG_PM
> >  	if (chip->pm != NULL) {
> >  		if (!chip->pm->save || !chip->pm->resume)
> > -			printk(KERN_ERR "gpio: %s has missing PM functions\n",
> > +			pr_err("gpio: %s has missing PM functions\n",
> >  			       gc->label);
> 
> I would rather see dev_* conversion instead.
> 
> my 2 cents

Hi Felipe Balbi,

OK, I will replace printk(KERN_ERR...) with dev_err.
Thank you.

Best regards,
Jingoo Han


> 
> --
> balbi


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] gpio: samsung: use pr_* instead of printk
  2012-09-11  6:39   ` Jingoo Han
@ 2012-09-11  6:48     ` Ryan Mallon
  2012-09-11  7:02       ` Jingoo Han
  0 siblings, 1 reply; 8+ messages in thread
From: Ryan Mallon @ 2012-09-11  6:48 UTC (permalink / raw)
  To: Jingoo Han
  Cc: balbi, 'Grant Likely', 'Linus Walleij', linux-kernel

On 11/09/12 16:39, Jingoo Han wrote:
> On Tuesday, September 11, 2012 3:31 PM Felipe Balbi wrote
> 
>>
>> Hi,
>>
>> On Mon, Sep 10, 2012 at 08:59:11PM +0900, Jingoo Han wrote:
>>> This patch uses pr_* instead of printk.
>>>
>>> Signed-off-by: Jingoo Han <jg1.han@samsung.com>
>>> ---
>>>  drivers/gpio/gpio-samsung.c |    6 +++---
>>>  1 files changed, 3 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/drivers/gpio/gpio-samsung.c b/drivers/gpio/gpio-samsung.c
>>> index ba126cc..e38d990 100644
>>> --- a/drivers/gpio/gpio-samsung.c
>>> +++ b/drivers/gpio/gpio-samsung.c
>>> @@ -45,7 +45,7 @@
>>>  #ifndef DEBUG_GPIO
>>>  #define gpio_dbg(x...) do { } while (0)
>>>  #else
>>> -#define gpio_dbg(x...) printk(KERN_DEBUG x)
>>> +#define gpio_dbg(x...) pr_debug(x)
>>>  #endif
>>>
>>>  int samsung_gpio_setpull_updown(struct samsung_gpio_chip *chip,
>>> @@ -926,10 +926,10 @@ static void __init samsung_gpiolib_add(struct samsung_gpio_chip *chip)
>>>  #ifdef CONFIG_PM
>>>  	if (chip->pm != NULL) {
>>>  		if (!chip->pm->save || !chip->pm->resume)
>>> -			printk(KERN_ERR "gpio: %s has missing PM functions\n",
>>> +			pr_err("gpio: %s has missing PM functions\n",
>>>  			       gc->label);
>>
>> I would rather see dev_* conversion instead.
>>
>> my 2 cents
> 
> Hi Felipe Balbi,
> 
> OK, I will replace printk(KERN_ERR...) with dev_err.
> Thank you.

I was going to suggest that also, but I don't think that there is a dev
pointer to use. The gpio_chip structure has an optional one, but from my
quick glance it didn't look like the Samsung driver was using it. I
could be wrong though. If I am, go with dev_err (and dev_dbg for
replacing the gpio_dbg statements).

~Ryan






^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] gpio: samsung: use pr_* instead of printk
  2012-09-11  6:48     ` Ryan Mallon
@ 2012-09-11  7:02       ` Jingoo Han
  2012-09-11 11:57         ` Felipe Balbi
  0 siblings, 1 reply; 8+ messages in thread
From: Jingoo Han @ 2012-09-11  7:02 UTC (permalink / raw)
  To: 'Ryan Mallon', balbi
  Cc: 'Grant Likely', 'Linus Walleij',
	linux-kernel, 'Jingoo Han'

On Tuesday, September 11, 2012 3:48 PM Ryan Mallon wrote
> 
> On 11/09/12 16:39, Jingoo Han wrote:
> > On Tuesday, September 11, 2012 3:31 PM Felipe Balbi wrote
> >
> >>
> >> Hi,
> >>
> >> On Mon, Sep 10, 2012 at 08:59:11PM +0900, Jingoo Han wrote:
> >>> This patch uses pr_* instead of printk.
> >>>
> >>> Signed-off-by: Jingoo Han <jg1.han@samsung.com>
> >>> ---
> >>>  drivers/gpio/gpio-samsung.c |    6 +++---
> >>>  1 files changed, 3 insertions(+), 3 deletions(-)
> >>>
> >>> diff --git a/drivers/gpio/gpio-samsung.c b/drivers/gpio/gpio-samsung.c
> >>> index ba126cc..e38d990 100644
> >>> --- a/drivers/gpio/gpio-samsung.c
> >>> +++ b/drivers/gpio/gpio-samsung.c
> >>> @@ -45,7 +45,7 @@
> >>>  #ifndef DEBUG_GPIO
> >>>  #define gpio_dbg(x...) do { } while (0)
> >>>  #else
> >>> -#define gpio_dbg(x...) printk(KERN_DEBUG x)
> >>> +#define gpio_dbg(x...) pr_debug(x)
> >>>  #endif
> >>>
> >>>  int samsung_gpio_setpull_updown(struct samsung_gpio_chip *chip,
> >>> @@ -926,10 +926,10 @@ static void __init samsung_gpiolib_add(struct samsung_gpio_chip *chip)
> >>>  #ifdef CONFIG_PM
> >>>  	if (chip->pm != NULL) {
> >>>  		if (!chip->pm->save || !chip->pm->resume)
> >>> -			printk(KERN_ERR "gpio: %s has missing PM functions\n",
> >>> +			pr_err("gpio: %s has missing PM functions\n",
> >>>  			       gc->label);
> >>
> >> I would rather see dev_* conversion instead.
> >>
> >> my 2 cents
> >
> > Hi Felipe Balbi,
> >
> > OK, I will replace printk(KERN_ERR...) with dev_err.
> > Thank you.
> 
> I was going to suggest that also, but I don't think that there is a dev
> pointer to use. The gpio_chip structure has an optional one, but from my
> quick glance it didn't look like the Samsung driver was using it. I
> could be wrong though. If I am, go with dev_err (and dev_dbg for
> replacing the gpio_dbg statements).

Also, I cannot find dev point to use.
I will use pr_dbg, pr_err.

Thanks.

> 
> ~Ryan
> 
> 
> 



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] gpio: samsung: use pr_* instead of printk
  2012-09-11  7:02       ` Jingoo Han
@ 2012-09-11 11:57         ` Felipe Balbi
  0 siblings, 0 replies; 8+ messages in thread
From: Felipe Balbi @ 2012-09-11 11:57 UTC (permalink / raw)
  To: Jingoo Han
  Cc: 'Ryan Mallon', balbi, 'Grant Likely',
	'Linus Walleij',
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2357 bytes --]

On Tue, Sep 11, 2012 at 04:02:59PM +0900, Jingoo Han wrote:
> On Tuesday, September 11, 2012 3:48 PM Ryan Mallon wrote
> > 
> > On 11/09/12 16:39, Jingoo Han wrote:
> > > On Tuesday, September 11, 2012 3:31 PM Felipe Balbi wrote
> > >
> > >>
> > >> Hi,
> > >>
> > >> On Mon, Sep 10, 2012 at 08:59:11PM +0900, Jingoo Han wrote:
> > >>> This patch uses pr_* instead of printk.
> > >>>
> > >>> Signed-off-by: Jingoo Han <jg1.han@samsung.com>
> > >>> ---
> > >>>  drivers/gpio/gpio-samsung.c |    6 +++---
> > >>>  1 files changed, 3 insertions(+), 3 deletions(-)
> > >>>
> > >>> diff --git a/drivers/gpio/gpio-samsung.c b/drivers/gpio/gpio-samsung.c
> > >>> index ba126cc..e38d990 100644
> > >>> --- a/drivers/gpio/gpio-samsung.c
> > >>> +++ b/drivers/gpio/gpio-samsung.c
> > >>> @@ -45,7 +45,7 @@
> > >>>  #ifndef DEBUG_GPIO
> > >>>  #define gpio_dbg(x...) do { } while (0)
> > >>>  #else
> > >>> -#define gpio_dbg(x...) printk(KERN_DEBUG x)
> > >>> +#define gpio_dbg(x...) pr_debug(x)
> > >>>  #endif
> > >>>
> > >>>  int samsung_gpio_setpull_updown(struct samsung_gpio_chip *chip,
> > >>> @@ -926,10 +926,10 @@ static void __init samsung_gpiolib_add(struct samsung_gpio_chip *chip)
> > >>>  #ifdef CONFIG_PM
> > >>>  	if (chip->pm != NULL) {
> > >>>  		if (!chip->pm->save || !chip->pm->resume)
> > >>> -			printk(KERN_ERR "gpio: %s has missing PM functions\n",
> > >>> +			pr_err("gpio: %s has missing PM functions\n",
> > >>>  			       gc->label);
> > >>
> > >> I would rather see dev_* conversion instead.
> > >>
> > >> my 2 cents
> > >
> > > Hi Felipe Balbi,
> > >
> > > OK, I will replace printk(KERN_ERR...) with dev_err.
> > > Thank you.
> > 
> > I was going to suggest that also, but I don't think that there is a dev
> > pointer to use. The gpio_chip structure has an optional one, but from my
> > quick glance it didn't look like the Samsung driver was using it. I
> > could be wrong though. If I am, go with dev_err (and dev_dbg for
> > replacing the gpio_dbg statements).
> 
> Also, I cannot find dev point to use.
> I will use pr_dbg, pr_err.

Now that I look at the driver, the missing dev pointer is just because
gpio-samsung.c is NOT a proper driver. I'd strongly suggest to convert
the driver to a proper platform_driver, but it's your call anyway ;-)

my 2 cents

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-09-11 12:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-10 11:59 [PATCH] gpio: samsung: use pr_* instead of printk Jingoo Han
2012-09-11  6:08 ` Ryan Mallon
2012-09-11  6:35   ` Jingoo Han
2012-09-11  6:30 ` Felipe Balbi
2012-09-11  6:39   ` Jingoo Han
2012-09-11  6:48     ` Ryan Mallon
2012-09-11  7:02       ` Jingoo Han
2012-09-11 11:57         ` Felipe Balbi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).