void set_primary_fwnode(struct device *dev, struct fwnode_handle *fwnode)
{
	struct fwnode_handle *fn = dev->fwnode;

	if (fwnode) {
		if (fwnode_is_primary(fn))
			fn = fn->secondary;

		if (fn) {
			WARN_ON(fwnode->secondary);
			fwnode->secondary = fn;
		}
		dev->fwnode = fwnode;
	} else {
		if (fwnode_is_primary(fn)) {
			dev->fwnode = fn->secondary;
			fn->secondary = NULL;
		} else {
			dev->fwnode = NULL;
		}
	}
}
void set_primary_fwnode(struct device *dev, struct fwnode_handle *fwnode)
{
	struct fwnode_handle *fn = dev->fwnode;

	if (fwnode) {
		if (fwnode_is_primary(fn))
			fn = fn->secondary;

		if (fn) {
			WARN_ON(fwnode->secondary);
			fwnode->secondary = fn;
		}
		dev->fwnode = fwnode;
	} else {
		if (fwnode_is_primary(fn)) {
			dev->fwnode = fn->secondary;
			fn->secondary = NULL;
		} else {
			dev->fwnode = NULL;
		}
	}
}