Re: [PATCH 3/6] usb: usbip: Export the number of VHCI controllers in a sysfs file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Mar 27, 2017 at 09:00:06AM +0200, Krzysztof Opasiak wrote:
> >+static ssize_t ncontrollers_show(struct device *dev, struct device_attribute *attr,
> >+			   char *out)
> >+{
> >+	char *s = out;
> >+
> >+	out += sprintf(out, "%d\n", vhci_num_controllers);
> >+	return out - s;
> >+}
> >+static DEVICE_ATTR_RO(ncontrollers);
> >+
> 
> Why you need a special RO attribute for this? Can't just cannot
> check content of directory using for example scandir() to learn what
> we have?
 
We can learn or somebody simply tells, I chose the latter. This makes
it easier as the changelog says?
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux