[PATCH 01/27] pbl: console: Introduce putc_func_t

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Andrey Smirnov <andrew.smirnov@xxxxxxxxx>
---
 arch/arm/cpu/psci.c | 4 ++--
 include/console.h   | 6 ++++--
 pbl/console.c       | 4 ++--
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/arch/arm/cpu/psci.c b/arch/arm/cpu/psci.c
index 0a7e48f8f..ad132c0a3 100644
--- a/arch/arm/cpu/psci.c
+++ b/arch/arm/cpu/psci.c
@@ -33,10 +33,10 @@
  * warned.
  */
 
-static void (*__putc)(void *ctx, int c);
+static putc_func_t __putc;
 static void *putc_ctx;
 
-void psci_set_putc(void (*putcf)(void *ctx, int c), void *ctx)
+void psci_set_putc(putc_func_t putcf, void *ctx)
 {
         __putc = putcf;
         putc_ctx = ctx;
diff --git a/include/console.h b/include/console.h
index 673921331..c671be859 100644
--- a/include/console.h
+++ b/include/console.h
@@ -199,10 +199,12 @@ static inline int console_drain(struct console_device *cdev,
 	return __console_drain(is_timeout, cdev, fifo, buf, len, timeout);
 }
 
+typedef void (*putc_func_t) (void *ctx, int c);
+
 #ifdef CONFIG_PBL_CONSOLE
-void pbl_set_putc(void (*putcf)(void *ctx, int c), void *ctx);
+void pbl_set_putc(putc_func_t putcf, void *ctx);
 #else
-static inline void pbl_set_putc(void (*putcf)(void *ctx, int c), void *ctx) {}
+static inline void pbl_set_putc(putc_func_t putcf, void *ctx) {}
 #endif
 
 bool console_allow_color(void);
diff --git a/pbl/console.c b/pbl/console.c
index 007e4e4b8..75576ec79 100644
--- a/pbl/console.c
+++ b/pbl/console.c
@@ -6,7 +6,7 @@
  * Put these in the data section so that they survive the clearing of the
  * BSS segment.
  */
-static __attribute__ ((section(".data"))) void (*__putc)(void *ctx, int c);
+static __attribute__ ((section(".data"))) putc_func_t __putc;
 static __attribute__ ((section(".data"))) void *putc_ctx;
 
 /**
@@ -17,7 +17,7 @@ static __attribute__ ((section(".data"))) void *putc_ctx;
  * This sets the putc function which is afterwards used to output
  * characters in the PBL.
  */
-void pbl_set_putc(void (*putcf)(void *ctx, int c), void *ctx)
+void pbl_set_putc(putc_func_t putcf, void *ctx)
 {
 	__putc = putcf;
 	putc_ctx = ctx;
-- 
2.17.0


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux