Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0c034fe3 authored by Ezequiel Garcia's avatar Ezequiel Garcia Committed by Jacek Anaszewski
Browse files

mtd: Uninline mtd_write_oob and move it to mtdcore.c



There's no reason for having mtd_write_oob inlined in mtd.h header.
Move it to mtdcore.c where it belongs.

Signed-off-by: default avatarEzequiel Garcia <ezequiel@vanguardiasur.com.ar>
Acked-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: default avatarJacek Anaszewski <j.anaszewski@samsung.com>
parent 916fe619
Loading
Loading
Loading
Loading
+12 −0
Original line number Original line Diff line number Diff line
@@ -997,6 +997,18 @@ int mtd_read_oob(struct mtd_info *mtd, loff_t from, struct mtd_oob_ops *ops)
}
}
EXPORT_SYMBOL_GPL(mtd_read_oob);
EXPORT_SYMBOL_GPL(mtd_read_oob);


int mtd_write_oob(struct mtd_info *mtd, loff_t to,
				struct mtd_oob_ops *ops)
{
	ops->retlen = ops->oobretlen = 0;
	if (!mtd->_write_oob)
		return -EOPNOTSUPP;
	if (!(mtd->flags & MTD_WRITEABLE))
		return -EROFS;
	return mtd->_write_oob(mtd, to, ops);
}
EXPORT_SYMBOL_GPL(mtd_write_oob);

/*
/*
 * Method to access the protection register area, present in some flash
 * Method to access the protection register area, present in some flash
 * devices. The user data is one time programmable but the factory data is read
 * devices. The user data is one time programmable but the factory data is read
+1 −11
Original line number Original line Diff line number Diff line
@@ -283,17 +283,7 @@ int mtd_panic_write(struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen,
		    const u_char *buf);
		    const u_char *buf);


int mtd_read_oob(struct mtd_info *mtd, loff_t from, struct mtd_oob_ops *ops);
int mtd_read_oob(struct mtd_info *mtd, loff_t from, struct mtd_oob_ops *ops);

int mtd_write_oob(struct mtd_info *mtd, loff_t to, struct mtd_oob_ops *ops);
static inline int mtd_write_oob(struct mtd_info *mtd, loff_t to,
				struct mtd_oob_ops *ops)
{
	ops->retlen = ops->oobretlen = 0;
	if (!mtd->_write_oob)
		return -EOPNOTSUPP;
	if (!(mtd->flags & MTD_WRITEABLE))
		return -EROFS;
	return mtd->_write_oob(mtd, to, ops);
}


int mtd_get_fact_prot_info(struct mtd_info *mtd, size_t len, size_t *retlen,
int mtd_get_fact_prot_info(struct mtd_info *mtd, size_t len, size_t *retlen,
			   struct otp_info *buf);
			   struct otp_info *buf);