From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Fri, 05 Aug 2022 10:23:06 +0200 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1oJsbo-00CHrv-Kh for lore@lore.pengutronix.de; Fri, 05 Aug 2022 10:23:06 +0200 Received: from bombadil.infradead.org ([2607:7c80:54:3::133]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oJsbp-0004LT-9O for lore@pengutronix.de; Fri, 05 Aug 2022 10:23:06 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=+mjpdR7jP2wttB8CMSfTJukLMtadRDYe6IziZ2ZtCAs=; b=W/J6PUCnwnCuLpmOOYDoVXMWop IgU78uK5D4CjGFYLXpBFJBDm+CiocRmZtcdpgQWnDO0n1TcgncJjL//S4Ig+3zaKgMpt1JG2INgIS 60XYD005dmPBAqn0QpC+tmRF8h8SIuV9NbcvCrNYOES/v5dyqqRGZFw6w4yvLMfKHkb5kU3zHn8WL fsaqAoB2bLAcqtNrgnuiJ5Wycc+W4UvFYVlkI4ezpg+4IHHGpYYjwaELhwaDiMKmqc41NkROqtj16 kNQsJLXqIrJC7QKh964BV43jzm6XOpHmgh6WBXHtPFGPkMqLwoUX5sZM/8j5KRhzrR4aU9g7bC7a6 RFA3m1aA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oJsaZ-00D7wo-8N; Fri, 05 Aug 2022 08:21:47 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oJsaT-00D7vV-Sz for barebox@lists.infradead.org; Fri, 05 Aug 2022 08:21:43 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oJsaS-0004FS-14; Fri, 05 Aug 2022 10:21:40 +0200 Received: from [2a0a:edc0:0:1101:1d::ac] (helo=dude04.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1oJsaP-001rDc-1j; Fri, 05 Aug 2022 10:21:39 +0200 Received: from afa by dude04.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1oJsaQ-009FWV-KN; Fri, 05 Aug 2022 10:21:38 +0200 From: Ahmad Fatoum To: barebox@lists.infradead.org Cc: Ahmad Fatoum Date: Fri, 5 Aug 2022 10:21:37 +0200 Message-Id: <20220805082137.2202560-1-a.fatoum@pengutronix.de> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220805_012141_972250_4F949606 X-CRM114-Status: GOOD ( 15.21 ) X-BeenThere: barebox@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "barebox" X-SA-Exim-Connect-IP: 2607:7c80:54:3::133 X-SA-Exim-Mail-From: barebox-bounces+lore=pengutronix.de@lists.infradead.org X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on metis.ext.pengutronix.de X-Spam-Level: X-Spam-Status: No, score=-4.0 required=4.0 tests=AWL,BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Subject: [PATCH] pbl: factor out pbl_bio API into pbl/bio.h X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on metis.ext.pengutronix.de) 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 --- 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 #include -#include +#include #include #include 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 -#include +#include 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 #include #include -#include +#include 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 -#include +#include #include #include #include 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 +#include #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 + +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