mtd_device_parse_register(9)
π mtd_device_parse_register(9) π
okay bestie, welcome to the Kernel API Manual page for mtd_device_parse_register(9) β this is the one that parses partitions and registers an MTD device, and it's lowkey a whole little pipeline. π
πΈ NAME πΈ
mtd_device_parse_register β parse partitions and register an MTD device.
β¨ SYNOPSIS β¨
int mtd_device_parse_register (struct mtd_info *mtd , const char * const
*types , struct mtd_part_parser_data *parser_data , const struct
mtd_partition *parts , int nr_parts );
π ARGUMENTS π
mtdβ the MTD device to register. main character energy, fr.typesβ the list of MTD partition probes to try, seeparser_dataβ MTD partition parser-specific datapartsβ fallback partition information to register, if parsing fails; only valid ifnr_parts > 0nr_partsβ the number of partitions inparts, if zero then the full MTD device is registered if no partition info is found
ngl,partsis the backup plan: it only does anything whennr_parts > 0, so don't sleep on that check. π«Ά
π¦ DESCRIPTION π¦
okay so this function aggregates MTD partitions parsing β it basically follows the most common pattern found in many MTD drivers:
- If the
MTD_PARTITIONED_MASTERoption is set, then the device as a whole is registered first. π - Then it tries to probe partitions on MTD device
mtdusing parsers specified intypes(iftypesisNULL, then the default list of parsers is used, seeparse_mtd_partitionsfor more information). If none are found this function tries to fallback to information specified inparts/nr_parts. π§ - If no partitions were found this function just registers the MTD device
mtdand exits. periodt. π
Returns zero in case of success and a negative error code in case of failure.
π SEE ALSO π
Kernel file ./drivers/mtd/mtdcore.c β mtd_wunit_to_pairing_info(9), mtd_pairing_info_to_wunit(9), mtd_pairing_groups(9), add_mtd_device(9), del_mtd_device(9), mtd_device_unregister(9), register_mtd_user(9), unregister_mtd_user(9), get_mtd_device(9), of_get_mtd_device_by_node(9), get_mtd_device_nm(9), mtd_ooblayout_ecc(9), mtd_ooblayout_free(9), mtd_ooblayout_find_region(9), mtd_ooblayout_find_eccregion(9), mtd_ooblayout_get_bytes(9), mtd_ooblayout_set_bytes(9), mtd_ooblayout_count_bytes(9), mtd_ooblayout_get_eccbytes(9), mtd_ooblayout_set_eccbytes(9), mtd_ooblayout_get_databytes(9), mtd_ooblayout_set_databytes(9), mtd_ooblayout_count_freebytes(9), mtd_ooblayout_count_eccbytes(9), mtd_kmalloc_up_to(9)
source/version: ./drivers/mtd Β· date: October 2026 Β· page: mtd_device_parse_register(9) β mwah, go register something cute ππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms