mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH] pbl: factor out pbl_bio API into pbl/bio.h
Date: Fri,  5 Aug 2022 10:21:37 +0200	[thread overview]
Message-ID: <20220805082137.2202560-1-a.fatoum@pengutronix.de> (raw)

We'll be adding more PBL driver interface definitions into
include/pbl, so move the block I/O stuff there as well.

No functional change.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 arch/arm/mach-at91/at91sam9_xload_mmc.c |  2 +-
 arch/arm/mach-at91/include/mach/xload.h |  2 +-
 arch/arm/mach-at91/xload-mmc.c          |  2 +-
 drivers/mci/atmel-sdhci-pbl.c           |  2 +-
 fs/fat/fat-pbl.c                        |  2 +-
 include/pbl.h                           | 13 -------------
 include/pbl/bio.h                       | 19 +++++++++++++++++++
 7 files changed, 24 insertions(+), 18 deletions(-)
 create mode 100644 include/pbl/bio.h

diff --git a/arch/arm/mach-at91/at91sam9_xload_mmc.c b/arch/arm/mach-at91/at91sam9_xload_mmc.c
index 64266757d63a..5cf41c483d0f 100644
--- a/arch/arm/mach-at91/at91sam9_xload_mmc.c
+++ b/arch/arm/mach-at91/at91sam9_xload_mmc.c
@@ -3,7 +3,7 @@
 
 #include <debug_ll.h>
 #include <common.h>
-#include <pbl.h>
+#include <pbl/bio.h>
 
 #include <linux/sizes.h>
 #include <asm/cache.h>
diff --git a/arch/arm/mach-at91/include/mach/xload.h b/arch/arm/mach-at91/include/mach/xload.h
index 82db65e30768..6b9492193b96 100644
--- a/arch/arm/mach-at91/include/mach/xload.h
+++ b/arch/arm/mach-at91/include/mach/xload.h
@@ -4,7 +4,7 @@
 #define __MACH_XLOAD_H
 
 #include <linux/compiler.h>
-#include <pbl.h>
+#include <pbl/bio.h>
 
 void __noreturn sama5d2_sdhci_start_image(u32 r4);
 void __noreturn sama5d3_atmci_start_image(u32 r4, unsigned int clock,
diff --git a/arch/arm/mach-at91/xload-mmc.c b/arch/arm/mach-at91/xload-mmc.c
index 28d122f0a357..33e5b203fe90 100644
--- a/arch/arm/mach-at91/xload-mmc.c
+++ b/arch/arm/mach-at91/xload-mmc.c
@@ -9,7 +9,7 @@
 #include <mach/gpio.h>
 #include <linux/sizes.h>
 #include <asm/cache.h>
-#include <pbl.h>
+#include <pbl/bio.h>
 
 static void at91_fat_start_image(struct pbl_bio *bio,
 				 void *buf, unsigned int len,
diff --git a/drivers/mci/atmel-sdhci-pbl.c b/drivers/mci/atmel-sdhci-pbl.c
index 626e4008fe85..2c5f107abd7e 100644
--- a/drivers/mci/atmel-sdhci-pbl.c
+++ b/drivers/mci/atmel-sdhci-pbl.c
@@ -8,7 +8,7 @@
  */
 
 #include <common.h>
-#include <pbl.h>
+#include <pbl/bio.h>
 #include <mci.h>
 #include <debug_ll.h>
 #include <mach/xload.h>
diff --git a/fs/fat/fat-pbl.c b/fs/fat/fat-pbl.c
index 93cd6decbcb0..6b8a807657d4 100644
--- a/fs/fat/fat-pbl.c
+++ b/fs/fat/fat-pbl.c
@@ -8,10 +8,10 @@
 #define pr_fmt(fmt) "fat-pbl: " fmt
 
 #include <common.h>
+#include <pbl/bio.h>
 #include "integer.h"
 #include "ff.h"
 #include "diskio.h"
-#include "pbl.h"
 
 DRESULT disk_read(FATFS *fat, BYTE *buf, DWORD sector, BYTE count)
 {
diff --git a/include/pbl.h b/include/pbl.h
index f58daec7351a..0dc23c72dcf5 100644
--- a/include/pbl.h
+++ b/include/pbl.h
@@ -15,19 +15,6 @@ void pbl_barebox_uncompress(void *dest, void *compressed_start, unsigned int len
 
 #ifdef __PBL__
 #define IN_PBL	1
-
-struct pbl_bio {
-	void *priv;
-	int (*read)(struct pbl_bio *bio, off_t block_off, void *buf, unsigned nblocks);
-};
-
-static inline int pbl_bio_read(struct pbl_bio *bio, off_t block_off,
-			       void *buf, unsigned nblocks)
-{
-	return bio->read(bio, block_off, buf, nblocks);
-}
-
-ssize_t pbl_fat_load(struct pbl_bio *, const char *filename, void *dest, size_t len);
 #else
 #define IN_PBL	0
 #endif
diff --git a/include/pbl/bio.h b/include/pbl/bio.h
new file mode 100644
index 000000000000..79e47451a0e4
--- /dev/null
+++ b/include/pbl/bio.h
@@ -0,0 +1,19 @@
+#ifndef __PBL_BIO_H__
+#define __PBL_BIO_H__
+
+#include <linux/types.h>
+
+struct pbl_bio {
+	void *priv;
+	int (*read)(struct pbl_bio *bio, off_t block_off, void *buf, unsigned nblocks);
+};
+
+static inline int pbl_bio_read(struct pbl_bio *bio, off_t block_off,
+			       void *buf, unsigned nblocks)
+{
+	return bio->read(bio, block_off, buf, nblocks);
+}
+
+ssize_t pbl_fat_load(struct pbl_bio *, const char *filename, void *dest, size_t len);
+
+#endif /* __PBL_H__ */
-- 
2.30.2




             reply	other threads:[~2022-08-05  8:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-05  8:21 Ahmad Fatoum [this message]
2022-08-08 12:45 ` Sascha Hauer

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=20220805082137.2202560-1-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --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