[no subject]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> int add_mtd_device(struct mtd_info *mtd)
> {
> 	struct device_node *np = mtd_get_of_node(mtd);
> 	struct mtd_info *master = mtd_get_master(mtd);
> 	struct mtd_notifier *not;
> +	bool partitioned = true;
> 	int i, error, ofidx;
> 
> 	/*
> @@ -655,6 +678,11 @@ int add_mtd_device(struct mtd_info *mtd)
> 	if (WARN_ONCE(mtd->dev.type, "MTD already registered\n"))
> 		return -EEXIST;
> 
> +	if ((master == mtd) && !IS_ENABLED(CONFIG_MTD_PARTITIONED_MASTER)) {
> +		partitioned = false;
> +		pr_debug("mtd: unpartitioned master %s\n", mtd->name);
> +	}

So, when CONFIG_MTD_PARTITIONED_MASTER is not set and a driver like MTDRAM
does mtd_device_register(mtd, NULL, 0) we end up here with partitioned = false,
and allocate just a master device but no real mtd because with zero
parts the mtd_device_parse_register() function will not call add_mtd_device(). :-(

Thanks,
//richard




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux