Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp694507imu; Fri, 7 Dec 2018 07:32:11 -0800 (PST) X-Google-Smtp-Source: AFSGD/V0K3V0JH8Sbcza4t3UjaGaIaguOsKBKnaFNRHlSTV8n8VXTop0NdRRqi0simoMq+d1KK2s X-Received: by 2002:a17:902:201:: with SMTP id 1mr2536788plc.62.1544196731155; Fri, 07 Dec 2018 07:32:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544196731; cv=none; d=google.com; s=arc-20160816; b=lOrXkIYeYwMwOTNRLHi/Npdl8qhfwnAe/xHvvMQb4NPE9tcRy0L7YtjpUfuxvozU0+ reD9hVxlRCPucb5IqXuGoJ5SgCD/cna8TBY9UN+ZfgMRYB2J3Np9WLuBxPtxKkzQWyYe GTLULhvE4PvoKiBt+tCeYv1dob3DY7nZQWUDzjFh1RNoCn0POMI4eMDukS+I73w7tIFO wOv3Ui0MoXEshaoe0gIvJzk2gn9640ehBnCarz8XxUXxv2p/evwsIZyAZXRq6QqqQvCu x5ffZVMiP1aaCQZXAnEjG0CiTsE8JSYHshOzkntbOnidVpcEshUxW6TydxvQePDDaqlG K1xg== 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=+ohTwMnZy4lusdqO/qZ5ifBi8bTC/XiQ4YpI1jCqo4E=; b=FUkcoe8tBUui/OknQeesxu2LpHwiIh/NWenzhPGLHvaZ/0BCN+jrpxNkNu0bYSNX1W 9pwQdEu1WikmCbUarK7goBggTzlCklvhqee3f3bcTvEdkthKOS/hl4om/2zMC/vSdIfm NAv3upkCD0OrLHCf3YraVXztdQ5LI92h/C9Txz7XkKaKxLNx4B0HQ8DKxLg0bg24ppH3 aKyujzxftpXDx2bNUfJ79kTz66O5zZGdM5BSISXp34HSmtucyz31SSyGBK0vwGxNGDq2 0bzR+OyJaNMU44yaMvdY6pJNM1QxPdC4JbPDr8SZyaqKhootINuOqkKyHhRTXCrR8rLc NcPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ti8BCZpI; 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 k13si3125720pgb.343.2018.12.07.07.31.55; Fri, 07 Dec 2018 07:32:11 -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=Ti8BCZpI; 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 S1726289AbeLGP3q (ORCPT + 99 others); Fri, 7 Dec 2018 10:29:46 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:53973 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726249AbeLGP3j (ORCPT ); Fri, 7 Dec 2018 10:29:39 -0500 Received: by mail-wm1-f66.google.com with SMTP id y1so4733298wmi.3 for ; Fri, 07 Dec 2018 07:29:38 -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=+ohTwMnZy4lusdqO/qZ5ifBi8bTC/XiQ4YpI1jCqo4E=; b=Ti8BCZpI3o379zFrcx0Ni+pB5jemeDk8VYy5fO9mePABbce0R5TGmri39QUTmKPtqv pzbeZy8SoPOY6JLz1AVY0tFkiuBrd1eZQeJAzuH/7dzGMKXPhZYJ+wJ5P7wIgTbvJHPC ReCKjOn1vyhC1RY5puQaJgs4l3qQlfQn3vucM= 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=+ohTwMnZy4lusdqO/qZ5ifBi8bTC/XiQ4YpI1jCqo4E=; b=leaOf3yLpXk8i6MICeYvsa+GBR1Ue8gPWV4EymChs5uqaejoKI15aL1okmhhFYxj7E nZEeNQrXbxBxfrSAjY2ixBFMW23X7De8JO6ZTPPHTfGDhhwvN3rt70mvifikUUHUwP25 jgLTJfiXoNhcQ3BS3PExmlmpSWqb6du1Erferzw2175dgEAJQ6G0kN206JXUX/Wcnrs/ XaoO1A91QP8ahn4HSlmAJ+qmrPCLaYy4GfKPXiIWgU64i/FyHWWNhOUZAX7Rk2vwSAPV da2NE5ck2c65Xp4ihe6OnPoZTHx+utH8lrked8jLXccOLmZX4U5oAy54fLSrzCS5wN51 JL4w== X-Gm-Message-State: AA+aEWac83NE9+QuQhuOjyhvbdkstJlDz5Rn+mFyszu6E4ZQvNJcRR+C yA7eGsU+XPp5H+/V+M4oh/g2LQ== X-Received: by 2002:a1c:9855:: with SMTP id a82mr2471256wme.20.1544196577721; Fri, 07 Dec 2018 07:29:37 -0800 (PST) Received: from localhost.localdomain ([212.45.67.2]) by smtp.googlemail.com with ESMTPSA id y145sm2728721wmd.30.2018.12.07.07.29.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 07 Dec 2018 07:29:36 -0800 (PST) From: Georgi Djakov To: gregkh@linuxfoundation.org, linux-pm@vger.kernel.org Cc: rjw@rjwysocki.net, robh+dt@kernel.org, mturquette@baylibre.com, khilman@baylibre.com, vincent.guittot@linaro.org, skannan@codeaurora.org, bjorn.andersson@linaro.org, amit.kucheria@linaro.org, seansw@qti.qualcomm.com, daidavid1@codeaurora.org, evgreen@chromium.org, dianders@chromium.org, mark.rutland@arm.com, lorenzo.pieralisi@arm.com, abailon@baylibre.com, maxime.ripard@bootlin.com, arnd@arndb.de, thierry.reding@gmail.com, ksitaraman@nvidia.com, sanjayc@nvidia.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-tegra@vger.kernel.org, georgi.djakov@linaro.org Subject: [PATCH v11 8/8] interconnect: sdm845: Fix build failure after cmd_db API change Date: Fri, 7 Dec 2018 17:29:17 +0200 Message-Id: <20181207152917.4862-9-georgi.djakov@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181207152917.4862-1-georgi.djakov@linaro.org> References: <20181207152917.4862-1-georgi.djakov@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Recently the cmd_db_read_aux_data() function was changed to avoid using memcpy and return a pointer instead. Update the code to the new API and fix the build failure. Fixes: ed3cafa79ea7 ("soc: qcom: cmd-db: Stop memcpy()ing in cmd_db_read_aux_data()") Signed-off-by: Georgi Djakov --- drivers/interconnect/qcom/sdm845.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/drivers/interconnect/qcom/sdm845.c b/drivers/interconnect/qcom/sdm845.c index f594dd6f500f..06dbc99766ee 100644 --- a/drivers/interconnect/qcom/sdm845.c +++ b/drivers/interconnect/qcom/sdm845.c @@ -487,7 +487,9 @@ static struct qcom_icc_desc sdm845_rsc_hlos = { static int qcom_icc_bcm_init(struct qcom_icc_bcm *bcm, struct device *dev) { struct qcom_icc_node *qn; - int ret, i; + const struct bcm_db *data; + size_t data_count; + int i; bcm->addr = cmd_db_read_addr(bcm->name); if (!bcm->addr) { @@ -496,22 +498,22 @@ static int qcom_icc_bcm_init(struct qcom_icc_bcm *bcm, struct device *dev) return -EINVAL; } - if (cmd_db_read_aux_data_len(bcm->name) < sizeof(struct bcm_db)) { + data = cmd_db_read_aux_data(bcm->name, &data_count); + if (IS_ERR(data)) { + dev_err(dev, "%s command db read error (%ld)\n", + bcm->name, PTR_ERR(data)); + return PTR_ERR(data); + } + if (!data_count) { dev_err(dev, "%s command db missing or partial aux data\n", bcm->name); return -EINVAL; } - ret = cmd_db_read_aux_data(bcm->name, (u8 *)&bcm->aux_data, - sizeof(struct bcm_db)); - if (ret < 0) { - dev_err(dev, "%s command db read error (%d)\n", - bcm->name, ret); - return ret; - } - - bcm->aux_data.unit = le32_to_cpu(bcm->aux_data.unit); - bcm->aux_data.width = le16_to_cpu(bcm->aux_data.width); + bcm->aux_data.unit = le32_to_cpu(data->unit); + bcm->aux_data.width = le16_to_cpu(data->width); + bcm->aux_data.vcd = data->vcd; + bcm->aux_data.reserved = data->reserved; /* * Link Qnodes to their respective BCMs