mtd: core: call _get_device() with the master MTD
PATCH 1/1 mtd: core: call _get_device() with the master MTD
__get_mtd_device() calls the master's _get_device() callback with mtd, which may be a partition. __put_mtd_device() passes the master.
This breaks gluebi partitions because gluebi_get_device() uses container_of() and therefore requires the master MTD. Pass the master to _get_device(), matching _put_device().
--- drivers/mtd/mtdcore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/mtdcore.c +1 -1
@@ -1333,7 +1333,7 @@ int __get_mtd_device(struct mtd_info *mtd)int err;if (master->_get_device) { - err = master->_get_device (mtd); + err = master->_get_device (master);if (err)return err; }
base-commit: 3eb40771c00a8488fa6ed2cc1fe203477908bf38
Signature · 1 line
2.53.0
Quoted 8 lines · Karl Mehltretter
__get_mtd_device()calls the master's_get_device()callback with mtd, which may be a partition.__put_mtd_device()passes the master.This breaks gluebi partitions because
gluebi_get_device()usescontainer_of()and therefore requires the master MTD. Pass the master to_get_device(), matching_put_device().[...]
Applied to mtd/fixes, thanks!
[1/1] mtd: core: call _get_device() with the master MTD
commit: 12b31d1acd20b3185bb5f0748db0cf6874c8e9d1
Patche(s) should be available on mtd/linux.git and will be part of the next PR (provided that no robot complains by then).
Kind regards,
Miquèl