X86 platform drivers
 help / color / mirror / Atom feed
* [PATCH] msi-laptop: use pr_<level> for messages
@ 2011-03-10 11:02 Lee, Chun-Yi
  2011-03-13  6:31 ` Dmitry Torokhov
  0 siblings, 1 reply; 5+ messages in thread
From: Lee, Chun-Yi @ 2011-03-10 11:02 UTC (permalink / raw)
  To: mjg
  Cc: platform-driver-x86, Lee, Chun-Yi, Carlos Corbacho,
	Dmitry Torokhov, Corentin Chary

msi-laptop: use pr_<level> for messages

Cc: Carlos Corbacho <carlos@strangeworlds.co.uk>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Dmitry Torokhov <dtor@mail.ru>
Cc: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Lee, Chun-Yi <jlee@novell.com>
---
 drivers/platform/x86/msi-laptop.c |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/platform/x86/msi-laptop.c b/drivers/platform/x86/msi-laptop.c
index 028d2c6..77a6c3b 100644
--- a/drivers/platform/x86/msi-laptop.c
+++ b/drivers/platform/x86/msi-laptop.c
@@ -445,8 +445,7 @@ static struct platform_device *msipf_device;
 
 static int dmi_check_cb(const struct dmi_system_id *id)
 {
-	printk(KERN_INFO "msi-laptop: Identified laptop model '%s'.\n",
-	       id->ident);
+	pr_info("msi-laptop: Identified laptop model '%s'.\n", id->ident);
 	return 1;
 }
 
@@ -834,8 +833,7 @@ static int load_scm_model_init(struct platform_device *sdev)
 
 	result = i8042_install_filter(msi_laptop_i8042_filter);
 	if (result) {
-		printk(KERN_ERR
-			"msi-laptop: Unable to install key filter\n");
+		pr_err("msi-laptop: Unable to install key filter\n");
 		goto fail_filter;
 	}
 
@@ -875,7 +873,7 @@ static int __init msi_init(void)
 	/* Register backlight stuff */
 
 	if (acpi_video_backlight_support()) {
-		printk(KERN_INFO "MSI: Brightness ignored, must be controlled "
+		pr_info("MSI: Brightness ignored, must be controlled "
 		       "by ACPI video driver\n");
 	} else {
 		struct backlight_properties props;
@@ -929,7 +927,8 @@ static int __init msi_init(void)
 	if (auto_brightness != 2)
 		set_auto_brightness(auto_brightness);
 
-	printk(KERN_INFO "msi-laptop: driver "MSI_DRIVER_VERSION" successfully loaded.\n");
+	pr_info("msi-laptop: driver "MSI_DRIVER_VERSION
+		" successfully loaded.\n");
 
 	return 0;
 
@@ -977,7 +976,7 @@ static void __exit msi_cleanup(void)
 	if (auto_brightness != 2)
 		set_auto_brightness(1);
 
-	printk(KERN_INFO "msi-laptop: driver unloaded.\n");
+	pr_info("msi-laptop: driver unloaded.\n");
 }
 
 module_init(msi_init);
-- 
1.6.0.2

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

* Re: [PATCH] msi-laptop: use pr_<level> for messages
  2011-03-10 11:02 [PATCH] msi-laptop: use pr_<level> for messages Lee, Chun-Yi
@ 2011-03-13  6:31 ` Dmitry Torokhov
  2011-03-16  7:55   ` Joey Lee
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Torokhov @ 2011-03-13  6:31 UTC (permalink / raw)
  To: Lee, Chun-Yi
  Cc: mjg, platform-driver-x86, Lee, Chun-Yi, Carlos Corbacho,
	Corentin Chary

On Thu, Mar 10, 2011 at 07:02:34PM +0800, Lee, Chun-Yi wrote:
> msi-laptop: use pr_<level> for messages
> 
> Cc: Carlos Corbacho <carlos@strangeworlds.co.uk>
> Cc: Matthew Garrett <mjg@redhat.com>
> Cc: Dmitry Torokhov <dtor@mail.ru>
> Cc: Corentin Chary <corentincj@iksaif.net>
> Signed-off-by: Lee, Chun-Yi <jlee@novell.com>
> ---
>  drivers/platform/x86/msi-laptop.c |   13 ++++++-------
>  1 files changed, 6 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/platform/x86/msi-laptop.c b/drivers/platform/x86/msi-laptop.c
> index 028d2c6..77a6c3b 100644
> --- a/drivers/platform/x86/msi-laptop.c
> +++ b/drivers/platform/x86/msi-laptop.c
> @@ -445,8 +445,7 @@ static struct platform_device *msipf_device;
>  
>  static int dmi_check_cb(const struct dmi_system_id *id)
>  {
> -	printk(KERN_INFO "msi-laptop: Identified laptop model '%s'.\n",
> -	       id->ident);
> +	pr_info("msi-laptop: Identified laptop model '%s'.\n", id->ident);

No, you need to add:

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

at the very beginning of your driver (before includes) and then just do

	pr_info("Identified laptop model '%s'.\n", id->ident);

and pr_fmt() will ensure that alll your messages use consistent prefix.

Thanks.

-- 
Dmitry

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

* Re: [PATCH] msi-laptop: use pr_<level> for messages
  2011-03-13  6:31 ` Dmitry Torokhov
@ 2011-03-16  7:55   ` Joey Lee
  2011-03-16  8:22     ` Dmitry Torokhov
  0 siblings, 1 reply; 5+ messages in thread
From: Joey Lee @ 2011-03-16  7:55 UTC (permalink / raw)
  To: dmitry.torokhov; +Cc: corentincj, Joey Lee, mjg, carlos, platform-driver-x86

Hi Dmitry, 

於 六,2011-03-12 於 22:31 -0800,Dmitry Torokhov 提到:
> >  
> >  static int dmi_check_cb(const struct dmi_system_id *id)
> >  {
> > -	printk(KERN_INFO "msi-laptop: Identified laptop model '%s'.\n",
> > -	       id->ident);
> > +	pr_info("msi-laptop: Identified laptop model '%s'.\n", id->ident);
> 
> No, you need to add:
> 
> #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> 
> at the very beginning of your driver (before includes) and then just do
> 
> 	pr_info("Identified laptop model '%s'.\n", id->ident);
> 
> and pr_fmt() will ensure that alll your messages use consistent prefix.
> 
> Thanks.
> 

Thank's for your teach, it works fine to me. Follow your suggestion, I
fixed my patch like the following, please kindly review it again:


From 31123fcc91b073b329a970b075041eaec523b106 Mon Sep 17 00:00:00 2001
From: Lee, Chun-Yi <jlee@novell.com>
Date: Wed, 16 Mar 2011 15:44:40 +0800
Subject: [PATCH] msi-laptop: use pr_<level> for messages

msi-laptop: use pr_<level> for messages

Cc: Carlos Corbacho <carlos@strangeworlds.co.uk>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Dmitry Torokhov <dtor@mail.ru>
Cc: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Lee, Chun-Yi <jlee@novell.com>
---
 drivers/platform/x86/msi-laptop.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/platform/x86/msi-laptop.c b/drivers/platform/x86/msi-laptop.c
index 028d2c6..0de6d43 100644
--- a/drivers/platform/x86/msi-laptop.c
+++ b/drivers/platform/x86/msi-laptop.c
@@ -51,6 +51,8 @@
  * laptop as MSI S270. YMMV.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
@@ -445,8 +447,7 @@ static struct platform_device *msipf_device;
 
 static int dmi_check_cb(const struct dmi_system_id *id)
 {
-	printk(KERN_INFO "msi-laptop: Identified laptop model '%s'.\n",
-	       id->ident);
+	pr_info("Identified laptop model '%s'.\n", id->ident);
 	return 1;
 }
 
@@ -834,8 +835,7 @@ static int load_scm_model_init(struct platform_device *sdev)
 
 	result = i8042_install_filter(msi_laptop_i8042_filter);
 	if (result) {
-		printk(KERN_ERR
-			"msi-laptop: Unable to install key filter\n");
+		pr_err("Unable to install key filter\n");
 		goto fail_filter;
 	}
 
@@ -875,7 +875,7 @@ static int __init msi_init(void)
 	/* Register backlight stuff */
 
 	if (acpi_video_backlight_support()) {
-		printk(KERN_INFO "MSI: Brightness ignored, must be controlled "
+		pr_info("Brightness ignored, must be controlled "
 		       "by ACPI video driver\n");
 	} else {
 		struct backlight_properties props;
@@ -929,7 +929,7 @@ static int __init msi_init(void)
 	if (auto_brightness != 2)
 		set_auto_brightness(auto_brightness);
 
-	printk(KERN_INFO "msi-laptop: driver "MSI_DRIVER_VERSION" successfully loaded.\n");
+	pr_info("driver "MSI_DRIVER_VERSION" successfully loaded.\n");
 
 	return 0;
 
@@ -977,7 +977,7 @@ static void __exit msi_cleanup(void)
 	if (auto_brightness != 2)
 		set_auto_brightness(1);
 
-	printk(KERN_INFO "msi-laptop: driver unloaded.\n");
+	pr_info("driver unloaded.\n");
 }
 
 module_init(msi_init);
-- 
1.6.0.2

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

* Re: [PATCH] msi-laptop: use pr_<level> for messages
  2011-03-16  7:55   ` Joey Lee
@ 2011-03-16  8:22     ` Dmitry Torokhov
  2011-03-16  9:59       ` Joey Lee
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Torokhov @ 2011-03-16  8:22 UTC (permalink / raw)
  To: Joey Lee; +Cc: corentincj, mjg, carlos, platform-driver-x86

Hi Joey,

On Wed, Mar 16, 2011 at 01:55:19AM -0600, Joey Lee wrote:
> Hi Dmitry, 
> 
> 於 六,2011-03-12 於 22:31 -0800,Dmitry Torokhov 提到:
> > >  
> > >  static int dmi_check_cb(const struct dmi_system_id *id)
> > >  {
> > > -	printk(KERN_INFO "msi-laptop: Identified laptop model '%s'.\n",
> > > -	       id->ident);
> > > +	pr_info("msi-laptop: Identified laptop model '%s'.\n", id->ident);
> > 
> > No, you need to add:
> > 
> > #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> > 
> > at the very beginning of your driver (before includes) and then just do
> > 
> > 	pr_info("Identified laptop model '%s'.\n", id->ident);
> > 
> > and pr_fmt() will ensure that alll your messages use consistent prefix.
> > 
> > Thanks.
> > 
> 
> Thank's for your teach, it works fine to me. Follow your suggestion, I
> fixed my patch like the following, please kindly review it again:
> 
> 
> >From 31123fcc91b073b329a970b075041eaec523b106 Mon Sep 17 00:00:00 2001
> From: Lee, Chun-Yi <jlee@novell.com>
> Date: Wed, 16 Mar 2011 15:44:40 +0800
> Subject: [PATCH] msi-laptop: use pr_<level> for messages
> 
> msi-laptop: use pr_<level> for messages
> 
> Cc: Carlos Corbacho <carlos@strangeworlds.co.uk>
> Cc: Matthew Garrett <mjg@redhat.com>
> Cc: Dmitry Torokhov <dtor@mail.ru>
> Cc: Corentin Chary <corentincj@iksaif.net>
> Signed-off-by: Lee, Chun-Yi <jlee@novell.com>

Looks good to me.

Reviewed-by: Dmitry Torokhov <dtor@mail.ru>

> ---
>  drivers/platform/x86/msi-laptop.c |   14 +++++++-------
>  1 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/platform/x86/msi-laptop.c b/drivers/platform/x86/msi-laptop.c
> index 028d2c6..0de6d43 100644
> --- a/drivers/platform/x86/msi-laptop.c
> +++ b/drivers/platform/x86/msi-laptop.c
> @@ -51,6 +51,8 @@
>   * laptop as MSI S270. YMMV.
>   */
>  
> +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> +
>  #include <linux/module.h>
>  #include <linux/kernel.h>
>  #include <linux/init.h>
> @@ -445,8 +447,7 @@ static struct platform_device *msipf_device;
>  
>  static int dmi_check_cb(const struct dmi_system_id *id)
>  {
> -	printk(KERN_INFO "msi-laptop: Identified laptop model '%s'.\n",
> -	       id->ident);
> +	pr_info("Identified laptop model '%s'.\n", id->ident);
>  	return 1;
>  }
>  
> @@ -834,8 +835,7 @@ static int load_scm_model_init(struct platform_device *sdev)
>  
>  	result = i8042_install_filter(msi_laptop_i8042_filter);
>  	if (result) {
> -		printk(KERN_ERR
> -			"msi-laptop: Unable to install key filter\n");
> +		pr_err("Unable to install key filter\n");
>  		goto fail_filter;
>  	}
>  
> @@ -875,7 +875,7 @@ static int __init msi_init(void)
>  	/* Register backlight stuff */
>  
>  	if (acpi_video_backlight_support()) {
> -		printk(KERN_INFO "MSI: Brightness ignored, must be controlled "
> +		pr_info("Brightness ignored, must be controlled "
>  		       "by ACPI video driver\n");
>  	} else {
>  		struct backlight_properties props;
> @@ -929,7 +929,7 @@ static int __init msi_init(void)
>  	if (auto_brightness != 2)
>  		set_auto_brightness(auto_brightness);
>  
> -	printk(KERN_INFO "msi-laptop: driver "MSI_DRIVER_VERSION" successfully loaded.\n");
> +	pr_info("driver "MSI_DRIVER_VERSION" successfully loaded.\n");
>  
>  	return 0;
>  
> @@ -977,7 +977,7 @@ static void __exit msi_cleanup(void)
>  	if (auto_brightness != 2)
>  		set_auto_brightness(1);
>  
> -	printk(KERN_INFO "msi-laptop: driver unloaded.\n");
> +	pr_info("driver unloaded.\n");
>  }
>  
>  module_init(msi_init);
> -- 
> 1.6.0.2
> 
> 
> 
> 

-- 
Dmitry

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

* Re: [PATCH] msi-laptop: use pr_<level> for messages
  2011-03-16  8:22     ` Dmitry Torokhov
@ 2011-03-16  9:59       ` Joey Lee
  0 siblings, 0 replies; 5+ messages in thread
From: Joey Lee @ 2011-03-16  9:59 UTC (permalink / raw)
  To: dmitry.torokhov; +Cc: corentincj, mjg, carlos, platform-driver-x86

於 三,2011-03-16 於 01:22 -0700,Dmitry Torokhov 提到:
> Hi Joey,
> 
> On Wed, Mar 16, 2011 at 01:55:19AM -0600, Joey Lee wrote:
> > Hi Dmitry, 
> > 
> > 於 六,2011-03-12 於 22:31 -0800,Dmitry Torokhov 提到:
> > > >  
> > > >  static int dmi_check_cb(const struct dmi_system_id *id)
> > > >  {
> > > > -	printk(KERN_INFO "msi-laptop: Identified laptop model '%s'.\n",
> > > > -	       id->ident);
> > > > +	pr_info("msi-laptop: Identified laptop model '%s'.\n", id->ident);
> > > 
> > > No, you need to add:
> > > 
> > > #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> > > 
> > > at the very beginning of your driver (before includes) and then just do
> > > 
> > > 	pr_info("Identified laptop model '%s'.\n", id->ident);
> > > 
> > > and pr_fmt() will ensure that alll your messages use consistent prefix.
> > > 
> > > Thanks.
> > > 
> > 
> > Thank's for your teach, it works fine to me. Follow your suggestion, I
> > fixed my patch like the following, please kindly review it again:
> > 
> > 
> > >From 31123fcc91b073b329a970b075041eaec523b106 Mon Sep 17 00:00:00 2001
> > From: Lee, Chun-Yi <jlee@novell.com>
> > Date: Wed, 16 Mar 2011 15:44:40 +0800
> > Subject: [PATCH] msi-laptop: use pr_<level> for messages
> > 
> > msi-laptop: use pr_<level> for messages
> > 
> > Cc: Carlos Corbacho <carlos@strangeworlds.co.uk>
> > Cc: Matthew Garrett <mjg@redhat.com>
> > Cc: Dmitry Torokhov <dtor@mail.ru>
> > Cc: Corentin Chary <corentincj@iksaif.net>
> > Signed-off-by: Lee, Chun-Yi <jlee@novell.com>
> 
> Looks good to me.
> 
> Reviewed-by: Dmitry Torokhov <dtor@mail.ru>
> 

Thank's for your kindly review. :-)

Joey Lee

> > ---
> >  drivers/platform/x86/msi-laptop.c |   14 +++++++-------
> >  1 files changed, 7 insertions(+), 7 deletions(-)
> > 
> > diff --git a/drivers/platform/x86/msi-laptop.c b/drivers/platform/x86/msi-laptop.c
> > index 028d2c6..0de6d43 100644
> > --- a/drivers/platform/x86/msi-laptop.c
> > +++ b/drivers/platform/x86/msi-laptop.c
> > @@ -51,6 +51,8 @@
> >   * laptop as MSI S270. YMMV.
> >   */
> >  
> > +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> > +
> >  #include <linux/module.h>
> >  #include <linux/kernel.h>
> >  #include <linux/init.h>
> > @@ -445,8 +447,7 @@ static struct platform_device *msipf_device;
> >  
> >  static int dmi_check_cb(const struct dmi_system_id *id)
> >  {
> > -	printk(KERN_INFO "msi-laptop: Identified laptop model '%s'.\n",
> > -	       id->ident);
> > +	pr_info("Identified laptop model '%s'.\n", id->ident);
> >  	return 1;
> >  }
> >  
> > @@ -834,8 +835,7 @@ static int load_scm_model_init(struct platform_device *sdev)
> >  
> >  	result = i8042_install_filter(msi_laptop_i8042_filter);
> >  	if (result) {
> > -		printk(KERN_ERR
> > -			"msi-laptop: Unable to install key filter\n");
> > +		pr_err("Unable to install key filter\n");
> >  		goto fail_filter;
> >  	}
> >  
> > @@ -875,7 +875,7 @@ static int __init msi_init(void)
> >  	/* Register backlight stuff */
> >  
> >  	if (acpi_video_backlight_support()) {
> > -		printk(KERN_INFO "MSI: Brightness ignored, must be controlled "
> > +		pr_info("Brightness ignored, must be controlled "
> >  		       "by ACPI video driver\n");
> >  	} else {
> >  		struct backlight_properties props;
> > @@ -929,7 +929,7 @@ static int __init msi_init(void)
> >  	if (auto_brightness != 2)
> >  		set_auto_brightness(auto_brightness);
> >  
> > -	printk(KERN_INFO "msi-laptop: driver "MSI_DRIVER_VERSION" successfully loaded.\n");
> > +	pr_info("driver "MSI_DRIVER_VERSION" successfully loaded.\n");
> >  
> >  	return 0;
> >  
> > @@ -977,7 +977,7 @@ static void __exit msi_cleanup(void)
> >  	if (auto_brightness != 2)
> >  		set_auto_brightness(1);
> >  
> > -	printk(KERN_INFO "msi-laptop: driver unloaded.\n");
> > +	pr_info("driver unloaded.\n");
> >  }
> >  
> >  module_init(msi_init);
> > -- 
> > 1.6.0.2
> > 
> > 
> > 
> > 
> 

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

end of thread, other threads:[~2011-03-16  9:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-10 11:02 [PATCH] msi-laptop: use pr_<level> for messages Lee, Chun-Yi
2011-03-13  6:31 ` Dmitry Torokhov
2011-03-16  7:55   ` Joey Lee
2011-03-16  8:22     ` Dmitry Torokhov
2011-03-16  9:59       ` Joey Lee

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox