LKML Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v1] slimbus: core: Fix mismatch in of_node_get/put
@ 2020-03-26 17:34 Saravana Kannan
  2020-04-17  9:35 ` Srinivas Kandagatla
  0 siblings, 1 reply; 2+ messages in thread
From: Saravana Kannan @ 2020-03-26 17:34 UTC (permalink / raw)
  To: Srinivas Kandagatla
  Cc: Saravana Kannan, kernel-team, alsa-devel, linux-kernel

Also, remove some unnecessary NULL checks. The functions in question
already do NULL checks.

Signed-off-by: Saravana Kannan <saravanak@google.com>
---
 drivers/slimbus/core.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/slimbus/core.c b/drivers/slimbus/core.c
index 44228a5b246d..ae1e248a8fb8 100644
--- a/drivers/slimbus/core.c
+++ b/drivers/slimbus/core.c
@@ -162,11 +162,8 @@ static int slim_add_device(struct slim_controller *ctrl,
 	sbdev->ctrl = ctrl;
 	INIT_LIST_HEAD(&sbdev->stream_list);
 	spin_lock_init(&sbdev->stream_list_lock);
-
-	if (node) {
-		sbdev->dev.of_node = of_node_get(node);
-		sbdev->dev.fwnode = of_fwnode_handle(node);
-	}
+	sbdev->dev.of_node = of_node_get(node);
+	sbdev->dev.fwnode = of_fwnode_handle(node);
 
 	dev_set_name(&sbdev->dev, "%x:%x:%x:%x",
 				  sbdev->e_addr.manf_id,
@@ -285,6 +282,7 @@ EXPORT_SYMBOL_GPL(slim_register_controller);
 /* slim_remove_device: Remove the effect of slim_add_device() */
 static void slim_remove_device(struct slim_device *sbdev)
 {
+	of_node_put(sbdev->dev.of_node);
 	device_unregister(&sbdev->dev);
 }
 
-- 
2.25.1.696.g5e7596f4ac-goog


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

* Re: [PATCH v1] slimbus: core: Fix mismatch in of_node_get/put
  2020-03-26 17:34 [PATCH v1] slimbus: core: Fix mismatch in of_node_get/put Saravana Kannan
@ 2020-04-17  9:35 ` Srinivas Kandagatla
  0 siblings, 0 replies; 2+ messages in thread
From: Srinivas Kandagatla @ 2020-04-17  9:35 UTC (permalink / raw)
  To: Saravana Kannan; +Cc: kernel-team, alsa-devel, linux-kernel



On 26/03/2020 17:34, Saravana Kannan wrote:
> Also, remove some unnecessary NULL checks. The functions in question
> already do NULL checks.
> 
> Signed-off-by: Saravana Kannan <saravanak@google.com>

Applied Thanks,
--srini

> ---
>   drivers/slimbus/core.c | 8 +++-----
>   1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/slimbus/core.c b/drivers/slimbus/core.c
> index 44228a5b246d..ae1e248a8fb8 100644
> --- a/drivers/slimbus/core.c
> +++ b/drivers/slimbus/core.c
> @@ -162,11 +162,8 @@ static int slim_add_device(struct slim_controller *ctrl,
>   	sbdev->ctrl = ctrl;
>   	INIT_LIST_HEAD(&sbdev->stream_list);
>   	spin_lock_init(&sbdev->stream_list_lock);
> -
> -	if (node) {
> -		sbdev->dev.of_node = of_node_get(node);
> -		sbdev->dev.fwnode = of_fwnode_handle(node);
> -	}
> +	sbdev->dev.of_node = of_node_get(node);
> +	sbdev->dev.fwnode = of_fwnode_handle(node);
>   
>   	dev_set_name(&sbdev->dev, "%x:%x:%x:%x",
>   				  sbdev->e_addr.manf_id,
> @@ -285,6 +282,7 @@ EXPORT_SYMBOL_GPL(slim_register_controller);
>   /* slim_remove_device: Remove the effect of slim_add_device() */
>   static void slim_remove_device(struct slim_device *sbdev)
>   {
> +	of_node_put(sbdev->dev.of_node);
>   	device_unregister(&sbdev->dev);
>   }
>   
> 

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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-26 17:34 [PATCH v1] slimbus: core: Fix mismatch in of_node_get/put Saravana Kannan
2020-04-17  9:35 ` Srinivas Kandagatla

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git
	git clone --mirror https://lore.kernel.org/lkml/7 lkml/git/7.git
	git clone --mirror https://lore.kernel.org/lkml/8 lkml/git/8.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ https://lore.kernel.org/lkml \
		linux-kernel@vger.kernel.org
	public-inbox-index lkml

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git