mtd_device_parse_register(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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, see
  • parser_data β€” MTD partition parser-specific data
  • parts β€” fallback partition information to register, if parsing fails; only valid if nr_parts > 0
  • nr_parts β€” the number of partitions in parts, if zero then the full MTD device is registered if no partition info is found
ngl, parts is the backup plan: it only does anything when nr_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_MASTER option is set, then the device as a whole is registered first. πŸ‘‘
  • Then it tries to probe partitions on MTD device mtd using parsers specified in types (if types is NULL, then the default list of parsers is used, see parse_mtd_partitions for more information). If none are found this function tries to fallback to information specified in parts/nr_parts. 🧚
  • If no partitions were found this function just registers the MTD device mtd and 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