+// SPDX-License-Identifier: GPL-2.0+
/*
* Simple MTD partitioning layer
*
* Copyright © 2002 Thomas Gleixner <gleixner@linutronix.de>
* Copyright © 2000-2010 David Woodhouse <dwmw2@infradead.org>
*
- * SPDX-License-Identifier: GPL-2.0+
- *
*/
#ifndef __UBOOT__
#include <common.h>
#include <malloc.h>
-#include <asm/errno.h>
+#include <linux/errno.h>
#include <linux/compat.h>
#include <ubi_uboot.h>
}
#endif
+static int part_block_isreserved(struct mtd_info *mtd, loff_t ofs)
+{
+ struct mtd_part *part = PART(mtd);
+ ofs += part->offset;
+ return part->master->_block_isreserved(part->master, ofs);
+}
+
static int part_block_isbad(struct mtd_info *mtd, loff_t ofs)
{
struct mtd_part *part = PART(mtd);
slave->mtd._unlock = part_unlock;
if (master->_is_locked)
slave->mtd._is_locked = part_is_locked;
+ if (master->_block_isreserved)
+ slave->mtd._block_isreserved = part_block_isreserved;
if (master->_block_isbad)
slave->mtd._block_isbad = part_block_isbad;
if (master->_block_markbad)