Skip to content

Commit 29dde7c

Browse files
committed
Merge tag 'for-linus-20160415' of git://git.infradead.org/linux-mtd
Pull MTD fix from Brian Norris: "One MTD fix for v4.6-rc4: In the v4.4 cycle, we relaxed the requirement for assigning mtd->owner, but we didn't remove this error case. It's hit only by drivers that are both: (a) using nand_scan() directly and (b) built as modules We haven't seen explicit complaints about this (most use cases don't fit one or both of the above), but we should definitely not be BUG()'ing here" * tag 'for-linus-20160415' of git://git.infradead.org/linux-mtd: mtd: nand: Drop mtd.owner requirement in nand_scan
2 parents 2fffad1 + 20c07a5 commit 29dde7c

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

drivers/mtd/nand/nand_base.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4009,7 +4009,6 @@ static int nand_dt_init(struct nand_chip *chip)
40094009
* This is the first phase of the normal nand_scan() function. It reads the
40104010
* flash ID and sets up MTD fields accordingly.
40114011
*
4012-
* The mtd->owner field must be set to the module of the caller.
40134012
*/
40144013
int nand_scan_ident(struct mtd_info *mtd, int maxchips,
40154014
struct nand_flash_dev *table)
@@ -4429,19 +4428,12 @@ EXPORT_SYMBOL(nand_scan_tail);
44294428
*
44304429
* This fills out all the uninitialized function pointers with the defaults.
44314430
* The flash ID is read and the mtd/chip structures are filled with the
4432-
* appropriate values. The mtd->owner field must be set to the module of the
4433-
* caller.
4431+
* appropriate values.
44344432
*/
44354433
int nand_scan(struct mtd_info *mtd, int maxchips)
44364434
{
44374435
int ret;
44384436

4439-
/* Many callers got this wrong, so check for it for a while... */
4440-
if (!mtd->owner && caller_is_module()) {
4441-
pr_crit("%s called with NULL mtd->owner!\n", __func__);
4442-
BUG();
4443-
}
4444-
44454437
ret = nand_scan_ident(mtd, maxchips, NULL);
44464438
if (!ret)
44474439
ret = nand_scan_tail(mtd);

0 commit comments

Comments
 (0)