mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
To: Subbaraman Narayanamurthy <subbaram@codeaurora.org>,
	Andy Gross <agross@kernel.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [RESEND PATCH] nvmem: qcom-spmi-sdam: Fix uninitialized pdev pointer
Date: Thu, 4 Feb 2021 14:25:59 +0000	[thread overview]
Message-ID: <b369ae3e-38d5-7e41-1380-982a8fe66660@linaro.org> (raw)
In-Reply-To: <1612376126-31001-1-git-send-email-subbaram@codeaurora.org>



On 03/02/2021 18:15, Subbaraman Narayanamurthy wrote:
> "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 <subbaram@codeaurora.org>
> ---

Applied thanks,

--srini

>   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 <linux/device.h>
> @@ -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)) {
> 

      reply	other threads:[~2021-02-04 14:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-03 18:15 Subbaraman Narayanamurthy
2021-02-04 14:25 ` Srinivas Kandagatla [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b369ae3e-38d5-7e41-1380-982a8fe66660@linaro.org \
    --to=srinivas.kandagatla@linaro.org \
    --cc=agross@kernel.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=subbaram@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®