diff mbox series

[1/7] fpga: altera: Use logging feature instead of FPGA_DEBUG

Message ID 20220919103912.26554-2-ada@thorsis.com
State Superseded
Delegated to: Michal Simek
Headers show
Series Use logging feature instead of FPGA_DEBUG | expand

Commit Message

Alexander Dahl Sept. 19, 2022, 10:39 a.m. UTC
Instead of using DEBUG or LOG_DEBUG the driver still had its own
definition for debug output.

Signed-off-by: Alexander Dahl <ada@thorsis.com>
---
 drivers/fpga/altera.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

Comments

Michal Simek Sept. 21, 2022, 11:02 a.m. UTC | #1
On 9/19/22 12:39, Alexander Dahl wrote:
> Instead of using DEBUG or LOG_DEBUG the driver still had its own
> definition for debug output.
> 
> Signed-off-by: Alexander Dahl <ada@thorsis.com>
> ---
>   drivers/fpga/altera.c | 13 ++++++-------
>   1 file changed, 6 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/fpga/altera.c b/drivers/fpga/altera.c
> index 10c0475d25..5a8fee10a5 100644
> --- a/drivers/fpga/altera.c
> +++ b/drivers/fpga/altera.c
> @@ -7,6 +7,8 @@
>    * Rich Ireland, Enterasys Networks, rireland@enterasys.com.
>    */
>   
> +#define LOG_CATEGORY UCLASS_FS_FIRMWARE_LOADER

I think all changes in this series are fine expect this LOG_CATEGORY.
This is generic FS loader. I think fgpa uclass should be created.

Thanks,
Michal
diff mbox series

Patch

diff --git a/drivers/fpga/altera.c b/drivers/fpga/altera.c
index 10c0475d25..5a8fee10a5 100644
--- a/drivers/fpga/altera.c
+++ b/drivers/fpga/altera.c
@@ -7,6 +7,8 @@ 
  * Rich Ireland, Enterasys Networks, rireland@enterasys.com.
  */
 
+#define LOG_CATEGORY UCLASS_FS_FIRMWARE_LOADER
+
 /*
  *  Altera FPGA support
  */
@@ -16,9 +18,6 @@ 
 #include <log.h>
 #include <stratixII.h>
 
-/* Define FPGA_DEBUG to 1 to get debug printf's */
-#define FPGA_DEBUG	0
-
 static const struct altera_fpga {
 	enum altera_family	family;
 	const char		*name;
@@ -106,8 +105,8 @@  int altera_load(Altera_desc *desc, const void *buf, size_t bsize)
 	if (!fpga)
 		return FPGA_FAIL;
 
-	debug_cond(FPGA_DEBUG, "%s: Launching the %s Loader...\n",
-		   __func__, fpga->name);
+	log_debug("%s: Launching the %s Loader...\n",
+		  __func__, fpga->name);
 	if (fpga->load)
 		return fpga->load(desc, buf, bsize);
 	return 0;
@@ -120,8 +119,8 @@  int altera_dump(Altera_desc *desc, const void *buf, size_t bsize)
 	if (!fpga)
 		return FPGA_FAIL;
 
-	debug_cond(FPGA_DEBUG, "%s: Launching the %s Reader...\n",
-		   __func__, fpga->name);
+	log_debug("%s: Launching the %s Reader...\n",
+		  __func__, fpga->name);
 	if (fpga->dump)
 		return fpga->dump(desc, buf, bsize);
 	return 0;