Re: [PATCH] coresight: trbe: Hide enable_sink sysfs file
From: James Clark
Date: Wed May 13 2026 - 05:33:49 EST
On 13/05/2026 9:15 am, Leo Yan wrote:
On Thu, May 07, 2026 at 11:53:45AM +0100, James Clark wrote:
[...]
+static umode_t coresight_attr_is_visible(struct kobject *kobj,
+ struct attribute *attr, int n)
{
struct device *dev = kobj_to_dev(kobj);
+ struct coresight_device *csdev = to_coresight_device(dev);
if (attr == &dev_attr_label.attr) {
if (fwnode_property_present(dev_fwnode(dev), "label"))
return attr->mode;
else
return 0;
+ } else if (attr == &dev_attr_enable_sink.attr ||
+ attr == &dev_attr_enable_source.attr) {
+ if (csdev->no_sysfs_mode)
+ return 0;
+ else
+ return attr->mode;
I'd prefer no_sysfs_mode to work as a general flag rather than being
limited to sink/source devices only. Otherwise, LGTM.
Thanks,
Leo
Which other files would you hide though? These are the only two that I could think of.
I wouldn't hide all sysfs files for 'no_sysfs_mode' as there are read only things that aren't strictly related to sysfs mode.