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

Commit 58f467ce authored by Grant Likely's avatar Grant Likely Committed by Benjamin Herrenschmidt
Browse files

powerpc/of-bindings: Don't support linux,<modalias> "compatible" values



Compatible property values in the form linux,<modalias> is not documented
anywhere and using it leaks Linux implementation details into the device
tree data (which is bad).  Remove support for compatible values of this
form.

If any platforms exist which depended on this code (and I don't know of
any), then they can be fixed up by adding legacy translations to the
lookup table in this file.

Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent 41c2e949
Loading
Loading
Loading
Loading
+5 −20
Original line number Original line Diff line number Diff line
@@ -420,13 +420,12 @@ static struct of_modalias_table of_modalias_table[] = {
 * @len:	Length of modalias value
 * @len:	Length of modalias value
 *
 *
 * Based on the value of the compatible property, this routine will determine
 * Based on the value of the compatible property, this routine will determine
 * an appropriate modalias value for a particular device tree node.  Three
 * an appropriate modalias value for a particular device tree node.  Two
 * separate methods are used to derive a modalias value.
 * separate methods are attempted to derive a modalias value.
 *
 *
 * First method is to lookup the compatible value in of_modalias_table.
 * First method is to lookup the compatible value in of_modalias_table.
 * Second is to look for a "linux,<modalias>" entry in the compatible list
 * Second is to strip off the manufacturer prefix from the first
 * and used that for modalias.  Third is to strip off the manufacturer
 * compatible entry and use the remainder as modalias
 * prefix from the first compatible entry and use the remainder as modalias
 *
 *
 * This routine returns 0 on success
 * This routine returns 0 on success
 */
 */
@@ -449,21 +448,7 @@ int of_modalias_node(struct device_node *node, char *modalias, int len)
	if (!compatible)
	if (!compatible)
		return -ENODEV;
		return -ENODEV;


	/* 2. search for linux,<modalias> entry */
	/* 2. take first compatible entry and strip manufacturer */
	p = compatible;
	while (cplen > 0) {
		if (!strncmp(p, "linux,", 6)) {
			p += 6;
			strlcpy(modalias, p, len);
			return 0;
		}

		i = strlen(p) + 1;
		p += i;
		cplen -= i;
	}

	/* 3. take first compatible entry and strip manufacturer */
	p = strchr(compatible, ',');
	p = strchr(compatible, ',');
	if (!p)
	if (!p)
		return -ENODEV;
		return -ENODEV;