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

Juha-Matti Tilli juha-matti.tilli at iki.fi
Tue Sep 15 05:30:26 PDT 2026


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



More information about the ath12k mailing list