From patchwork Mon Nov 12 12:25:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 150824 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp3081213ljp; Mon, 12 Nov 2018 04:27:36 -0800 (PST) X-Google-Smtp-Source: AJdET5d6RJKCLg+N9277p6mlUgytJcE2ZSz76udGJdrjNlVde1KgQu6zAJ4OWH0iChFLkOe6ijmS X-Received: by 2002:a63:8441:: with SMTP id k62mr650171pgd.392.1542025656318; Mon, 12 Nov 2018 04:27:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542025656; cv=none; d=google.com; s=arc-20160816; b=XLj38OD6LJngt3D5m0OEpckeJsTujw2mnkKglyqtqND/DprueaiY8I1NTU4YsDzzHe K35o27FAI2zMtG8XpYs9laA7zgvaqo1J3Lx87WhHDX8t/QVONKGzqDw4/U8ucWExhbPk rFeAUV0WUUEEKrq+ViNXKpJ6jihlcBsEWmoPpqs6AG0gt6uSSkDS7x9dZIlah9s/w3ho P122+d57NRuNU6IPuWFy0TTzig2S1t6eAa7w7JMcS9vDcW/SLUnnhzv7uOItEr1AxvUw qM/IrCVxMApfZ5Wf1Shi3Q1nHHK/VXpQZDzgBEi4WvhhSmgVQYZaCSNm2pYIEfhZChuO cIwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ODYGFMdaycbKq0Th7g4PJEwwAYXx0ZmPhdkLx8Ug4NM=; b=rSuArIDTzoaENF49W/cylRjOtc68fHD8xVN7vsLrSL0LlRHVvqPOxLK7JRZDjFuaWu Mg+UCafW1+/sFZQMipp2EXLCJA7KtFUIdNwXUquJgVuVUWRYQjyaqrw68175potpqul1 b1g0otyboX2l9LnOSnJqT8Br96Y6NmpoGi62bBy08GghQiUOyYz+bDDl50FWxS8lIV0R ttbwbbz4v2iu7arK89UWDT49UyDyHd3JyNFx2bseb8ylzVRy1sFfctq2lc+kI3+wDgZh NBagQ1Mbuh/CkmCeIVT8myxZPkbHdSJUP2liUr1b3IW96mI+BHrPOAAVXxLd7KSDSc+O sSJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iCb1S1vp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b7-v6si16561267pgn.553.2018.11.12.04.27.35; Mon, 12 Nov 2018 04:27:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iCb1S1vp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729552AbeKLWUg (ORCPT + 32 others); Mon, 12 Nov 2018 17:20:36 -0500 Received: from mail-ed1-f68.google.com ([209.85.208.68]:39961 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729246AbeKLWUg (ORCPT ); Mon, 12 Nov 2018 17:20:36 -0500 Received: by mail-ed1-f68.google.com with SMTP id d3so6622211edx.7 for ; Mon, 12 Nov 2018 04:27:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ODYGFMdaycbKq0Th7g4PJEwwAYXx0ZmPhdkLx8Ug4NM=; b=iCb1S1vpH3DX0wnOqjR5CJ/8DFkbsdrzt1AWnyffajjseN2SMITZouYiSNVAHWwrlK dmoynyr1dyy2YRG1moxZAVAMbxvrcDauOhMGj7snCjo8w1AjYZI3eIxDDxZE5RPxttVn pX5aaTYAAbvZGDsMmKJ7yy5Vi4DPKY+eMGYvo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ODYGFMdaycbKq0Th7g4PJEwwAYXx0ZmPhdkLx8Ug4NM=; b=LNTcU8/s4jNw+pOa2KN9zfJj8Hx6IEuDk/67h4iWUuX6z/vWQJnHfuzffqz0kVEWTW NeRXxUqK8irvvXrY8adOJLKrVS51WUzLHTtKKz4QczOjYdDrwKaDj2hDhXk8N8HDGfiG H7ugevhEHvhRGrxxH2vk3zDVQnEZ5A5EcIIUfHS7bSdtApChbfsDKNfHuqxFCoK10S7+ edmQv1Sz3aGj6nMPMlrw1AlFKQYaD7yq2VFODqViueuEZMqhdEV9hIGjSHDX/s86/wJJ Tqd1E67XOwAPPgLSYsMcVMZ8yXdQovUf+Z7w/+YQ/oiyug0g4RsVR3LPBzIyf0CoMeFU bEMg== X-Gm-Message-State: AGRZ1gLVdSxKfpKbmVewl+/MaTfYpuY/8XXuuW+slXrT7lAVBM30At9q 7km/4VSBJg52NYHcUZtm/k7BZjmckPA= X-Received: by 2002:a17:906:74d7:: with SMTP id z23-v6mr9490417ejl.234.1542025651047; Mon, 12 Nov 2018 04:27:31 -0800 (PST) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id f11-v6sm4358545eds.23.2018.11.12.04.27.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 12 Nov 2018 04:27:30 -0800 (PST) From: Srinivas Kandagatla To: gregkh@linuxfoundation.org Cc: niklas.cassel@linaro.org, linux-kernel@vger.kernel.org, Srinivas Kandagatla Subject: [PATCH 1/2] slimbus: ngd: Fix build error on x86 Date: Mon, 12 Nov 2018 12:25:25 +0000 Message-Id: <20181112122526.10337-2-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181112122526.10337-1-srinivas.kandagatla@linaro.org> References: <20181112122526.10337-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org on non DT platforms like x86 of_match_node is set to NULL, dereferencing directly would throw an error. Fix this by doing this in two steps, get the match then the data. Reported-by: Greg KH Signed-off-by: Srinivas Kandagatla --- drivers/slimbus/qcom-ngd-ctrl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 2.19.1 diff --git a/drivers/slimbus/qcom-ngd-ctrl.c b/drivers/slimbus/qcom-ngd-ctrl.c index 7218fb963d0a..7de8907723a2 100644 --- a/drivers/slimbus/qcom-ngd-ctrl.c +++ b/drivers/slimbus/qcom-ngd-ctrl.c @@ -1330,11 +1330,12 @@ static int of_qcom_slim_ngd_register(struct device *parent, { const struct ngd_reg_offset_data *data; struct qcom_slim_ngd *ngd; + const struct of_device_id *match; struct device_node *node; u32 id; - data = of_match_node(qcom_slim_ngd_dt_match, parent->of_node)->data; - + match = of_match_node(qcom_slim_ngd_dt_match, parent->of_node); + data = match->data; for_each_available_child_of_node(parent->of_node, node) { if (of_property_read_u32(node, "reg", &id)) continue;