From patchwork Wed Oct 8 15:05:29 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grant Likely X-Patchwork-Id: 3321 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 38AC1DE6BC for ; Thu, 9 Oct 2008 02:05:55 +1100 (EST) X-Original-To: linuxppc-dev@ozlabs.org Delivered-To: linuxppc-dev@ozlabs.org Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.228]) by ozlabs.org (Postfix) with ESMTP id C23B6DDE26 for ; Thu, 9 Oct 2008 02:05:37 +1100 (EST) Received: by rv-out-0506.google.com with SMTP id f6so3796084rvb.9 for ; Wed, 08 Oct 2008 08:05:36 -0700 (PDT) Received: by 10.140.126.14 with SMTP id y14mr5025825rvc.96.1223478336148; Wed, 08 Oct 2008 08:05:36 -0700 (PDT) Received: from trillian.cg.shawcable.net (S01060016b61d1226.cg.shawcable.net [68.146.22.144]) by mx.google.com with ESMTPS id k2sm40897987rvb.1.2008.10.08.08.05.33 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 08 Oct 2008 08:05:34 -0700 (PDT) Received: from localhost.localdomain (trillian [127.0.0.1]) by trillian.cg.shawcable.net (Postfix) with ESMTP id 30528C80B1; Wed, 8 Oct 2008 09:05:30 -0600 (MDT) From: Grant Likely Subject: [PATCH] of-bindings: Don't support linux, compatible values To: linuxppc-dev@ozlabs.org, devicetree-discuss@ozlabs.org Date: Wed, 08 Oct 2008 09:05:29 -0600 Message-ID: <20081008150529.21059.52235.stgit@localhost.localdomain> User-Agent: StGIT/0.14.2 MIME-Version: 1.0 X-BeenThere: linuxppc-dev@ozlabs.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org From: Grant Likely Compatible property values in the form linux, 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 --- 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 ad8ac1a..cd1ce7a 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -420,13 +420,12 @@ static struct of_modalias_table of_modalias_table[] = { * @len: Length of modalias value * * Based on the value of the compatible property, this routine will determine - * an appropriate modalias value for a particular device tree node. Three - * separate methods are used to derive a modalias value. + * an appropriate modalias value for a particular device tree node. Two + * separate methods are attempted to derive a modalias value. * * First method is to lookup the compatible value in of_modalias_table. - * Second is to look for a "linux," entry in the compatible list - * and used that for modalias. Third is to strip off the manufacturer - * prefix from the first compatible entry and use the remainder as modalias + * Second is to strip off the manufacturer prefix from the first + * compatible entry and use the remainder as modalias * * This routine returns 0 on success */ @@ -449,21 +448,7 @@ int of_modalias_node(struct device_node *node, char *modalias, int len) if (!compatible) return -ENODEV; - /* 2. search for linux, entry */ - 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 */ + /* 2. take first compatible entry and strip manufacturer */ p = strchr(compatible, ','); if (!p) return -ENODEV;