Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1f43cfb9 authored by Grant Likely's avatar Grant Likely
Browse files

of: merge machine_is_compatible()



Merge common code between PowerPC and Microblaze

Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
Tested-by: default avatarWolfram Sang <w.sang@pengutronix.de>
Acked-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent 86e03221
Loading
Loading
Loading
Loading
+0 −18
Original line number Diff line number Diff line
@@ -318,24 +318,6 @@ void __init early_init_devtree(void *params)
	pr_debug(" <- early_init_devtree()\n");
}

/**
 * Indicates whether the root node has a given value in its
 * compatible property.
 */
int machine_is_compatible(const char *compat)
{
	struct device_node *root;
	int rc = 0;

	root = of_find_node_by_path("/");
	if (root) {
		rc = of_device_is_compatible(root, compat);
		of_node_put(root);
	}
	return rc;
}
EXPORT_SYMBOL(machine_is_compatible);

/*******
 *
 * New implementation of the OF "find" APIs, return a refcounted
+0 −19
Original line number Diff line number Diff line
@@ -754,25 +754,6 @@ void __init early_init_devtree(void *params)
	DBG(" <- early_init_devtree()\n");
}


/**
 * Indicates whether the root node has a given value in its
 * compatible property.
 */
int machine_is_compatible(const char *compat)
{
	struct device_node *root;
	int rc = 0;

	root = of_find_node_by_path("/");
	if (root) {
		rc = of_device_is_compatible(root, compat);
		of_node_put(root);
	}
	return rc;
}
EXPORT_SYMBOL(machine_is_compatible);

/*******
 *
 * New implementation of the OF "find" APIs, return a refcounted
+21 −0
Original line number Diff line number Diff line
@@ -143,6 +143,27 @@ int of_device_is_compatible(const struct device_node *device,
}
EXPORT_SYMBOL(of_device_is_compatible);

/**
 * machine_is_compatible - Test root of device tree for a given compatible value
 * @compat: compatible string to look for in root node's compatible property.
 *
 * Returns true if the root node has the given value in its
 * compatible property.
 */
int machine_is_compatible(const char *compat)
{
	struct device_node *root;
	int rc = 0;

	root = of_find_node_by_path("/");
	if (root) {
		rc = of_device_is_compatible(root, compat);
		of_node_put(root);
	}
	return rc;
}
EXPORT_SYMBOL(machine_is_compatible);

/**
 *  of_device_is_available - check if a device is available for use
 *