All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anup Patel <apatel@ventanamicro.com>
To: opensbi@lists.infradead.org
Subject: [PATCH 2/6] lib: sbi: Remove sbi_console_init() and console_init() platform callback
Date: Fri,  5 Jul 2024 12:45:00 +0530	[thread overview]
Message-ID: <20240705071504.50988-3-apatel@ventanamicro.com> (raw)
In-Reply-To: <20240705071504.50988-1-apatel@ventanamicro.com>

Now that all platforms have been updated to initialize serial console
device in early_init(), the sbi_console_init() and console_init()
platform callback are redundant hence remove them.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
---
 include/sbi/sbi_console.h  |  2 --
 include/sbi/sbi_platform.h | 17 -----------------
 lib/sbi/sbi_console.c      | 11 -----------
 lib/sbi/sbi_init.c         |  4 ----
 4 files changed, 34 deletions(-)

diff --git a/include/sbi/sbi_console.h b/include/sbi/sbi_console.h
index 0979765..3097db1 100644
--- a/include/sbi/sbi_console.h
+++ b/include/sbi/sbi_console.h
@@ -58,8 +58,6 @@ void sbi_console_set_device(const struct sbi_console_device *dev);
 
 struct sbi_scratch;
 
-int sbi_console_init(struct sbi_scratch *scratch);
-
 #define SBI_ASSERT(cond, args) do { \
 	if (unlikely(!(cond))) \
 		sbi_panic args; \
diff --git a/include/sbi/sbi_platform.h b/include/sbi/sbi_platform.h
index 581935a..7b3ac4b 100644
--- a/include/sbi/sbi_platform.h
+++ b/include/sbi/sbi_platform.h
@@ -111,9 +111,6 @@ struct sbi_platform_operations {
 	/** Get platform specific mhpmevent value */
 	uint64_t (*pmu_xlate_to_mhpmevent)(uint32_t event_idx, uint64_t data);
 
-	/** Initialize the platform console */
-	int (*console_init)(void);
-
 	/** Initialize the platform interrupt controller for current HART */
 	int (*irqchip_init)(bool cold_boot);
 	/** Exit the platform interrupt controller for current HART */
@@ -549,20 +546,6 @@ static inline uint64_t sbi_platform_pmu_xlate_to_mhpmevent(const struct sbi_plat
 	return 0;
 }
 
-/**
- * Initialize the platform console
- *
- * @param plat pointer to struct sbi_platform
- *
- * @return 0 on success and negative error code on failure
- */
-static inline int sbi_platform_console_init(const struct sbi_platform *plat)
-{
-	if (plat && sbi_platform_ops(plat)->console_init)
-		return sbi_platform_ops(plat)->console_init();
-	return 0;
-}
-
 /**
  * Initialize the platform interrupt controller for current HART
  *
diff --git a/lib/sbi/sbi_console.c b/lib/sbi/sbi_console.c
index d3ec461..194529d 100644
--- a/lib/sbi/sbi_console.c
+++ b/lib/sbi/sbi_console.c
@@ -477,14 +477,3 @@ void sbi_console_set_device(const struct sbi_console_device *dev)
 
 	console_dev = dev;
 }
-
-int sbi_console_init(struct sbi_scratch *scratch)
-{
-	int rc = sbi_platform_console_init(sbi_platform_ptr(scratch));
-
-	/* console is not a necessary device */
-	if (rc == SBI_ENODEV)
-		return 0;
-
-	return rc;
-}
diff --git a/lib/sbi/sbi_init.c b/lib/sbi/sbi_init.c
index 0f9e14c..d80efe9 100644
--- a/lib/sbi/sbi_init.c
+++ b/lib/sbi/sbi_init.c
@@ -261,10 +261,6 @@ static void __noreturn init_coldboot(struct sbi_scratch *scratch, u32 hartid)
 	if (rc)
 		sbi_hart_hang();
 
-	rc = sbi_console_init(scratch);
-	if (rc)
-		sbi_hart_hang();
-
 	rc = sbi_sse_init(scratch, true);
 	if (rc) {
 		sbi_printf("%s: sse init failed (error %d)\n", __func__, rc);
-- 
2.34.1



  parent reply	other threads:[~2024-07-05  7:15 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-05  7:14 [PATCH 0/6] Early console buffer for OpenSBI Anup Patel
2024-07-05  7:14 ` [PATCH 1/6] platform: Setup serial console device in early_init() Anup Patel
2024-07-24  5:40   ` Himanshu Chauhan
2024-07-05  7:15 ` Anup Patel [this message]
2024-07-24  5:40   ` [PATCH 2/6] lib: sbi: Remove sbi_console_init() and console_init() platform callback Himanshu Chauhan
2024-07-05  7:15 ` [PATCH 3/6] lib: sbi: Optimize fifo enqueue/dequeue for basic data types Anup Patel
2024-07-24  5:37   ` Himanshu Chauhan
2024-07-05  7:15 ` [PATCH 4/6] lib: sbi: Allow forceful queueing of data in sbi_fifo_enqueue() Anup Patel
2024-07-24  5:38   ` Himanshu Chauhan
2024-07-05  7:15 ` [PATCH 5/6] include: sbi: Add macros to create FIFO as local or global variable Anup Patel
2024-07-24  5:38   ` Himanshu Chauhan
2024-07-05  7:15 ` [PATCH 6/6] lib: sbi: Introduce an early console buffer for caching early prints Anup Patel
2024-07-24  5:39   ` Himanshu Chauhan
2024-07-08 16:48 ` [PATCH 0/6] Early console buffer for OpenSBI Xiang W
2024-07-09  3:43   ` Anup Patel
2024-07-24  6:50 ` Anup Patel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240705071504.50988-3-apatel@ventanamicro.com \
    --to=apatel@ventanamicro.com \
    --cc=opensbi@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.