From patchwork Wed Nov 23 11:06:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 83635 Delivered-To: patch@linaro.org Received: by 10.140.97.165 with SMTP id m34csp2573985qge; Wed, 23 Nov 2016 03:07:15 -0800 (PST) X-Received: by 10.84.149.139 with SMTP id m11mr5521490pla.38.1479899235915; Wed, 23 Nov 2016 03:07:15 -0800 (PST) Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id h63si21894147pgc.109.2016.11.23.03.07.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Nov 2016 03:07:15 -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 D91796E6F0; Wed, 23 Nov 2016 11:06:42 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x233.google.com (mail-wm0-x233.google.com [IPv6:2a00:1450:400c:c09::233]) by gabe.freedesktop.org (Postfix) with ESMTPS id 77C626E6F0 for ; Wed, 23 Nov 2016 11:06:36 +0000 (UTC) Received: by mail-wm0-x233.google.com with SMTP id t79so18494086wmt.0 for ; Wed, 23 Nov 2016 03:06:36 -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=DJnI91BYAKiMeFNhL6tNgZQuHBFKfWBs7LIQ98mwxuM=; b=Ei5pkneLJzNLQaGGKNpYF+bmqNXUqiwqEODFK0QIvsi7VLtsBUnB7njo5Y3t3Sbyml CXS5Xgvv6/u032RGETwDU5M45IGbBE4OAljRa9p4ZZYKHB9rV0ptQNU0LOTM599qUZav DU3alW4iXGaimG71E32Qc5evdrD6QMQkAU2kzmcBZnbUfDyQtdlP7FzoU2InKdPSvfGC jU382IwBTSkU1LPirwnewuuqgQCyJHs8PFsR0ZttrSyMsKLDgsFQimlWVH5aahvA3S0D lpfkYtz20TnS2Ns3PYvcLTU8dixeFfRZJA2OJJi99Zj9uBQakTGZ67Z0E8xp9xE7skXR Alyg== 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=DJnI91BYAKiMeFNhL6tNgZQuHBFKfWBs7LIQ98mwxuM=; b=YHe4Xg10Xstb27bRyYyb4MbbLRQOSME2gQGU8apiXbzKgLkrPkp+V3aFrLGQPQcv8A fuoNOIn0GgthfejX/yS7Sv9HWrQcKVr+bIzFfANyMZ7ePVe0LFxPXme1QZlI79piMqcc 8D+bLWayRTmLEJZH3obEuG0u0euTIvr4SHTRsjk9n1x1aw5/mfJ4NW1Idl0tzpyba0CQ 6OI54jXMA9mE0UFSJLPXWjunkHiRyarMqDTNqywq+yg3zRZL0jE773a7m1sd92ZNri9m E25z6k0eEg1ZHDqzRs5fS1VU37aiyGtawFrIz0HxfCQmtz9dRtU7V5o1bTakV/AUDv7U 1oKA== X-Gm-Message-State: AKaTC01YnHxPyK4UyNkKLsU7w3kjPM1rxkn74xJ9vXx0rSx73Safz9lGo1oDxhlE5T/kXZEv X-Received: by 10.194.14.105 with SMTP id o9mr2727309wjc.66.1479899194946; Wed, 23 Nov 2016 03:06:34 -0800 (PST) Received: from localhost.localdomain ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id f10sm35746800wjl.28.2016.11.23.03.06.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 23 Nov 2016 03:06:34 -0800 (PST) From: Bartosz Golaszewski To: Kevin Hilman , Michael Turquette , Sekhar Nori , Rob Herring , Frank Rowand , Mark Rutland , Peter Ujfalusi , Russell King Subject: [PATCH v3 1/3] bus: da8xx-mstpri: drop the call to of_flat_dt_get_machine_name() Date: Wed, 23 Nov 2016 12:06:25 +0100 Message-Id: <1479899187-10199-2-git-send-email-bgolaszewski@baylibre.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1479899187-10199-1-git-send-email-bgolaszewski@baylibre.com> References: <1479899187-10199-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 | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/drivers/bus/da8xx-mstpri.c b/drivers/bus/da8xx-mstpri.c index 85f0b53..064eeb9 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,26 @@ 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_index(root, "compatible", + 0, &compatible); + of_node_put(root); + } + + return ret ? NULL : compatible; +} + static const struct da8xx_mstpri_board_priorities * da8xx_mstpri_get_board_prio(void) { @@ -227,7 +246,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; }