Re: [PATCH v3] of: property: Increase NR_FWNODE_REFERENCE_ARGS

From: Zijun Hu
Date: Tue Feb 11 2025 - 09:58:05 EST


On 2025/2/11 22:22, Rob Herring wrote:
>> i have confirmed that:
>>
>> of.h includes fwnode.h indirectly
>> fwnode.h does not include of.h directly or indirectly
> Only for struct fwnode_handle. I don't think we want to add to that.
> For the most part, fwnode is a layer above DT and the DT code should
> know nothing about fwnode.

DT, as a type of firmware node, needs to implement firmware node
interfaces 'struct fwnode_operations' defined in fwnode.h.

so it includes fwnode.h and knows everything of fwnode.h

A)
diff --git a/include/linux/of.h b/include/linux/of.h
#define MAX_PHANDLE_ARGS 16
struct of_phandle_args {
struct device_node *np;
int args_count;
uint32_t args[MAX_PHANDLE_ARGS];
};
+static_assert(NR_FWNODE_REFERENCE_ARGS == MAX_PHANDLE_ARGS);

B)
diff --git a/include/linux/of.h b/include/linux/of.h
-#define MAX_PHANDLE_ARGS 16
+#define MAX_PHANDLE_ARGS NR_FWNODE_REFERENCE_ARGS

you like solution A), right ?