From patchwork Fri Dec 7 15:29:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georgi Djakov X-Patchwork-Id: 10718343 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BDB93109C for ; Fri, 7 Dec 2018 15:29:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AB2F62EB9C for ; Fri, 7 Dec 2018 15:29:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9D8CB2DD44; Fri, 7 Dec 2018 15:29: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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4495C2DD44 for ; Fri, 7 Dec 2018 15:29:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726279AbeLGP3p (ORCPT ); Fri, 7 Dec 2018 10:29:45 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:54868 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726248AbeLGP3j (ORCPT ); Fri, 7 Dec 2018 10:29:39 -0500 Received: by mail-wm1-f68.google.com with SMTP id z18so4769760wmc.4 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=GyJBtfUXOIPeRSsh3TxjE/yhsjKySXewHEQ9E2dOJqIV2bqg7EQ8eZ/J2EatYWxt9b OHb/VQaU+SYzc6XLAL0UTLF6ArDUCTl1It4UrL2M+lyKVJnsbSYUzYW5GPqB8kaq1aWD pjzfKgyA9KGdjlJJNgMM5PWxWIIoELBzVa0axg7GDRYFO06ANIYCoi9heF+wCDSKvYdt 6bVTw0c1RXMmdsQ39xzKgN2Ag8Hf+pdQMCnEmvmQfDnDBKC69cOsoYT1qRtA8+kNqzek EgVA7E00K/Yqb4h9OfDaAiSmzjV8YcrLmdaM4NDBWKGTy9tzVIptBgVxHGe1DZ3Hcte8 vo8Q== X-Gm-Message-State: AA+aEWbtIIWlNfr+/4NjV2JkanrVMRiHDpv41xj29IeHDRH89fvv2An6 JZQAnsERluzZLBFUq9V3q0vOVg== X-Google-Smtp-Source: AFSGD/VBiLX2VNYpEOEr8hZt9nXSDWVQ08GjLKumhZCB0fHUqfhV6wLItDkuLr6mzgvh8j4/zWla6Q== 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 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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