diff options
author | Grant Likely <grant.likely@secretlab.ca> | 2008-10-08 01:05:29 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2008-10-10 00:55:18 -0400 |
commit | 58f467ce1476f5b2a347cee3a32275b737fbd667 (patch) | |
tree | 3a1b1329c934326686645a7a73feac4f2a0c57b3 /drivers/of | |
parent | 41c2e949cb7b80c5a6247c7df97759953b0f71b5 (diff) |
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: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'drivers/of')
-rw-r--r-- | drivers/of/base.c | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/drivers/of/base.c b/drivers/of/base.c index ad8ac1a8af28..cd1ce7ab8517 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c | |||
@@ -420,13 +420,12 @@ static struct of_modalias_table of_modalias_table[] = { | |||
420 | * @len: Length of modalias value | 420 | * @len: Length of modalias value |
421 | * | 421 | * |
422 | * Based on the value of the compatible property, this routine will determine | 422 | * Based on the value of the compatible property, this routine will determine |
423 | * an appropriate modalias value for a particular device tree node. Three | 423 | * an appropriate modalias value for a particular device tree node. Two |
424 | * separate methods are used to derive a modalias value. | 424 | * separate methods are attempted to derive a modalias value. |
425 | * | 425 | * |
426 | * First method is to lookup the compatible value in of_modalias_table. | 426 | * First method is to lookup the compatible value in of_modalias_table. |
427 | * Second is to look for a "linux,<modalias>" entry in the compatible list | 427 | * Second is to strip off the manufacturer prefix from the first |
428 | * and used that for modalias. Third is to strip off the manufacturer | 428 | * compatible entry and use the remainder as modalias |
429 | * prefix from the first compatible entry and use the remainder as modalias | ||
430 | * | 429 | * |
431 | * This routine returns 0 on success | 430 | * This routine returns 0 on success |
432 | */ | 431 | */ |
@@ -449,21 +448,7 @@ int of_modalias_node(struct device_node *node, char *modalias, int len) | |||
449 | if (!compatible) | 448 | if (!compatible) |
450 | return -ENODEV; | 449 | return -ENODEV; |
451 | 450 | ||
452 | /* 2. search for linux,<modalias> entry */ | 451 | /* 2. take first compatible entry and strip manufacturer */ |
453 | p = compatible; | ||
454 | while (cplen > 0) { | ||
455 | if (!strncmp(p, "linux,", 6)) { | ||
456 | p += 6; | ||
457 | strlcpy(modalias, p, len); | ||
458 | return 0; | ||
459 | } | ||
460 | |||
461 | i = strlen(p) + 1; | ||
462 | p += i; | ||
463 | cplen -= i; | ||
464 | } | ||
465 | |||
466 | /* 3. take first compatible entry and strip manufacturer */ | ||
467 | p = strchr(compatible, ','); | 452 | p = strchr(compatible, ','); |
468 | if (!p) | 453 | if (!p) |
469 | return -ENODEV; | 454 | return -ENODEV; |