[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMZdPi9gHzPaKcwoRR8-gQtiSxQupL=QickXqNE2owVs-nOrxg@mail.gmail.com>
Date: Thu, 13 Apr 2023 09:07:21 +0200
From: Loic Poulain <loic.poulain@...aro.org>
To: Slark Xiao <slark_xiao@....com>
Cc: ryazanov.s.a@...il.com, johannes@...solutions.net,
davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
pabeni@...hat.com, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH net] wwan: core: add print for wwan port attach/disconnect
On Wed, 12 Apr 2023 at 13:45, Slark Xiao <slark_xiao@....com> wrote:
>
> Refer to USB serial device or net device, there is notice to
> let end user know the status of device, like attached or
> disconnected. Add attach/disconnect print for wwan device as
> well. This change works for MHI device and USB device.
This change works for wwan port devices, whatever the bus is.
>
> Signed-off-by: Slark Xiao <slark_xiao@....com>
> ---
> drivers/net/wwan/wwan_core.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/net/wwan/wwan_core.c b/drivers/net/wwan/wwan_core.c
> index 2e1c01cf00a9..d3ac6c5b0b26 100644
> --- a/drivers/net/wwan/wwan_core.c
> +++ b/drivers/net/wwan/wwan_core.c
> @@ -492,6 +492,8 @@ struct wwan_port *wwan_create_port(struct device *parent,
> if (err)
> goto error_put_device;
>
> + dev_info(&wwandev->dev, "%s converter now attached to %s\n",
> + wwan_port_dev_type.name, port->dev.kobj.name);
You should use `dev_name()` instead of direct reference to kobj.
Why 'converter' ? If you really want to print, it should be something like:
wwan0: wwan0at1 port attached
> return port;
>
> error_put_device:
> @@ -517,6 +519,9 @@ void wwan_remove_port(struct wwan_port *port)
>
> skb_queue_purge(&port->rxq);
> dev_set_drvdata(&port->dev, NULL);
> +
> + dev_info(&wwandev->dev, "%s converter now disconnected from %s\n",
> + wwan_port_dev_type.name, port->dev.kobj.name);
> device_unregister(&port->dev);
>
> /* Release related wwan device */
> --
> 2.34.1
>
Regards,
Loic
Powered by blists - more mailing lists