From patchwork Tue Nov 22 12:57:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 9441025 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 B23B5600BA for ; Tue, 22 Nov 2016 12:58:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A323828524 for ; Tue, 22 Nov 2016 12:58:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9804928528; Tue, 22 Nov 2016 12:58:11 +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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5C54328524 for ; Tue, 22 Nov 2016 12:58:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 164776E25B; Tue, 22 Nov 2016 12:58:05 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x22a.google.com (mail-wm0-x22a.google.com [IPv6:2a00:1450:400c:c09::22a]) by gabe.freedesktop.org (Postfix) with ESMTPS id 138B56E36B for ; Tue, 22 Nov 2016 12:58:00 +0000 (UTC) Received: by mail-wm0-x22a.google.com with SMTP id f82so23880556wmf.1 for ; Tue, 22 Nov 2016 04:58:00 -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=hCMsk1OQwC+9AmCj9vOIow07LnXl/Ol7bDN0S8voMGE=; b=SOoYZE1Nb2AwQLUxhnJo25ED7Jtt10H/yZPLK1x6Bg8hm7sUSOl4B4pyRij05k6QH5 UC7T923MsFm0ZvwdlV2ymCivoS/r+8i8DY0RYL2RIwLkdjPGzJCWe2E64otB5qa0MrBb ZVMC16zZncXT/dgtlzVz5N6Tgoqdb3uWkrnZT2tOlerasSkQagxCLhxLE01ojkVM4lu0 2y1OwcmRZMqVYTR8SJdDlxK1frbOB6YjQV4RlnUlTcr8owwkaW0HrdrfBqPyTjuyRqyY k4XUb2aYidlDhlzV3ULz9FyQVKrfFR9ENg0CJwv9M0Hnz06//nmz9F0xl1UaZiRD9eqi th7Q== 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=hCMsk1OQwC+9AmCj9vOIow07LnXl/Ol7bDN0S8voMGE=; b=W2hcocjJ9gKqPAYKVuDPY0PDfnVKxNScMJf+9ou7YEJboNxv7oZ0UGYb1NIUeeO4jT a74K7cRThV8fp+/BjUdLbWOKGvgPP5TKBB8PsEq0VbSplKK1l72AqE4GeGD+ByNRpIER gl5T+zo0wzhJpj6AWCRs87j1COWsFXiztji7p0G08H8F2gG8qpQKm2d0ZCQ7ypka54vo 2ZVsB8PdG/Wp73bo90hBL3GwgZiasMN3BTXDVNkRx98X/cy7C02ikLfukXNKFV/jynVe Sq91JViwykNKAt8qLhhV+QtWzvtNnfg1CVZxEE3+aUZjcz5oJ5pJv3k+x/JZFVvS4fkE 1RSQ== X-Gm-Message-State: AKaTC01oxXHfWRvI0jmVBZvxBL7EoHRTwH0Bl82xah981qwoY4Spj/ibsPxJZcZD97M3LmsA X-Received: by 10.194.85.77 with SMTP id f13mr13990375wjz.187.1479819477970; Tue, 22 Nov 2016 04:57:57 -0800 (PST) Received: from localhost.localdomain ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id t82sm2849453wmd.17.2016.11.22.04.57.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 22 Nov 2016 04:57:57 -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 2/2] memory: da8xx-ddrctl: drop the call to of_flat_dt_get_machine_name() Date: Tue, 22 Nov 2016 13:57:48 +0100 Message-Id: <1479819468-4016-3-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" 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/memory/da8xx-ddrctl.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/drivers/memory/da8xx-ddrctl.c b/drivers/memory/da8xx-ddrctl.c index a20e7bb..ee0c266 100644 --- a/drivers/memory/da8xx-ddrctl.c +++ b/drivers/memory/da8xx-ddrctl.c @@ -14,7 +14,6 @@ #include #include #include -#include #include #include @@ -71,6 +70,25 @@ static const struct da8xx_ddrctl_board_settings da8xx_ddrctl_board_confs[] = { }, }; +/* + * FIXME Remove this function once of/base gets a general routine for getting + * the machine model/compatible string. + */ +static const char *da8xx_ddrctl_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_ddrctl_config_knob * da8xx_ddrctl_match_knob(const struct da8xx_ddrctl_setting *setting) { @@ -118,7 +136,7 @@ static int da8xx_ddrctl_probe(struct platform_device *pdev) setting = da8xx_ddrctl_get_board_settings(); if (!setting) { dev_err(dev, "no settings for board '%s'\n", - of_flat_dt_get_machine_name()); + da8xx_ddrctl_machine_get_compatible()); return -EINVAL; }