From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:6f8:1178:4:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.72 #1 (Red Hat Linux)) id 1OVlXN-0000ks-BQ for barebox@lists.infradead.org; Mon, 05 Jul 2010 13:16:43 +0000 From: Sascha Hauer Date: Mon, 5 Jul 2010 15:16:32 +0200 Message-Id: <1278335795-16289-10-git-send-email-s.hauer@pengutronix.de> In-Reply-To: <1278335795-16289-1-git-send-email-s.hauer@pengutronix.de> References: <1278335795-16289-1-git-send-email-s.hauer@pengutronix.de> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: barebox-bounces@lists.infradead.org Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 09/12] include stuff missing for ubi To: barebox@lists.infradead.org Signed-off-by: Sascha Hauer --- include/linux/mtd/mtd.h | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 39ee992..01980f3 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h @@ -15,6 +15,7 @@ #include #include #include +#include #define MTD_CHAR_MAJOR 90 #define MTD_BLOCK_MAJOR 31 @@ -211,7 +212,16 @@ struct mtd_info { char *size_str; }; +static inline uint32_t mtd_div_by_eb(uint64_t sz, struct mtd_info *mtd) +{ + do_div(sz, mtd->erasesize); + return sz; +} +static inline uint32_t mtd_mod_by_eb(uint64_t sz, struct mtd_info *mtd) +{ + return do_div(sz, mtd->erasesize); +} /* Kernel-side ioctl definitions */ extern int add_mtd_device(struct mtd_info *mtd); -- 1.7.1 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox