mtd: fix master device identification for mtd repartition
Function mtd_has_master renamed as mtd_is_partition to follow the function logic. The patch fixes the problem of checking the right mtd device for partition creation. To delete partition checking is not needed here so as it is done in mtd_del_partition. By master we consider the mtd device which does not belong to any partition. Signed-off-by: Roman Tereshonkov <roman.tereshonkov@nokia.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
This commit is contained in:

committed by
David Woodhouse

parent
e14feafbe0
commit
a7e93dcd9a
@@ -720,19 +720,19 @@ int parse_mtd_partitions(struct mtd_info *master, const char **types,
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(parse_mtd_partitions);
|
||||
|
||||
int mtd_is_master(struct mtd_info *mtd)
|
||||
int mtd_is_partition(struct mtd_info *mtd)
|
||||
{
|
||||
struct mtd_part *part;
|
||||
int nopart = 0;
|
||||
int ispart = 0;
|
||||
|
||||
mutex_lock(&mtd_partitions_mutex);
|
||||
list_for_each_entry(part, &mtd_partitions, list)
|
||||
if (&part->mtd == mtd) {
|
||||
nopart = 1;
|
||||
ispart = 1;
|
||||
break;
|
||||
}
|
||||
mutex_unlock(&mtd_partitions_mutex);
|
||||
|
||||
return nopart;
|
||||
return ispart;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mtd_is_master);
|
||||
EXPORT_SYMBOL_GPL(mtd_is_partition);
|
||||
|
Reference in New Issue
Block a user