mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <ahmad@a3f.at>
To: barebox@lists.infradead.org
Subject: [PATCH 03/11] ARM: rpi: make functions in rpi-common.c static
Date: Sat, 28 Nov 2020 22:39:26 +0100	[thread overview]
Message-ID: <20201128213934.681065-3-ahmad@a3f.at> (raw)
In-Reply-To: <20201128213934.681065-1-ahmad@a3f.at>

They aren't (and arguably shouldn't) be used outside, so give them all
internal linkage and drop the header.

Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
---
 arch/arm/boards/raspberry-pi/rpi-common.c | 22 +++++++++++++++------
 arch/arm/boards/raspberry-pi/rpi.h        | 24 -----------------------
 2 files changed, 16 insertions(+), 30 deletions(-)
 delete mode 100644 arch/arm/boards/raspberry-pi/rpi.h

diff --git a/arch/arm/boards/raspberry-pi/rpi-common.c b/arch/arm/boards/raspberry-pi/rpi-common.c
index d5995fb86d7f..2535146af488 100644
--- a/arch/arm/boards/raspberry-pi/rpi-common.c
+++ b/arch/arm/boards/raspberry-pi/rpi-common.c
@@ -25,9 +25,19 @@
 #include <mach/mbox.h>
 #include <mach/platform.h>
 
-#include "rpi.h"
 #include "lowlevel.h"
 
+struct rpi_model {
+	const char *name;
+	void (*init)(void);
+};
+
+#define RPI_MODEL(_id, _name, _init)	\
+	[_id] = {				\
+		.name			= _name,\
+		.init			= _init,\
+	}
+
 struct msg_get_arm_mem {
 	struct bcm2835_mbox_hdr hdr;
 	struct bcm2835_mbox_tag_get_arm_mem get_arm_mem;
@@ -85,7 +95,7 @@ static struct clk *rpi_register_firmware_clock(u32 clock_id, const char *name)
 	return clk_fixed(name, msg->get_clock_rate.body.resp.rate_hz);
 }
 
-void rpi_set_usbethaddr(void)
+static void rpi_set_usbethaddr(void)
 {
 	BCM2835_MBOX_STACK_ALIGN(struct msg_get_mac_address, msg);
 	int ret;
@@ -103,7 +113,7 @@ void rpi_set_usbethaddr(void)
 	eth_register_ethaddr(0, msg->get_mac_address.body.resp.mac);
 }
 
-struct gpio_led rpi_leds[] = {
+static struct gpio_led rpi_leds[] = {
 	{
 		.gpio	= -EINVAL,
 		.led	= {
@@ -149,7 +159,7 @@ static void rpi_b_plus_init(void)
 }
 
 /* See comments in mbox.h for data source */
-const struct rpi_model rpi_models_old_scheme[] = {
+static const struct rpi_model rpi_models_old_scheme[] = {
 	RPI_MODEL(0, "Unknown model", NULL),
 	RPI_MODEL(BCM2835_BOARD_REV_B_I2C0_2, "Model B (no P5)", rpi_b_init),
 	RPI_MODEL(BCM2835_BOARD_REV_B_I2C0_3, "Model B (no P5)", rpi_b_init),
@@ -170,7 +180,7 @@ const struct rpi_model rpi_models_old_scheme[] = {
 	RPI_MODEL(BCM2835_BOARD_REV_A_PLUS_15, "Model A+", NULL),
 };
 
-const struct rpi_model rpi_models_new_scheme[] = {
+static const struct rpi_model rpi_models_new_scheme[] = {
 	RPI_MODEL(BCM2835_BOARD_REV_A, 		"Model A",	NULL ),
 	RPI_MODEL(BCM2835_BOARD_REV_B, 		"Model B", 	rpi_b_init ),
 	RPI_MODEL(BCM2835_BOARD_REV_A_PLUS, 	"Model A+", 	NULL ),
@@ -191,7 +201,7 @@ const struct rpi_model rpi_models_new_scheme[] = {
 };
 
 static int rpi_board_rev = 0;
-const struct rpi_model *model = NULL;
+static const struct rpi_model *model = NULL;
 
 static void rpi_get_board_rev(void)
 {
diff --git a/arch/arm/boards/raspberry-pi/rpi.h b/arch/arm/boards/raspberry-pi/rpi.h
deleted file mode 100644
index b2a0401bd01b..000000000000
--- a/arch/arm/boards/raspberry-pi/rpi.h
+++ /dev/null
@@ -1,24 +0,0 @@
-#ifndef __ARCH_ARM_BOARDS_RPI_H__
-#define __ARCH_ARM_BOARDS_RPI_H__
-
-#include <types.h>
-#include <led.h>
-
-#include <mach/mbox.h>
-
-#define RPI_MODEL(_id, _name, _init)	\
-	[_id] = {				\
-		.name			= _name,\
-		.init			= _init,\
-	}
-
-struct rpi_model {
-	const char *name;
-	void (*init)(void);
-};
-
-extern struct gpio_led rpi_leds[];
-
-void rpi_set_usbethaddr(void);
-
-#endif /* __ARCH_ARM_BOARDS_RPI_H__ */
-- 
2.28.0


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

  parent reply	other threads:[~2020-11-28 21:39 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-28 21:39 [PATCH 01/11] Revert "ARM: dts: bcm2835-rpi: re-enable booting from SD card" Ahmad Fatoum
2020-11-28 21:39 ` [PATCH 02/11] ARM: dts: rpi: drop unnecessary /chosen/stdout-path overrides Ahmad Fatoum
2020-11-28 21:39 ` Ahmad Fatoum [this message]
2020-11-28 21:39 ` [PATCH 04/11] ARM: rpi: move rpi_model_init() to postcore Ahmad Fatoum
2020-11-28 21:39 ` [PATCH 05/11] ARM: rpi: support raspberry pi 1 and zero mini-uart Ahmad Fatoum
2020-11-28 21:39 ` [PATCH 06/11] ARM: rpi: add new init function for Raspberry Pi Zero Ahmad Fatoum
2020-11-28 21:39 ` [PATCH 07/11] ARM: rpi: Add Raspberry Pi Zero W mini-uart support Ahmad Fatoum
2020-11-28 21:39 ` [PATCH 08/11] ARM: rpi: drop no longer needed environment Ahmad Fatoum
2020-11-28 21:39 ` [PATCH 09/11] ARM: rpi: fix model description string Ahmad Fatoum
2020-11-28 21:39 ` [PATCH 10/11] ARM: rpi: add new rpi boot target Ahmad Fatoum
2020-11-28 21:39 ` [PATCH 11/11] doc: bcm283x: document use of mini-uart on Raspberry Pi Zero W / CM3 Ahmad Fatoum
2020-11-29 19:50   ` Roland Hieber
2020-11-29 20:20     ` Ahmad Fatoum
2020-12-07  7:10     ` Sascha Hauer
2020-12-07 10:00       ` Ahmad Fatoum
2020-12-07 10:29         ` Sascha Hauer
2020-12-07 10:00   ` [PATCH] fixup! " Ahmad Fatoum

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=20201128213934.681065-3-ahmad@a3f.at \
    --to=ahmad@a3f.at \
    --cc=barebox@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox