[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2024081530-clasp-frown-1586@gregkh>
Date: Thu, 15 Aug 2024 15:41:38 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: Vadim Fedorenko <vadfed@...a.com>
Cc: Vadim Fedorenko <vadim.fedorenko@...ux.dev>,
Jakub Kicinski <kuba@...nel.org>,
Jonathan Lemon <jonathan.lemon@...il.com>,
Jiri Slaby <jirislaby@...nel.org>, netdev@...r.kernel.org
Subject: Re: [PATCH net v3 1/2] ptp: ocp: adjust sysfs entries to expose tty
information
On Thu, Aug 15, 2024 at 05:59:04AM -0700, Vadim Fedorenko wrote:
> Starting v6.8 the serial port subsystem changed the hierarchy of devices
> and symlinks are not working anymore. Previous discussion made it clear
> that the idea of symlinks for tty devices was wrong by design. Implement
> additional attributes to expose the information. Fixes tag points to the
> commit which introduced the change.
>
> Fixes: b286f4e87e32 ("serial: core: Move tty and serdev to be children of serial core port device")
> Signed-off-by: Vadim Fedorenko <vadfed@...a.com>
Complicated fixes, nice! Thanks for doing this. One question:
> +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);
> + struct ptp_ocp_serial_port *port;
> +
> + return sysfs_emit(buf, "ttyS%d", bp->port[(uintptr_t)ea->var].line);
"uintptr_t"? That's not a normal kernel type. var is of type "void *"
so can't this just be "int" here? Or am I reading this wrong?
thanks,
greg k-h
Powered by blists - more mailing lists