Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1208823 > unrolled thread

[PATCHv2 2/5] staging: wilc1000: use pr_* instead of printk

Started byRaphaël Beamonte <raphael.beamonte@gmail.com>
First post2015-08-17 21:30 +0200
Last post2015-08-19 05:00 +0200
Articles 7 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCHv2 2/5] staging: wilc1000: use pr_* instead of printk Raphaël Beamonte <raphael.beamonte@gmail.com> - 2015-08-17 21:30 +0200
    Re: [PATCHv2 2/5] staging: wilc1000: use pr_* instead of printk Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-08-17 22:00 +0200
      [PATCHv3] staging: wilc1000: use netdev_* instead of printk Raphaël Beamonte <raphael.beamonte@gmail.com> - 2015-08-18 01:10 +0200
        Re: [PATCHv3] staging: wilc1000: use netdev_* instead of printk Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-08-18 06:30 +0200
          Re: [PATCHv3] staging: wilc1000: use netdev_* instead of printk Raphaël Beamonte <raphael.beamonte@gmail.com> - 2015-08-18 07:30 +0200
            Re: [PATCHv3] staging: wilc1000: use netdev_* instead of printk Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-08-18 08:20 +0200
        Re: [PATCHv3] staging: wilc1000: use netdev_* instead of printk Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-08-19 05:00 +0200

#1208823 — [PATCHv2 2/5] staging: wilc1000: use pr_* instead of printk

FromRaphaël Beamonte <raphael.beamonte@gmail.com>
Date2015-08-17 21:30 +0200
Subject[PATCHv2 2/5] staging: wilc1000: use pr_* instead of printk
Message-ID<pYygy-8f8-9@gated-at.bofh.it>
Signed-off-by: Raphaël Beamonte <raphael.beamonte@gmail.com>
---
 drivers/staging/wilc1000/coreconfigurator.c  |  4 ++--
 drivers/staging/wilc1000/linux_wlan.c        |  8 ++++----
 drivers/staging/wilc1000/linux_wlan_common.h | 28 ++++++++++++++--------------
 drivers/staging/wilc1000/linux_wlan_sdio.c   |  2 +-
 drivers/staging/wilc1000/linux_wlan_spi.c    |  2 +-
 drivers/staging/wilc1000/wilc_debugfs.c      | 16 ++++++++--------
 drivers/staging/wilc1000/wilc_exported_buf.c |  2 --
 7 files changed, 30 insertions(+), 32 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
index 1a5b165..8a0ebba 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -2005,7 +2005,7 @@ s32 SendConfigPkt(u8 u8Mode, tstrWID *pstrWIDs,
 							pstrWIDs[counter].u16WIDid,
 							(counter == u32WIDsCount - 1), drvHandler)) {
 				ret = -1;
-				printk("[Sendconfigpkt]Get Timed out\n");
+				pr_err("[Sendconfigpkt]Get Timed out\n");
 				break;
 			}
 		}
@@ -2027,7 +2027,7 @@ s32 SendConfigPkt(u8 u8Mode, tstrWID *pstrWIDs,
 							pstrWIDs[counter].s32ValueSize,
 							(counter == u32WIDsCount - 1), drvHandler)) {
 				ret = -1;
-				printk("[Sendconfigpkt]Set Timed out\n");
+				pr_err("[Sendconfigpkt]Set Timed out\n");
 				break;
 			}
 		}
diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index e6e8a20..a02be31 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -1306,7 +1306,7 @@ void wilc1000_wlan_deinit(linux_wlan_t *nic)
 
 	if (g_linux_wlan->wilc1000_initialized)	{
 
-		printk("Deinitializing wilc1000  ...\n");
+		pr_debug("Deinitializing wilc1000  ...\n");
 
 		if (nic == NULL) {
 			PRINT_ER("nic is NULL\n");
@@ -2565,8 +2565,8 @@ static int __init init_wilc_driver(void)
 	}
 #endif
 
-	printk("IN INIT FUNCTION\n");
-	printk("*** WILC1000 driver VERSION=[10.2] FW_VER=[10.2] ***\n");
+	pr_debug("IN INIT FUNCTION\n");
+	pr_info("*** WILC1000 driver VERSION=[10.2] FW_VER=[10.2] ***\n");
 
 	linux_wlan_device_power(1);
 	msleep(100);
@@ -2662,7 +2662,7 @@ static void __exit exit_wilc_driver(void)
 			kfree(g_linux_wlan);
 			g_linux_wlan = NULL;
 		}
-		printk("Module_exit Done.\n");
+		pr_debug("Module_exit Done.\n");
 
 #if defined(WILC_DEBUGFS)
 		wilc_debugfs_remove();
diff --git a/drivers/staging/wilc1000/linux_wlan_common.h b/drivers/staging/wilc1000/linux_wlan_common.h
index e6ebf3e..8f3cc1a 100644
--- a/drivers/staging/wilc1000/linux_wlan_common.h
+++ b/drivers/staging/wilc1000/linux_wlan_common.h
@@ -63,8 +63,8 @@ extern atomic_t DEBUG_LEVEL;
 	do {								\
 		if ((atomic_read(&DEBUG_LEVEL) & INFO) &&		\
 		   ((atomic_read(&REGION)) & (region))) {		\
-			printk("INFO [%s]", __func__);			\
-			printk(__VA_ARGS__);				\
+			pr_info("INFO [%s]", __func__);			\
+			pr_info(__VA_ARGS__);				\
 		}							\
 	} while (0)
 
@@ -72,16 +72,16 @@ extern atomic_t DEBUG_LEVEL;
 	do {								\
 		if ((atomic_read(&DEBUG_LEVEL) & WRN) &&		\
 		   ((atomic_read(&REGION)) & (region))) {		\
-			printk("WRN [%s: %d]", __func__, __LINE__);	\
-			printk(__VA_ARGS__);				\
+			pr_warning("WRN [%s: %d]", __func__, __LINE__);	\
+			pr_warning(__VA_ARGS__);				\
 		}							\
 	} while (0)
 
 #define PRINT_ER(...)							\
 	do {								\
 		if ((atomic_read(&DEBUG_LEVEL) & ERR)) {		\
-			printk("ERR [%s: %d]", __func__, __LINE__);	\
-			printk(__VA_ARGS__);				\
+			pr_err("ERR [%s: %d]", __func__, __LINE__);	\
+			pr_err(__VA_ARGS__);				\
 		}							\
 	} while (0)
 
@@ -96,31 +96,31 @@ extern atomic_t DEBUG_LEVEL;
 #define PRINT_D(region, ...)						\
 	do {								\
 		if (DEBUG == 1 && ((REGION)&(region))) {		\
-			printk("DBG [%s: %d]", __func__, __LINE__);	\
-			printk(__VA_ARGS__);				\
+			pr_debug("DBG [%s: %d]", __func__, __LINE__);	\
+			pr_debug(__VA_ARGS__);				\
 		}							\
 	} while (0)
 
 #define PRINT_INFO(region, ...)						\
 	do {								\
 		if (INFO == 1 && ((REGION)&(region))) {			\
-			printk("INFO [%s]", __func__);			\
-			printk(__VA_ARGS__);				\
+			pr_info("INFO [%s]", __func__);			\
+			pr_info(__VA_ARGS__);				\
 		}							\
 	} while (0)
 
 #define PRINT_WRN(region, ...)						\
 	do {								\
 		if (WRN == 1 && ((REGION)&(region))) {			\
-			printk("WRN [%s: %d]", __func__, __LINE__);	\
-			printk(__VA_ARGS__);				\
+			pr_warning("WRN [%s: %d]", __func__, __LINE__);	\
+			pr_warning(__VA_ARGS__);				\
 		}							\
 	} while (0)
 
 #define PRINT_ER(...)							\
 	do {								\
-		printk("ERR [%s: %d]", __func__, __LINE__);		\
-		printk(__VA_ARGS__);					\
+		pr_err("ERR [%s: %d]", __func__, __LINE__);		\
+		pr_err(__VA_ARGS__);					\
 	} while (0)
 #endif
 
diff --git a/drivers/staging/wilc1000/linux_wlan_sdio.c b/drivers/staging/wilc1000/linux_wlan_sdio.c
index 37f31f4..13d7f84 100644
--- a/drivers/staging/wilc1000/linux_wlan_sdio.c
+++ b/drivers/staging/wilc1000/linux_wlan_sdio.c
@@ -136,7 +136,7 @@ static int linux_sdio_probe(struct sdio_func *func, const struct sdio_device_id
 		return -1;
 	}
 
-	printk("Driver Initializing success\n");
+	pr_info("Driver Initializing success\n");
 	return 0;
 }
 
diff --git a/drivers/staging/wilc1000/linux_wlan_spi.c b/drivers/staging/wilc1000/linux_wlan_spi.c
index 236669c..0bb68a5 100644
--- a/drivers/staging/wilc1000/linux_wlan_spi.c
+++ b/drivers/staging/wilc1000/linux_wlan_spi.c
@@ -50,7 +50,7 @@ static int __init wilc_bus_probe(struct spi_device *spi)
 	PRINT_D(BUS_DBG, "spiMax-Speed: %d\n", spi->max_speed_hz);
 	wilc_spi_dev = spi;
 
-	printk("Driver Initializing success\n");
+	pr_info("Driver Initializing success\n");
 	return 0;
 }
 
diff --git a/drivers/staging/wilc1000/wilc_debugfs.c b/drivers/staging/wilc1000/wilc_debugfs.c
index be2e901..ac65eef 100644
--- a/drivers/staging/wilc1000/wilc_debugfs.c
+++ b/drivers/staging/wilc1000/wilc_debugfs.c
@@ -68,16 +68,16 @@ static ssize_t wilc_debug_level_write(struct file *filp, const char *buf, size_t
 		flag = 100;
 
 	if (flag > DBG_LEVEL_ALL) {
-		printk("%s, value (0x%08x) is out of range, stay previous flag (0x%08x)\n", __func__, flag, atomic_read(&DEBUG_LEVEL));
+		pr_err("%s, value (0x%08x) is out of range, stay previous flag (0x%08x)\n", __func__, flag, atomic_read(&DEBUG_LEVEL));
 		return -EFAULT;
 	}
 
 	atomic_set(&DEBUG_LEVEL, (int)flag);
 
 	if (flag == 0)
-		printk("Debug-level disabled\n");
+		pr_debug("Debug-level disabled\n");
 	else
-		printk("Debug-level enabled\n");
+		pr_debug("Debug-level enabled\n");
 	return count;
 }
 
@@ -110,12 +110,12 @@ static ssize_t wilc_debug_region_write(struct file *filp, const char *buf, size_
 	flag = buffer[0] - '0';
 
 	if (flag > DBG_REGION_ALL) {
-		printk("%s, value (0x%08x) is out of range, stay previous flag (0x%08x)\n", __func__, flag, atomic_read(&REGION));
+		pr_err("%s, value (0x%08x) is out of range, stay previous flag (0x%08x)\n", __func__, flag, atomic_read(&REGION));
 		return -EFAULT;
 	}
 
 	atomic_set(&REGION, (int)flag);
-	printk("new debug-region is %x\n", atomic_read(&REGION));
+	pr_debug("new debug-region is %x\n", atomic_read(&REGION));
 
 	return count;
 }
@@ -154,12 +154,12 @@ int wilc_debugfs_init(void)
 	wilc_dir = debugfs_create_dir("wilc_wifi", NULL);
 	if (wilc_dir ==  ERR_PTR(-ENODEV)) {
 		/* it's not error. the debugfs is just not being enabled. */
-		printk("ERR, kernel has built without debugfs support\n");
+		pr_err("kernel has built without debugfs support\n");
 		return 0;
 	}
 
 	if (!wilc_dir) {
-		printk("ERR, debugfs create dir\n");
+		pr_err("debugfs create dir\n");
 		return -1;
 	}
 
@@ -172,7 +172,7 @@ int wilc_debugfs_init(void)
 						    &info->fops);
 
 		if (!debugfs_files) {
-			printk("ERR fail to create the debugfs file, %s\n", info->name);
+			pr_err("fail to create the debugfs file, %s\n", info->name);
 			debugfs_remove_recursive(wilc_dir);
 			return -1;
 		}
diff --git a/drivers/staging/wilc1000/wilc_exported_buf.c b/drivers/staging/wilc1000/wilc_exported_buf.c
index deba6bd..55b6232 100644
--- a/drivers/staging/wilc1000/wilc_exported_buf.c
+++ b/drivers/staging/wilc1000/wilc_exported_buf.c
@@ -48,7 +48,6 @@ EXPORT_SYMBOL(get_fw_buffer);
 
 static int __init wilc_module_init(void)
 {
-	printk("wilc_module_init\n");
 	/*
 	 * alloc necessary memory
 	 */
@@ -61,7 +60,6 @@ static int __init wilc_module_init(void)
 
 static void __exit wilc_module_deinit(void)
 {
-	printk("wilc_module_deinit\n");
 	FREE_WILC_BUFFER(g_tx_buf)
 	FREE_WILC_BUFFER(g_rx_buf)
 	FREE_WILC_BUFFER(g_fw_buf)
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1208845

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2015-08-17 22:00 +0200
Message-ID<pYyJz-lu-3@gated-at.bofh.it>
In reply to#1208823
On Mon, Aug 17, 2015 at 03:28:27PM -0400, Raphaël Beamonte wrote:
> Signed-off-by: Raphaël Beamonte <raphael.beamonte@gmail.com>
> ---
>  drivers/staging/wilc1000/coreconfigurator.c  |  4 ++--
>  drivers/staging/wilc1000/linux_wlan.c        |  8 ++++----
>  drivers/staging/wilc1000/linux_wlan_common.h | 28 ++++++++++++++--------------
>  drivers/staging/wilc1000/linux_wlan_sdio.c   |  2 +-
>  drivers/staging/wilc1000/linux_wlan_spi.c    |  2 +-
>  drivers/staging/wilc1000/wilc_debugfs.c      | 16 ++++++++--------
>  drivers/staging/wilc1000/wilc_exported_buf.c |  2 --
>  7 files changed, 30 insertions(+), 32 deletions(-)
> 
> diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
> index 1a5b165..8a0ebba 100644
> --- a/drivers/staging/wilc1000/coreconfigurator.c
> +++ b/drivers/staging/wilc1000/coreconfigurator.c
> @@ -2005,7 +2005,7 @@ s32 SendConfigPkt(u8 u8Mode, tstrWID *pstrWIDs,
>  							pstrWIDs[counter].u16WIDid,
>  							(counter == u32WIDsCount - 1), drvHandler)) {
>  				ret = -1;
> -				printk("[Sendconfigpkt]Get Timed out\n");
> +				pr_err("[Sendconfigpkt]Get Timed out\n");

This is a network driver, please use the proper logging statement for
such a thing (i.e. netdev_err()).

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1208936 — [PATCHv3] staging: wilc1000: use netdev_* instead of printk

FromRaphaël Beamonte <raphael.beamonte@gmail.com>
Date2015-08-18 01:10 +0200
Subject[PATCHv3] staging: wilc1000: use netdev_* instead of printk
Message-ID<pYBHr-4Ns-5@gated-at.bofh.it>
In reply to#1208845
Signed-off-by: Raphaël Beamonte <raphael.beamonte@gmail.com>
---
 drivers/staging/wilc1000/coreconfigurator.c  |  4 ++--
 drivers/staging/wilc1000/linux_wlan.c        |  8 ++++----
 drivers/staging/wilc1000/linux_wlan_common.h | 28 ++++++++++++++--------------
 drivers/staging/wilc1000/linux_wlan_sdio.c   |  2 +-
 drivers/staging/wilc1000/linux_wlan_spi.c    |  2 +-
 drivers/staging/wilc1000/wilc_debugfs.c      | 16 ++++++++--------
 drivers/staging/wilc1000/wilc_exported_buf.c |  2 --
 7 files changed, 30 insertions(+), 32 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
index 16a0abc..9a36b78 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -2001,7 +2001,7 @@ s32 SendConfigPkt(u8 u8Mode, tstrWID *pstrWIDs,
 							pstrWIDs[counter].u16WIDid,
 							(counter == u32WIDsCount - 1), drvHandler)) {
 				ret = -1;
-				printk("[Sendconfigpkt]Get Timed out\n");
+				netdev_err("[Sendconfigpkt]Get Timed out\n");
 				break;
 			}
 		}
@@ -2023,7 +2023,7 @@ s32 SendConfigPkt(u8 u8Mode, tstrWID *pstrWIDs,
 							pstrWIDs[counter].s32ValueSize,
 							(counter == u32WIDsCount - 1), drvHandler)) {
 				ret = -1;
-				printk("[Sendconfigpkt]Set Timed out\n");
+				netdev_err("[Sendconfigpkt]Set Timed out\n");
 				break;
 			}
 		}
diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index b3cc9f5..7903572 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -1306,7 +1306,7 @@ void wilc1000_wlan_deinit(linux_wlan_t *nic)
 
 	if (g_linux_wlan->wilc1000_initialized)	{
 
-		printk("Deinitializing wilc1000  ...\n");
+		netdev_debug("Deinitializing wilc1000  ...\n");
 
 		if (nic == NULL) {
 			PRINT_ER("nic is NULL\n");
@@ -2565,8 +2565,8 @@ static int __init init_wilc_driver(void)
 	}
 #endif
 
-	printk("IN INIT FUNCTION\n");
-	printk("*** WILC1000 driver VERSION=[10.2] FW_VER=[10.2] ***\n");
+	netdev_debug("IN INIT FUNCTION\n");
+	netdev_info("*** WILC1000 driver VERSION=[10.2] FW_VER=[10.2] ***\n");
 
 	linux_wlan_device_power(1);
 	msleep(100);
@@ -2662,7 +2662,7 @@ static void __exit exit_wilc_driver(void)
 			kfree(g_linux_wlan);
 			g_linux_wlan = NULL;
 		}
-		printk("Module_exit Done.\n");
+		netdev_debug("Module_exit Done.\n");
 
 #if defined(WILC_DEBUGFS)
 		wilc_debugfs_remove();
diff --git a/drivers/staging/wilc1000/linux_wlan_common.h b/drivers/staging/wilc1000/linux_wlan_common.h
index e6ebf3e..7f53d8c 100644
--- a/drivers/staging/wilc1000/linux_wlan_common.h
+++ b/drivers/staging/wilc1000/linux_wlan_common.h
@@ -63,8 +63,8 @@ extern atomic_t DEBUG_LEVEL;
 	do {								\
 		if ((atomic_read(&DEBUG_LEVEL) & INFO) &&		\
 		   ((atomic_read(&REGION)) & (region))) {		\
-			printk("INFO [%s]", __func__);			\
-			printk(__VA_ARGS__);				\
+			netdev_info("INFO [%s]", __func__);			\
+			netdev_info(__VA_ARGS__);				\
 		}							\
 	} while (0)
 
@@ -72,16 +72,16 @@ extern atomic_t DEBUG_LEVEL;
 	do {								\
 		if ((atomic_read(&DEBUG_LEVEL) & WRN) &&		\
 		   ((atomic_read(&REGION)) & (region))) {		\
-			printk("WRN [%s: %d]", __func__, __LINE__);	\
-			printk(__VA_ARGS__);				\
+			netdev_warning("WRN [%s: %d]", __func__, __LINE__);	\
+			netdev_warning(__VA_ARGS__);				\
 		}							\
 	} while (0)
 
 #define PRINT_ER(...)							\
 	do {								\
 		if ((atomic_read(&DEBUG_LEVEL) & ERR)) {		\
-			printk("ERR [%s: %d]", __func__, __LINE__);	\
-			printk(__VA_ARGS__);				\
+			netdev_err("ERR [%s: %d]", __func__, __LINE__);	\
+			netdev_err(__VA_ARGS__);				\
 		}							\
 	} while (0)
 
@@ -96,31 +96,31 @@ extern atomic_t DEBUG_LEVEL;
 #define PRINT_D(region, ...)						\
 	do {								\
 		if (DEBUG == 1 && ((REGION)&(region))) {		\
-			printk("DBG [%s: %d]", __func__, __LINE__);	\
-			printk(__VA_ARGS__);				\
+			netdev_debug("DBG [%s: %d]", __func__, __LINE__);	\
+			netdev_debug(__VA_ARGS__);				\
 		}							\
 	} while (0)
 
 #define PRINT_INFO(region, ...)						\
 	do {								\
 		if (INFO == 1 && ((REGION)&(region))) {			\
-			printk("INFO [%s]", __func__);			\
-			printk(__VA_ARGS__);				\
+			netdev_info("INFO [%s]", __func__);			\
+			netdev_info(__VA_ARGS__);				\
 		}							\
 	} while (0)
 
 #define PRINT_WRN(region, ...)						\
 	do {								\
 		if (WRN == 1 && ((REGION)&(region))) {			\
-			printk("WRN [%s: %d]", __func__, __LINE__);	\
-			printk(__VA_ARGS__);				\
+			netdev_warning("WRN [%s: %d]", __func__, __LINE__);	\
+			netdev_warning(__VA_ARGS__);				\
 		}							\
 	} while (0)
 
 #define PRINT_ER(...)							\
 	do {								\
-		printk("ERR [%s: %d]", __func__, __LINE__);		\
-		printk(__VA_ARGS__);					\
+		netdev_err("ERR [%s: %d]", __func__, __LINE__);		\
+		netdev_err(__VA_ARGS__);					\
 	} while (0)
 #endif
 
diff --git a/drivers/staging/wilc1000/linux_wlan_sdio.c b/drivers/staging/wilc1000/linux_wlan_sdio.c
index 37f31f4..ef2cfa9 100644
--- a/drivers/staging/wilc1000/linux_wlan_sdio.c
+++ b/drivers/staging/wilc1000/linux_wlan_sdio.c
@@ -136,7 +136,7 @@ static int linux_sdio_probe(struct sdio_func *func, const struct sdio_device_id
 		return -1;
 	}
 
-	printk("Driver Initializing success\n");
+	netdev_info("Driver Initializing success\n");
 	return 0;
 }
 
diff --git a/drivers/staging/wilc1000/linux_wlan_spi.c b/drivers/staging/wilc1000/linux_wlan_spi.c
index 236669c..675db07 100644
--- a/drivers/staging/wilc1000/linux_wlan_spi.c
+++ b/drivers/staging/wilc1000/linux_wlan_spi.c
@@ -50,7 +50,7 @@ static int __init wilc_bus_probe(struct spi_device *spi)
 	PRINT_D(BUS_DBG, "spiMax-Speed: %d\n", spi->max_speed_hz);
 	wilc_spi_dev = spi;
 
-	printk("Driver Initializing success\n");
+	netdev_info("Driver Initializing success\n");
 	return 0;
 }
 
diff --git a/drivers/staging/wilc1000/wilc_debugfs.c b/drivers/staging/wilc1000/wilc_debugfs.c
index ae11186..7e88723 100644
--- a/drivers/staging/wilc1000/wilc_debugfs.c
+++ b/drivers/staging/wilc1000/wilc_debugfs.c
@@ -59,16 +59,16 @@ static ssize_t wilc_debug_level_write(struct file *filp, const char __user *buf,
 		return ret;
 
 	if (flag > DBG_LEVEL_ALL) {
-		printk("%s, value (0x%08x) is out of range, stay previous flag (0x%08x)\n", __func__, flag, atomic_read(&DEBUG_LEVEL));
+		netdev_err("%s, value (0x%08x) is out of range, stay previous flag (0x%08x)\n", __func__, flag, atomic_read(&DEBUG_LEVEL));
 		return -EINVAL;
 	}
 
 	atomic_set(&DEBUG_LEVEL, (int)flag);
 
 	if (flag == 0)
-		printk("Debug-level disabled\n");
+		netdev_debug("Debug-level disabled\n");
 	else
-		printk("Debug-level enabled\n");
+		netdev_debug("Debug-level enabled\n");
 
 	return count;
 }
@@ -102,12 +102,12 @@ static ssize_t wilc_debug_region_write(struct file *filp, const char *buf, size_
 	flag = buffer[0] - '0';
 
 	if (flag > DBG_REGION_ALL) {
-		printk("%s, value (0x%08x) is out of range, stay previous flag (0x%08x)\n", __func__, flag, atomic_read(&REGION));
+		netdev_err("%s, value (0x%08x) is out of range, stay previous flag (0x%08x)\n", __func__, flag, atomic_read(&REGION));
 		return -EFAULT;
 	}
 
 	atomic_set(&REGION, (int)flag);
-	printk("new debug-region is %x\n", atomic_read(&REGION));
+	netdev_debug("new debug-region is %x\n", atomic_read(&REGION));
 
 	return count;
 }
@@ -146,12 +146,12 @@ int wilc_debugfs_init(void)
 	wilc_dir = debugfs_create_dir("wilc_wifi", NULL);
 	if (wilc_dir ==  ERR_PTR(-ENODEV)) {
 		/* it's not error. the debugfs is just not being enabled. */
-		printk("ERR, kernel has built without debugfs support\n");
+		netdev_err("kernel has built without debugfs support\n");
 		return 0;
 	}
 
 	if (!wilc_dir) {
-		printk("ERR, debugfs create dir\n");
+		netdev_err("debugfs create dir\n");
 		return -1;
 	}
 
@@ -164,7 +164,7 @@ int wilc_debugfs_init(void)
 						    &info->fops);
 
 		if (!debugfs_files) {
-			printk("ERR fail to create the debugfs file, %s\n", info->name);
+			netdev_err("fail to create the debugfs file, %s\n", info->name);
 			debugfs_remove_recursive(wilc_dir);
 			return -1;
 		}
diff --git a/drivers/staging/wilc1000/wilc_exported_buf.c b/drivers/staging/wilc1000/wilc_exported_buf.c
index c3f6a0a..148d608 100644
--- a/drivers/staging/wilc1000/wilc_exported_buf.c
+++ b/drivers/staging/wilc1000/wilc_exported_buf.c
@@ -45,7 +45,6 @@ EXPORT_SYMBOL(get_fw_buffer);
 
 static int __init wilc_module_init(void)
 {
-	printk("wilc_module_init\n");
 	/*
 	 * alloc necessary memory
 	 */
@@ -58,7 +57,6 @@ static int __init wilc_module_init(void)
 
 static void __exit wilc_module_deinit(void)
 {
-	printk("wilc_module_deinit\n");
 	FREE_WILC_BUFFER(g_tx_buf)
 	FREE_WILC_BUFFER(g_rx_buf)
 	FREE_WILC_BUFFER(g_fw_buf)
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1209033 — Re: [PATCHv3] staging: wilc1000: use netdev_* instead of printk

FromSudip Mukherjee <sudipm.mukherjee@gmail.com>
Date2015-08-18 06:30 +0200
SubjectRe: [PATCHv3] staging: wilc1000: use netdev_* instead of printk
Message-ID<pYGH7-3Jf-3@gated-at.bofh.it>
In reply to#1208936
On Mon, Aug 17, 2015 at 07:06:40PM -0400, Raphaël Beamonte wrote:
> Signed-off-by: Raphaël Beamonte <raphael.beamonte@gmail.com>
> ---
>  drivers/staging/wilc1000/coreconfigurator.c  |  4 ++--
>  drivers/staging/wilc1000/linux_wlan.c        |  8 ++++----
>  drivers/staging/wilc1000/linux_wlan_common.h | 28 ++++++++++++++--------------
>  drivers/staging/wilc1000/linux_wlan_sdio.c   |  2 +-
>  drivers/staging/wilc1000/linux_wlan_spi.c    |  2 +-
>  drivers/staging/wilc1000/wilc_debugfs.c      | 16 ++++++++--------
>  drivers/staging/wilc1000/wilc_exported_buf.c |  2 --
>  7 files changed, 30 insertions(+), 32 deletions(-)
> 
> diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
> index 16a0abc..9a36b78 100644
> --- a/drivers/staging/wilc1000/coreconfigurator.c
> +++ b/drivers/staging/wilc1000/coreconfigurator.c
> @@ -2001,7 +2001,7 @@ s32 SendConfigPkt(u8 u8Mode, tstrWID *pstrWIDs,
>  							pstrWIDs[counter].u16WIDid,
>  							(counter == u32WIDsCount - 1), drvHandler)) {
>  				ret = -1;
> -				printk("[Sendconfigpkt]Get Timed out\n");
> +				netdev_err("[Sendconfigpkt]Get Timed out\n");
This will not compile. you can not just replace printk with
netdev_*, you need to mention a net_device.

regards
sudip
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1209041 — Re: [PATCHv3] staging: wilc1000: use netdev_* instead of printk

FromRaphaël Beamonte <raphael.beamonte@gmail.com>
Date2015-08-18 07:30 +0200
SubjectRe: [PATCHv3] staging: wilc1000: use netdev_* instead of printk
Message-ID<pYHDc-54g-1@gated-at.bofh.it>
In reply to#1209033
2015-08-18 0:24 GMT-04:00 Sudip Mukherjee <sudipm.mukherjee@gmail.com>:
>> +                             netdev_err("[Sendconfigpkt]Get Timed out\n");
> This will not compile. you can not just replace printk with
> netdev_*, you need to mention a net_device.

You're right! I'm making a lot of mistakes. It seems I called the make
command in the wrong git tree... Thanks for catching that, and taking
time to review!
I just saw there isn't any netdev_debug available. Do you know the
reason for that? Is there a replacement besides pr_debug?
Also, it seems that in all the functions where it's another netdev
that's available that I could use, I don't have access to the
net_device struct. Is there a general way to get that device
information? I saw an old lkml post talking about dev_*() functions to
do that? Would you have some hint on the matter?

Thanks a lot!
Raphaël
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1209065 — Re: [PATCHv3] staging: wilc1000: use netdev_* instead of printk

FromSudip Mukherjee <sudipm.mukherjee@gmail.com>
Date2015-08-18 08:20 +0200
SubjectRe: [PATCHv3] staging: wilc1000: use netdev_* instead of printk
Message-ID<pYIpA-6ey-15@gated-at.bofh.it>
In reply to#1209041
On Tue, Aug 18, 2015 at 01:27:31AM -0400, Raphaël Beamonte wrote:
> 2015-08-18 0:24 GMT-04:00 Sudip Mukherjee <sudipm.mukherjee@gmail.com>:
> >> +                             netdev_err("[Sendconfigpkt]Get Timed out\n");
> > This will not compile. you can not just replace printk with
> > netdev_*, you need to mention a net_device.
> 
> You're right! I'm making a lot of mistakes. It seems I called the make
> command in the wrong git tree... Thanks for catching that, and taking
> time to review!
> I just saw there isn't any netdev_debug available. Do you know the
> reason for that? Is there a replacement besides pr_debug?
netdev_dbg
> Also, it seems that in all the functions where it's another netdev
> that's available that I could use, I don't have access to the
> net_device struct. Is there a general way to get that device
> information? I saw an old lkml post talking about dev_*() functions to
> do that? Would you have some hint on the matter?
If the function is not having the net_device try to see if you can
pass it the struct as an argument. if not possible then in any way then
no other way but to use pr_*

regards
sudip
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1209578 — Re: [PATCHv3] staging: wilc1000: use netdev_* instead of printk

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2015-08-19 05:00 +0200
SubjectRe: [PATCHv3] staging: wilc1000: use netdev_* instead of printk
Message-ID<pZ1Lz-1aB-7@gated-at.bofh.it>
In reply to#1208936
On Mon, Aug 17, 2015 at 07:06:40PM -0400, Raphaël Beamonte wrote:
> Signed-off-by: Raphaël Beamonte <raphael.beamonte@gmail.com>

You can't submit a patch with no changelog information, sorry.

Always build your patches, otherwise you make maintainers really grumpy
as it breaks their build.

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web