Re: [PATCH v7 12/15] net: qrtr: mhi: Report endpoint id in sysfs

From: Juha-Matti Tilli

Date: Tue Sep 15 2026 - 10:38:41 EST


On Tue, Sep 15, 2026, at 10:11, Arthur Crepin Leblond wrote:
> On Tue, Sep 15, 2026 at 08:42:04AM +0300, Juha-Matti Tilli wrote:
> >+static ssize_t endpoint_show(struct device *dev,
> >+ struct device_attribute *attr, char *buf)
> >+{
> >+ struct qrtr_mhi_dev *qdev = dev_get_drvdata(dev);
> >+
> >+ return sprintf(buf, "%u\n", qdev->ep.id);
> >+}
> >+
> >+static DEVICE_ATTR_RO(endpoint);
>
> I think you could use sysfs_emit instead of sprintf.

Thank you for the commentary. I tested sysfs_emit and it compiles and:

cat /sys/devices/platform/soc/*.pcie/pci*/*/*/mhi0/*/endpoint

...prints 2, as it should, so it seems to work too.

The next patchset version will use sysfs_emit here.

BR, Juha-Matti