From patchwork Tue Nov 22 12:57:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 83398 Delivered-To: patch@linaro.org Received: by 10.182.1.168 with SMTP id 8csp2122436obn; Tue, 22 Nov 2016 04:58:07 -0800 (PST) X-Received: by 10.99.246.83 with SMTP id u19mr4101724pgj.165.1479819487303; Tue, 22 Nov 2016 04:58:07 -0800 (PST) Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id 4si28375177pfq.257.2016.11.22.04.58.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Nov 2016 04:58:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@baylibre-com.20150623.gappssmtp.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CE5866E331; Tue, 22 Nov 2016 12:58:04 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wj0-x22b.google.com (mail-wj0-x22b.google.com [IPv6:2a00:1450:400c:c01::22b]) by gabe.freedesktop.org (Postfix) with ESMTPS id 617386E36B for ; Tue, 22 Nov 2016 12:57:58 +0000 (UTC) Received: by mail-wj0-x22b.google.com with SMTP id qp4so42009836wjc.3 for ; Tue, 22 Nov 2016 04:57:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=tGZJQsvqtXe1cQThuWiqMzAj8yqldHT3Uccql3rnEAU=; b=zulWu9t8gBeQPk78ipZNU08lIGqAUX4I4B4BTb2aBqWy80Ss04s59peWImWzQaN1G6 bahZmgRmQPnsaYOlFI5tB+KdNULe5YEW4zQva/4WopzgM055uhpQkDsTYeKiw9J4Kw2I /N+PUXnLRBQEy2rs/mrrDKiAzbivg7wwlY3K2dY3mJuDHjHeDzOMJ4joE2HfbQ9icQdl hiohV+Qi14yTbYzRdn4/4FYXe+bN8tVNpjISObjOCsYN270PFa3kEHB4oaFnOBW4vWkV CjvvbQTYqCQrmVGvtmOhAP2ZIcoIyaHvuskHWkc/ky3dh4AZogNSbEK5Zv/+NvpuL3df GrSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=tGZJQsvqtXe1cQThuWiqMzAj8yqldHT3Uccql3rnEAU=; b=Ro+teZ+hnLB+02FImNz8vO+7+LT0jdIVTO9GJccF93CWuJwBKw5VknGI6ytqh3JZSx D5s0NTInoQLcD+EQF9wOQTDNSr2ZTGoVwlvKORGc8e13o9mp8J00hSbH0Hmg2WIrWBqU DmI5Ah1Pb0pLCp6xRFKdLWQMWV8shWc+eTjKSoIHh9CmxT30OjfOo4O1PWwDav/QhY4R Md8Xg7Ee5NjwHOJE1sHe9XZnxrvzf8ZT98MZa2CL9ao1vSXb/cMSr24E60jpidlUpxNz nzwNmVW8wDA9euC92DugiJYwbkU+A3if20xk37VUae3bY2ZcynUvLbt4ZWgjak+MO9Qo HH3w== X-Gm-Message-State: AKaTC01JlGbCDjvumVVezDa0OWN184nhnF8YrCgo+QteiOdk8BqO43c6S8H+LPzqFoHKDmce X-Received: by 10.194.145.197 with SMTP id sw5mr13989376wjb.156.1479819476818; Tue, 22 Nov 2016 04:57:56 -0800 (PST) Received: from localhost.localdomain ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id t82sm2849453wmd.17.2016.11.22.04.57.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 22 Nov 2016 04:57:56 -0800 (PST) From: Bartosz Golaszewski To: Kevin Hilman , Michael Turquette , Sekhar Nori , Rob Herring , Frank Rowand , Mark Rutland , Peter Ujfalusi , Russell King Subject: [PATCH v2 1/2] bus: da8xx-mstpri: drop the call to of_flat_dt_get_machine_name() Date: Tue, 22 Nov 2016 13:57:47 +0100 Message-Id: <1479819468-4016-2-git-send-email-bgolaszewski@baylibre.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1479819468-4016-1-git-send-email-bgolaszewski@baylibre.com> References: <1479819468-4016-1-git-send-email-bgolaszewski@baylibre.com> Cc: linux-devicetree , LKML , linux-drm , Bartosz Golaszewski , Tomi Valkeinen , Jyri Sarha , Sudeep Holla , Robin Murphy , arm-soc , Laurent Pinchart X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" In order to avoid a section mismatch use a locally implemented routine instead of of_flat_dt_get_machine_name() when printing the error message. Signed-off-by: Bartosz Golaszewski --- drivers/bus/da8xx-mstpri.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/drivers/bus/da8xx-mstpri.c b/drivers/bus/da8xx-mstpri.c index 85f0b53..bd38170 100644 --- a/drivers/bus/da8xx-mstpri.c +++ b/drivers/bus/da8xx-mstpri.c @@ -16,7 +16,6 @@ #include #include #include -#include /* * REVISIT: Linux doesn't have a good framework for the kind of performance @@ -190,6 +189,25 @@ static const struct da8xx_mstpri_board_priorities da8xx_mstpri_board_confs[] = { }, }; +/* + * FIXME Remove this function once of/base gets a general routine for getting + * the machine model/compatible string. + */ +static const char *da8xx_mstpri_machine_get_compatible(void) +{ + struct device_node *root; + const char *compatible; + int ret = -1; + + root = of_find_node_by_path("/"); + if (root) { + ret = of_property_read_string(root, "compatible", &compatible); + of_node_put(root); + } + + return ret ? NULL : compatible; +} + static const struct da8xx_mstpri_board_priorities * da8xx_mstpri_get_board_prio(void) { @@ -227,7 +245,7 @@ static int da8xx_mstpri_probe(struct platform_device *pdev) prio_list = da8xx_mstpri_get_board_prio(); if (!prio_list) { dev_err(dev, "no master priotities defined for board '%s'\n", - of_flat_dt_get_machine_name()); + da8xx_mstpri_machine_get_compatible()); return -EINVAL; }