[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e767ec8e-e25d-4880-86be-d23e1875a428@redhat.com>
Date: Tue, 3 Sep 2024 12:35:44 +0200
From: Paolo Abeni <pabeni@...hat.com>
To: Vadim Fedorenko <vadfed@...a.com>,
Vadim Fedorenko <vadim.fedorenko@...ux.dev>, Jakub Kicinski
<kuba@...nel.org>, Jonathan Lemon <jonathan.lemon@...il.com>,
Jiri Slaby <jirislaby@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH net v7 2/3] ptp: ocp: adjust sysfs entries to expose tty
information
On 8/29/24 20:36, Vadim Fedorenko wrote:
> diff --git a/drivers/ptp/ptp_ocp.c b/drivers/ptp/ptp_ocp.c
> index 46369de8e30b..e7479b9b90cb 100644
> --- a/drivers/ptp/ptp_ocp.c
> +++ b/drivers/ptp/ptp_ocp.c
> @@ -3361,6 +3361,54 @@ static EXT_ATTR_RO(freq, frequency, 1);
> static EXT_ATTR_RO(freq, frequency, 2);
> static EXT_ATTR_RO(freq, frequency, 3);
>
> +static ssize_t
> +ptp_ocp_tty_show(struct device *dev, struct device_attribute *attr, char *buf)
> +{
> + struct dev_ext_attribute *ea = to_ext_attr(attr);
> + struct ptp_ocp *bp = dev_get_drvdata(dev);
> +
> + return sysfs_emit(buf, "ttyS%d", bp->port[(uintptr_t)ea->var].line);
Out of sheer ignorance on my side, why a trailing '\n' is not needed
here? do we need to copy the format string from the old link verbatim?
Thanks!
Paolo
Powered by blists - more mailing lists