Re: [PATCH v9 05/10] block: partitions: of: Attach partition fwnode to the block device
From: Bartosz Golaszewski
Date: Fri Jul 31 2026 - 04:42:18 EST
On Thu, 30 Jul 2026 18:00:35 +0200, Loic Poulain
<loic.poulain@xxxxxxxxxxxxxxxx> said:
> The OF partition parser reads offset, size and label from each
> "fixed-partitions" child node but does not associate that node with the
> resulting partition block device. As a result a partition has no
> of_node, unlike the whole-disk device which gets its firmware node via
> add_disk_fwnode().
>
> Carry the partition's device tree node through the parser and attach it
> to the partition's block device with device_set_node(), mirroring the
> whole-disk case. This lets consumers describe per-partition properties
> in the device tree (for example an NVMEM layout on a partition node) and
> look them up through the partition device.
>
> No functional change for existing users, partitions without a matching
> device tree node simply get a NULL fwnode.
>
> Signed-off-by: Loic Poulain <loic.poulain@xxxxxxxxxxxxxxxx>
> ---
Makes sense.
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxxxxxxxx>