Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp503315pxb; Wed, 3 Feb 2021 10:18:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJyRSl1XgMQjVlDYE0MTNzUmdqL1guL97eGJK13GRY1IGK7jshWZnrgDcV1vSGG58Xsc1d35 X-Received: by 2002:a17:907:724a:: with SMTP id ds10mr4335067ejc.28.1612376323934; Wed, 03 Feb 2021 10:18:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612376323; cv=none; d=google.com; s=arc-20160816; b=wfBzDo4yv7i41lmTXgFgCwtV0s9VYsBe34VkdJim2V+OcMx4F5lRGxIcr+uFrFiMSx +1VRspV/crRRFc986s/s3e/Ve2qpMjJwgN4GmAZENimX5SrMRGY6ZzxF1ALwhFBu5nk9 9U0ZG9XirEoc1uoV1IqDa96MnJ7SpmpkjNKu4X+PeKlJ6QW+V8Xn9Ap4tRe2pl7l37Vf ZeAIQ37XxJUOjYAyWpvAr+ULh9bPxfM8kArunRrqsID7bLPd8sQ47aUlXH0V3k80FLw0 3OI+9LeGNdmtGWGBJrrcMpGBO1W78OdWOhQm87VFzoG8bhSxL2/PaprVhJI4NXeKYGsR Ptmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from:dmarc-filter :sender:dkim-signature; bh=ZsMFX26BhItfR6cigaB3k7baNguMiBqBBHYy0FFozlA=; b=lGR4UdBCKpWdTVTLI5A2L2UzhL2ia4AzToisaBEH7QP92M6GvNMbOWezSoBK8YK88F kHdE858fGOGxmgoO63/jueX6ReaUVj6vhuJjZ0VhUKPL2x0VAuHEBympeu2SCnZ4LlJC aId8gmFEiUejYOncbsPBBqS2FFDqrB9SCz8727xeC8cFAQTD5lr3qGS8u1h2IXz5//0O e9sE/RmiVobhcG0rLCvRtfE38kdfcRNrOhvnZHhHa1/bVwZynRbODxIk8nxsv8u97ttz b3+MP0sPfDyLmtGXSyL5amQRVMNXWaj5FXtg56hRPpoOw34ylp+gz5Jx0J8J5E3eCZp0 tpcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=JENgPxZQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hr37si1709702ejc.700.2021.02.03.10.18.10; Wed, 03 Feb 2021 10:18:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=JENgPxZQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232907AbhBCSQx (ORCPT + 99 others); Wed, 3 Feb 2021 13:16:53 -0500 Received: from so15.mailgun.net ([198.61.254.15]:42883 "EHLO so15.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231740AbhBCSQm (ORCPT ); Wed, 3 Feb 2021 13:16:42 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1612376179; h=Message-Id: Date: Subject: Cc: To: From: Sender; bh=ZsMFX26BhItfR6cigaB3k7baNguMiBqBBHYy0FFozlA=; b=JENgPxZQvfp6RvulBhtJGerIvnLoVYJ2ZiDbqB4/6YNWmzryFemC7FrEIO0J3NnjyUJ3gwxA D1Cr447C4vyx2qEXEyzv//wxqg3ThwSB8blSNf/TgWr9RrbGwRsrbqDQHGC2+wfhwR/Fp6sF K7G7D0VR+e9h02/xjuzARqMKAKk= X-Mailgun-Sending-Ip: 198.61.254.15 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n05.prod.us-east-1.postgun.com with SMTP id 601ae84759782fb516ba055b (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Wed, 03 Feb 2021 18:15:35 GMT Sender: subbaram=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 24D55C43462; Wed, 3 Feb 2021 18:15:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00,SPF_FAIL, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from subbaram-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: subbaram) by smtp.codeaurora.org (Postfix) with ESMTPSA id 0C955C433C6; Wed, 3 Feb 2021 18:15:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 0C955C433C6 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=subbaram@codeaurora.org From: Subbaraman Narayanamurthy To: Andy Gross , Bjorn Andersson , Srinivas Kandagatla Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Subbaraman Narayanamurthy , stable@vger.kernel.org Subject: [RESEND PATCH] nvmem: qcom-spmi-sdam: Fix uninitialized pdev pointer Date: Wed, 3 Feb 2021 10:15:26 -0800 Message-Id: <1612376126-31001-1-git-send-email-subbaram@codeaurora.org> X-Mailer: git-send-email 2.7.4 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org "sdam->pdev" is uninitialized and it is used to print error logs. Fix it. Since device pointer can be used from sdam_config, use it directly thereby removing pdev pointer. Cc: stable@vger.kernel.org Signed-off-by: Subbaraman Narayanamurthy --- drivers/nvmem/qcom-spmi-sdam.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/nvmem/qcom-spmi-sdam.c b/drivers/nvmem/qcom-spmi-sdam.c index a72704c..f6e9f96 100644 --- a/drivers/nvmem/qcom-spmi-sdam.c +++ b/drivers/nvmem/qcom-spmi-sdam.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * Copyright (c) 2017, 2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2017, 2020-2021, The Linux Foundation. All rights reserved. */ #include @@ -18,7 +18,6 @@ #define SDAM_PBS_TRIG_CLR 0xE6 struct sdam_chip { - struct platform_device *pdev; struct regmap *regmap; struct nvmem_config sdam_config; unsigned int base; @@ -65,7 +64,7 @@ static int sdam_read(void *priv, unsigned int offset, void *val, size_t bytes) { struct sdam_chip *sdam = priv; - struct device *dev = &sdam->pdev->dev; + struct device *dev = sdam->sdam_config.dev; int rc; if (!sdam_is_valid(sdam, offset, bytes)) { @@ -86,7 +85,7 @@ static int sdam_write(void *priv, unsigned int offset, void *val, size_t bytes) { struct sdam_chip *sdam = priv; - struct device *dev = &sdam->pdev->dev; + struct device *dev = sdam->sdam_config.dev; int rc; if (!sdam_is_valid(sdam, offset, bytes)) { -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project