[net-next,v2] wwan: core: add print for wwan port attach/disconnect

Message ID 20230420023617.3919569-1-slark_xiao@163.com
State New
Headers
Series [net-next,v2] wwan: core: add print for wwan port attach/disconnect |

Commit Message

Slark Xiao April 20, 2023, 2:36 a.m. UTC
  Refer to USB serial device or net device, there is a notice to
let end user know the status of device, like attached or
disconnected. Add attach/disconnect print for wwan device as
well.

Signed-off-by: Slark Xiao <slark_xiao@163.com>
---

v2: Use dev_name() instead of kobj item and make print neat.
---
 drivers/net/wwan/wwan_core.c | 3 +++
 1 file changed, 3 insertions(+)
  

Comments

Jakub Kicinski April 21, 2023, 3 a.m. UTC | #1
On Thu, 20 Apr 2023 10:36:17 +0800 Slark Xiao wrote:
> Refer to USB serial device or net device, there is a notice to
> let end user know the status of device, like attached or
> disconnected. Add attach/disconnect print for wwan device as
> well.
> 
> Signed-off-by: Slark Xiao <slark_xiao@163.com>

Looks the same as previous posting, applying, but please make sure you
include review tags you received.

https://lore.kernel.org/all/CAMZdPi_WFxQ_aNU1t6dDh7F_aBB99XyeoFGBW2t6DryoJyFJuA@mail.gmail.com/
  
patchwork-bot+netdevbpf@kernel.org April 21, 2023, 3:10 a.m. UTC | #2
Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Thu, 20 Apr 2023 10:36:17 +0800 you wrote:
> Refer to USB serial device or net device, there is a notice to
> let end user know the status of device, like attached or
> disconnected. Add attach/disconnect print for wwan device as
> well.
> 
> Signed-off-by: Slark Xiao <slark_xiao@163.com>
> 
> [...]

Here is the summary with links:
  - [net-next,v2] wwan: core: add print for wwan port attach/disconnect
    https://git.kernel.org/netdev/net-next/c/787e6144aef7

You are awesome, thank you!
  

Patch

diff --git a/drivers/net/wwan/wwan_core.c b/drivers/net/wwan/wwan_core.c
index 2e1c01cf00a9..aa54fa6d5f90 100644
--- a/drivers/net/wwan/wwan_core.c
+++ b/drivers/net/wwan/wwan_core.c
@@ -492,6 +492,7 @@  struct wwan_port *wwan_create_port(struct device *parent,
 	if (err)
 		goto error_put_device;
 
+	dev_info(&wwandev->dev, "port %s attached\n", dev_name(&port->dev));
 	return port;
 
 error_put_device:
@@ -517,6 +518,8 @@  void wwan_remove_port(struct wwan_port *port)
 
 	skb_queue_purge(&port->rxq);
 	dev_set_drvdata(&port->dev, NULL);
+
+	dev_info(&wwandev->dev, "port %s disconnected\n", dev_name(&port->dev));
 	device_unregister(&port->dev);
 
 	/* Release related wwan device */