[PATCH 1/3] ARM: Rockchip: bbu: rename rk3568_bbu_mmc_register to rockchip_*

Ahmad Fatoum a.fatoum at pengutronix.de
Sun Apr 14 22:28:13 PDT 2024


The update handler isn't restricted to the RK3568, but is also usable
for other RKNS SoCs. With minor modification, it is also usable for the
RK3399 and perhaps even older SoCs, so let's rename it to
rockchip_bbu_mmc_handler instead. We can always do SoC-type checks
inside to handle differences.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 arch/arm/boards/radxa-cm3/board.c                 |  6 +++---
 arch/arm/boards/radxa-rock3/board.c               |  4 ++--
 arch/arm/boards/radxa-rock5/board.c               |  4 ++--
 arch/arm/boards/rockchip-rk3568-bpi-r2pro/board.c |  5 ++---
 arch/arm/boards/rockchip-rk3568-evb/board.c       |  5 ++---
 arch/arm/mach-rockchip/bbu.c                      | 10 +++++-----
 include/mach/rockchip/bbu.h                       |  6 ++++--
 7 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/arch/arm/boards/radxa-cm3/board.c b/arch/arm/boards/radxa-cm3/board.c
index 14b678417910..19d37e31d9b0 100644
--- a/arch/arm/boards/radxa-cm3/board.c
+++ b/arch/arm/boards/radxa-cm3/board.c
@@ -26,9 +26,9 @@ static int cm3_probe(struct device *dev)
 	else
 		of_device_enable_path("/chosen/environment-emmc");
 
-	rk3568_bbu_mmc_register("emmc", BBU_HANDLER_FLAG_DEFAULT,
-				"/dev/mmc0");
-	rk3568_bbu_mmc_register("sd", 0, "/dev/mmc1");
+	rockchip_bbu_mmc_register("emmc", BBU_HANDLER_FLAG_DEFAULT,
+				  "/dev/mmc0");
+	rockchip_bbu_mmc_register("sd", 0, "/dev/mmc1");
 
 	return 0;
 }
diff --git a/arch/arm/boards/radxa-rock3/board.c b/arch/arm/boards/radxa-rock3/board.c
index 0d425e266755..df99eded2ca8 100644
--- a/arch/arm/boards/radxa-rock3/board.c
+++ b/arch/arm/boards/radxa-rock3/board.c
@@ -26,8 +26,8 @@ static int rock3_probe(struct device *dev)
 	else
 		of_device_enable_path("/chosen/environment-emmc");
 
-	rk3568_bbu_mmc_register("emmc", BBU_HANDLER_FLAG_DEFAULT, "/dev/mmc0");
-	rk3568_bbu_mmc_register("sd", 0, "/dev/mmc1");
+	rockchip_bbu_mmc_register("emmc", BBU_HANDLER_FLAG_DEFAULT, "/dev/mmc0");
+	rockchip_bbu_mmc_register("sd", 0, "/dev/mmc1");
 
 	return 0;
 }
diff --git a/arch/arm/boards/radxa-rock5/board.c b/arch/arm/boards/radxa-rock5/board.c
index 6ea6ffeaaf4e..eab0c0104000 100644
--- a/arch/arm/boards/radxa-rock5/board.c
+++ b/arch/arm/boards/radxa-rock5/board.c
@@ -23,8 +23,8 @@ static int rock5_probe(struct device *dev)
 	else
 		of_device_enable_path("/chosen/environment-emmc");
 
-	rk3568_bbu_mmc_register("emmc", BBU_HANDLER_FLAG_DEFAULT, "/dev/mmc0");
-	rk3568_bbu_mmc_register("sd", 0, "/dev/mmc1");
+	rockchip_bbu_mmc_register("emmc", BBU_HANDLER_FLAG_DEFAULT, "/dev/mmc0");
+	rockchip_bbu_mmc_register("sd", 0, "/dev/mmc1");
 
 	return 0;
 }
diff --git a/arch/arm/boards/rockchip-rk3568-bpi-r2pro/board.c b/arch/arm/boards/rockchip-rk3568-bpi-r2pro/board.c
index 94d1dac2c2d1..7178c02d8f09 100644
--- a/arch/arm/boards/rockchip-rk3568-bpi-r2pro/board.c
+++ b/arch/arm/boards/rockchip-rk3568-bpi-r2pro/board.c
@@ -28,9 +28,8 @@ static int rk3568_bpi_r2pro_probe(struct device *dev)
 	else
 		of_device_enable_path("/chosen/environment-emmc");
 
-	rk3568_bbu_mmc_register("sd", 0, "/dev/mmc0");
-	rk3568_bbu_mmc_register("emmc", BBU_HANDLER_FLAG_DEFAULT,
-				"/dev/mmc1");
+	rockchip_bbu_mmc_register("sd", 0, "/dev/mmc0");
+	rockchip_bbu_mmc_register("emmc", BBU_HANDLER_FLAG_DEFAULT, "/dev/mmc1");
 
 	return 0;
 }
diff --git a/arch/arm/boards/rockchip-rk3568-evb/board.c b/arch/arm/boards/rockchip-rk3568-evb/board.c
index f404af217bb7..9659bd69c5b8 100644
--- a/arch/arm/boards/rockchip-rk3568-evb/board.c
+++ b/arch/arm/boards/rockchip-rk3568-evb/board.c
@@ -28,9 +28,8 @@ static int rk3568_evb_probe(struct device *dev)
 	else
 		of_device_enable_path("/chosen/environment-emmc");
 
-	rk3568_bbu_mmc_register("sd", 0, "/dev/mmc0");
-	rk3568_bbu_mmc_register("emmc", BBU_HANDLER_FLAG_DEFAULT,
-				"/dev/mmc1");
+	rockchip_bbu_mmc_register("sd", 0, "/dev/mmc0");
+	rockchip_bbu_mmc_register("emmc", BBU_HANDLER_FLAG_DEFAULT, "/dev/mmc1");
 
 	return 0;
 }
diff --git a/arch/arm/mach-rockchip/bbu.c b/arch/arm/mach-rockchip/bbu.c
index 3ab6c1e68502..0f50fd1282ed 100644
--- a/arch/arm/mach-rockchip/bbu.c
+++ b/arch/arm/mach-rockchip/bbu.c
@@ -36,8 +36,8 @@
  * leaves the previously written inactive image as a fallback in case writing the
  * first one gets interrupted.
  */
-static int rk3568_bbu_mmc_handler(struct bbu_handler *handler,
-				  struct bbu_data *data)
+static int rockchip_bbu_mmc_handler(struct bbu_handler *handler,
+				    struct bbu_data *data)
 {
 	enum filetype filetype;
 	int ret, fd, wr0, wr1;
@@ -113,8 +113,8 @@ static int rk3568_bbu_mmc_handler(struct bbu_handler *handler,
 	return ret;
 }
 
-int rk3568_bbu_mmc_register(const char *name, unsigned long flags,
-                const char *devicefile)
+int rockchip_bbu_mmc_register(const char *name, unsigned long flags,
+			      const char *devicefile)
 {
 	struct bbu_handler *handler;
 	int ret;
@@ -124,7 +124,7 @@ int rk3568_bbu_mmc_register(const char *name, unsigned long flags,
 	handler->flags = flags;
 	handler->devicefile = devicefile;
 	handler->name = name;
-	handler->handler = rk3568_bbu_mmc_handler;
+	handler->handler = rockchip_bbu_mmc_handler;
 
 	ret = bbu_register_handler(handler);
 	if (ret)
diff --git a/include/mach/rockchip/bbu.h b/include/mach/rockchip/bbu.h
index 2cc9b74081e4..9ae137b0e6ab 100644
--- a/include/mach/rockchip/bbu.h
+++ b/include/mach/rockchip/bbu.h
@@ -6,14 +6,16 @@
 #include <bbu.h>
 
 #ifdef CONFIG_BAREBOX_UPDATE
-int rk3568_bbu_mmc_register(const char *name, unsigned long flags,
+int rockchip_bbu_mmc_register(const char *name, unsigned long flags,
                 const char *devicefile);
 #else
-static inline int rk3568_bbu_mmc_register(const char *name, unsigned long flags,
+static inline int rockchip_bbu_mmc_register(const char *name, unsigned long flags,
                 const char *devicefile)
 {
 	return -ENOSYS;
 }
 #endif
 
+#define rk3568_bbu_mmc_register rockchip_bbu_mmc_register
+
 # endif /* __MACH_ROCKCHIP_BBU_H */
-- 
2.39.2




More information about the barebox mailing list