linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] slimbus: patches for 5.8
@ 2020-05-11 15:13 Srinivas Kandagatla
  2020-05-11 15:13 ` [PATCH 1/2] slimbus: core: Set fwnode for a device when setting of_node Srinivas Kandagatla
  2020-05-11 15:13 ` [PATCH 2/2] slimbus: core: Fix mismatch in of_node_get/put Srinivas Kandagatla
  0 siblings, 2 replies; 5+ messages in thread
From: Srinivas Kandagatla @ 2020-05-11 15:13 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, Srinivas Kandagatla

Hi Greg,

Here are two slimbus patches for 5.8, Can you please queue them up for 5.8.

Thanks,
srini

Saravana Kannan (2):
  slimbus: core: Set fwnode for a device when setting of_node
  slimbus: core: Fix mismatch in of_node_get/put

 drivers/slimbus/core.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

-- 
2.21.0


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

* [PATCH 1/2] slimbus: core: Set fwnode for a device when setting of_node
  2020-05-11 15:13 [PATCH 0/2] slimbus: patches for 5.8 Srinivas Kandagatla
@ 2020-05-11 15:13 ` Srinivas Kandagatla
  2020-05-11 18:14   ` Saravana Kannan
  2020-05-11 15:13 ` [PATCH 2/2] slimbus: core: Fix mismatch in of_node_get/put Srinivas Kandagatla
  1 sibling, 1 reply; 5+ messages in thread
From: Srinivas Kandagatla @ 2020-05-11 15:13 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, Saravana Kannan, Srinivas Kandagatla

From: Saravana Kannan <saravanak@google.com>

When setting the of_node for a newly created device, also set the
fwnode. This allows fw_devlink feature to work for slimbus devices.

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

Signed-off-by: Saravana Kannan <saravanak@google.com>
[Srini: removed unnecessary NULL check from other patch]
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 drivers/slimbus/core.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/slimbus/core.c b/drivers/slimbus/core.c
index 526e3215d8fe..1f3beee74fdf 100644
--- a/drivers/slimbus/core.c
+++ b/drivers/slimbus/core.c
@@ -162,9 +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.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,
-- 
2.21.0


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

* [PATCH 2/2] slimbus: core: Fix mismatch in of_node_get/put
  2020-05-11 15:13 [PATCH 0/2] slimbus: patches for 5.8 Srinivas Kandagatla
  2020-05-11 15:13 ` [PATCH 1/2] slimbus: core: Set fwnode for a device when setting of_node Srinivas Kandagatla
@ 2020-05-11 15:13 ` Srinivas Kandagatla
  2020-05-11 18:15   ` Saravana Kannan
  1 sibling, 1 reply; 5+ messages in thread
From: Srinivas Kandagatla @ 2020-05-11 15:13 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, Saravana Kannan, Srinivas Kandagatla

From: Saravana Kannan <saravanak@google.com>

Adding missing corresponding of_node_put

Fixes: 7588a511bdb4 ("slimbus: core: add support to device tree helper")
Signed-off-by: Saravana Kannan <saravanak@google.com>
[Srini: added fixes tag, removed NULL check and updated log]
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 drivers/slimbus/core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/slimbus/core.c b/drivers/slimbus/core.c
index 1f3beee74fdf..ae1e248a8fb8 100644
--- a/drivers/slimbus/core.c
+++ b/drivers/slimbus/core.c
@@ -282,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.21.0


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

* Re: [PATCH 1/2] slimbus: core: Set fwnode for a device when setting of_node
  2020-05-11 15:13 ` [PATCH 1/2] slimbus: core: Set fwnode for a device when setting of_node Srinivas Kandagatla
@ 2020-05-11 18:14   ` Saravana Kannan
  0 siblings, 0 replies; 5+ messages in thread
From: Saravana Kannan @ 2020-05-11 18:14 UTC (permalink / raw)
  To: Srinivas Kandagatla; +Cc: Greg Kroah-Hartman, LKML

On Mon, May 11, 2020 at 8:13 AM Srinivas Kandagatla
<srinivas.kandagatla@linaro.org> wrote:
>
> From: Saravana Kannan <saravanak@google.com>
>
> When setting the of_node for a newly created device, also set the
> fwnode. This allows fw_devlink feature to work for slimbus devices.
>
> Also, remove some unnecessary NULL checks. The functions in question
> already do NULL checks.
>
> Signed-off-by: Saravana Kannan <saravanak@google.com>
> [Srini: removed unnecessary NULL check from other patch]
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> ---
>  drivers/slimbus/core.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/slimbus/core.c b/drivers/slimbus/core.c
> index 526e3215d8fe..1f3beee74fdf 100644
> --- a/drivers/slimbus/core.c
> +++ b/drivers/slimbus/core.c
> @@ -162,9 +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.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,
> --
> 2.21.0

The edits look fine to me.

-Saravana

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

* Re: [PATCH 2/2] slimbus: core: Fix mismatch in of_node_get/put
  2020-05-11 15:13 ` [PATCH 2/2] slimbus: core: Fix mismatch in of_node_get/put Srinivas Kandagatla
@ 2020-05-11 18:15   ` Saravana Kannan
  0 siblings, 0 replies; 5+ messages in thread
From: Saravana Kannan @ 2020-05-11 18:15 UTC (permalink / raw)
  To: Srinivas Kandagatla; +Cc: Greg Kroah-Hartman, LKML

On Mon, May 11, 2020 at 8:13 AM Srinivas Kandagatla
<srinivas.kandagatla@linaro.org> wrote:
>
> From: Saravana Kannan <saravanak@google.com>
>
> Adding missing corresponding of_node_put
>
> Fixes: 7588a511bdb4 ("slimbus: core: add support to device tree helper")
> Signed-off-by: Saravana Kannan <saravanak@google.com>
> [Srini: added fixes tag, removed NULL check and updated log]
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> ---
>  drivers/slimbus/core.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/slimbus/core.c b/drivers/slimbus/core.c
> index 1f3beee74fdf..ae1e248a8fb8 100644
> --- a/drivers/slimbus/core.c
> +++ b/drivers/slimbus/core.c
> @@ -282,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);
>  }
>

The edits look fine to me.

-Saravana

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

end of thread, other threads:[~2020-05-11 18:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-11 15:13 [PATCH 0/2] slimbus: patches for 5.8 Srinivas Kandagatla
2020-05-11 15:13 ` [PATCH 1/2] slimbus: core: Set fwnode for a device when setting of_node Srinivas Kandagatla
2020-05-11 18:14   ` Saravana Kannan
2020-05-11 15:13 ` [PATCH 2/2] slimbus: core: Fix mismatch in of_node_get/put Srinivas Kandagatla
2020-05-11 18:15   ` Saravana Kannan

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).