diff mbox series

spmi: hisi-spmi-controller: Drop duplicated OF node assignment in spmi_controller_probe()

Message ID 20250116044725.2946205-1-joe@pf.is.s.u-tokyo.ac.jp (mailing list archive)
State New
Headers show
Series spmi: hisi-spmi-controller: Drop duplicated OF node assignment in spmi_controller_probe() | expand

Commit Message

Joe Hattori Jan. 16, 2025, 4:47 a.m. UTC
spmi_controller_probe() assigns a parent device and an OF node to an
SPMI controller. However, the operations are not needed as they are
already assigned in spmi_controller_alloc(). Thus, remove the duplicated
assignments. An unnecessary OF node reference acquisition is also
dropped by this patch.

Signed-off-by: Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
Suggested-by: Stephen Boyd <sboyd@kernel.org>
---
 drivers/spmi/hisi-spmi-controller.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Joe Hattori Jan. 16, 2025, 4:52 a.m. UTC | #1
On 1/16/25 13:47, Joe Hattori wrote:
> spmi_controller_probe() assigns a parent device and an OF node to an
> SPMI controller. However, the operations are not needed as they are
> already assigned in spmi_controller_alloc(). Thus, remove the duplicated
> assignments. An unnecessary OF node reference acquisition is also
> dropped by this patch.
> 
> Signed-off-by: Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>est,
> Suggested-by: Stephen Boyd <sboyd@kernel.org>
> ---
>   drivers/spmi/hisi-spmi-controller.c | 3 ---
>   1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/spmi/hisi-spmi-controller.c b/drivers/spmi/hisi-spmi-controller.c
> index 3cafdf22c909..122140b97579 100644
> --- a/drivers/spmi/hisi-spmi-controller.c
> +++ b/drivers/spmi/hisi-spmi-controller.c
> @@ -300,9 +300,6 @@ static int spmi_controller_probe(struct platform_device *pdev)
>   
>   	spin_lock_init(&spmi_controller->lock);
>   
> -	ctrl->dev.parent = pdev->dev.parent;
> -	ctrl->dev.of_node = of_node_get(pdev->dev.of_node);
> -
>   	/* Callbacks */
>   	ctrl->read_cmd = spmi_read_cmd;
>   	ctrl->write_cmd = spmi_write_cmd;

Kindly disregard this patch since I forgot to CC 
linux-kernel@vger.kernel.org. The new patch can be found at
https://lore.kernel.org/all/20250116044725.2946205-1-joe@pf.is.s.u-tokyo.ac.jp/

Best,
Joe
diff mbox series

Patch

diff --git a/drivers/spmi/hisi-spmi-controller.c b/drivers/spmi/hisi-spmi-controller.c
index 3cafdf22c909..122140b97579 100644
--- a/drivers/spmi/hisi-spmi-controller.c
+++ b/drivers/spmi/hisi-spmi-controller.c
@@ -300,9 +300,6 @@  static int spmi_controller_probe(struct platform_device *pdev)
 
 	spin_lock_init(&spmi_controller->lock);
 
-	ctrl->dev.parent = pdev->dev.parent;
-	ctrl->dev.of_node = of_node_get(pdev->dev.of_node);
-
 	/* Callbacks */
 	ctrl->read_cmd = spmi_read_cmd;
 	ctrl->write_cmd = spmi_write_cmd;