linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/1] nvmem: qcom-spmi-sdam: Enable multiple devices
@ 2020-07-21 19:46 Guru Das Srinagesh
  2020-07-22  9:32 ` Srinivas Kandagatla
  0 siblings, 1 reply; 2+ messages in thread
From: Guru Das Srinagesh @ 2020-07-21 19:46 UTC (permalink / raw)
  To: Srinivas Kandagatla, linux-arm-msm
  Cc: Subbaraman Narayanamurthy, David Collins, Anirudh Ghayal,
	Shyam Kumar Thella, linux-kernel, Guru Das Srinagesh

Using pdev->id as the nvmem's config ID (which, by default, is
NVMEM_DEVID_NONE) prevents multiple instances of this driver from
probing because of the following error:

  sysfs: cannot create duplicate filename '/bus/nvmem/devices/spmi_sdam'

Use NVMEM_DEVID_AUTO as the NVMEM config ID to fix the issue.

Signed-off-by: Guru Das Srinagesh <gurus@codeaurora.org>
---
 drivers/nvmem/qcom-spmi-sdam.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/nvmem/qcom-spmi-sdam.c b/drivers/nvmem/qcom-spmi-sdam.c
index 8682cda..a72704c 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 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017, 2020 The Linux Foundation. All rights reserved.
  */
 
 #include <linux/device.h>
@@ -141,7 +141,7 @@ static int sdam_probe(struct platform_device *pdev)
 
 	sdam->sdam_config.dev = &pdev->dev;
 	sdam->sdam_config.name = "spmi_sdam";
-	sdam->sdam_config.id = pdev->id;
+	sdam->sdam_config.id = NVMEM_DEVID_AUTO;
 	sdam->sdam_config.owner = THIS_MODULE,
 	sdam->sdam_config.stride = 1;
 	sdam->sdam_config.word_size = 1;
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2 1/1] nvmem: qcom-spmi-sdam: Enable multiple devices
  2020-07-21 19:46 [PATCH v2 1/1] nvmem: qcom-spmi-sdam: Enable multiple devices Guru Das Srinagesh
@ 2020-07-22  9:32 ` Srinivas Kandagatla
  0 siblings, 0 replies; 2+ messages in thread
From: Srinivas Kandagatla @ 2020-07-22  9:32 UTC (permalink / raw)
  To: Guru Das Srinagesh, linux-arm-msm
  Cc: Subbaraman Narayanamurthy, David Collins, Anirudh Ghayal,
	Shyam Kumar Thella, linux-kernel



On 21/07/2020 20:46, Guru Das Srinagesh wrote:
> Using pdev->id as the nvmem's config ID (which, by default, is
> NVMEM_DEVID_NONE) prevents multiple instances of this driver from
> probing because of the following error:
> 
>    sysfs: cannot create duplicate filename '/bus/nvmem/devices/spmi_sdam'
> 
> Use NVMEM_DEVID_AUTO as the NVMEM config ID to fix the issue.
> 
> Signed-off-by: Guru Das Srinagesh <gurus@codeaurora.org>
> ---
>   drivers/nvmem/qcom-spmi-sdam.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)

Applied thanks,

--srini
> 
> diff --git a/drivers/nvmem/qcom-spmi-sdam.c b/drivers/nvmem/qcom-spmi-sdam.c
> index 8682cda..a72704c 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 The Linux Foundation. All rights reserved.
> + * Copyright (c) 2017, 2020 The Linux Foundation. All rights reserved.
>    */
>   
>   #include <linux/device.h>
> @@ -141,7 +141,7 @@ static int sdam_probe(struct platform_device *pdev)
>   
>   	sdam->sdam_config.dev = &pdev->dev;
>   	sdam->sdam_config.name = "spmi_sdam";
> -	sdam->sdam_config.id = pdev->id;
> +	sdam->sdam_config.id = NVMEM_DEVID_AUTO;
>   	sdam->sdam_config.owner = THIS_MODULE,
>   	sdam->sdam_config.stride = 1;
>   	sdam->sdam_config.word_size = 1;
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-07-22  9:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-21 19:46 [PATCH v2 1/1] nvmem: qcom-spmi-sdam: Enable multiple devices Guru Das Srinagesh
2020-07-22  9:32 ` Srinivas Kandagatla

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).