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: 9442981 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 68F8A6075F for ; Wed, 23 Nov 2016 11:08:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6ABF2203B9 for ; Wed, 23 Nov 2016 11:08:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5F2A72236A; Wed, 23 Nov 2016 11:08:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id ECF1E203B9 for ; Wed, 23 Nov 2016 11:08:51 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1c9VOX-0003jn-AP; Wed, 23 Nov 2016 11:07:17 +0000 Received: from mail-wm0-x231.google.com ([2a00:1450:400c:c09::231]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1c9VOD-0003Oj-0q for linux-arm-kernel@lists.infradead.org; Wed, 23 Nov 2016 11:06:57 +0000 Received: by mail-wm0-x231.google.com with SMTP id a197so72777438wmd.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=Q2RMp+9sqWQLK8fCHkG/lRN2y+w0dlZd5LMNAQYH5BXrHHm5gmBrqz1eTJzo++Yum3 5uFGp2DKvWp+OZ9Sdv8hnHnvXnVnEKwaqmk+9cV1IhqOyRYj9SsNVHermKU9OvP/qvSn XM9LpQKraUBOoXTzNb6DmJUGNvYHbm4/asXuyKDIPF7AA8M8ISscCulFg4OQ4t4LwN9Z 5ahKaC1j6iZsD+DwpxIAN1hpJSkLUYtXhMyI0gCnDru4xX+btQgtFv4F+TW7+EXzajVu tCvaGDHfmRqOtIYFWv4jEcTbg7vwgV6omh6Ey7Fp5PRIgRG/1TqL3CuPABknXZlSesPE e8Lw== X-Gm-Message-State: AKaTC02RCC2B3wWseVn3DGwKjQSE1u9Lz92s5X7A93/A8qlAPpGhIeY0Gk3MIwmp1SypQqS2 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161123_030657_311929_FC1FA187 X-CRM114-Status: GOOD ( 15.49 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-devicetree , David Airlie , LKML , linux-drm , Bartosz Golaszewski , Tomi Valkeinen , Jyri Sarha , Sudeep Holla , Robin Murphy , arm-soc , Laurent Pinchart MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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; }