Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1469721
| From | Greg KH <gregkh@linuxfoundation.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH V3] leds: trigger: Introduce an USB port trigger |
| Date | 2016-08-24 23:10 +0200 |
| Message-ID | <s9NAS-7TC-15@gated-at.bofh.it> (permalink) |
| References | <s9s3o-1C3-23@gated-at.bofh.it> <s9CFs-gj-13@gated-at.bofh.it> <s9CP7-kO-13@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Wed, Aug 24, 2016 at 11:29:51AM +0200, Rafał Miłecki wrote:
> On 24 August 2016 at 11:22, Greg KH <gregkh@linuxfoundation.org> wrote:
> > On Wed, Aug 24, 2016 at 12:03:29AM +0200, Rafał Miłecki wrote:
> >> +static ssize_t ports_show(struct device *dev, struct device_attribute *attr,
> >> + char *buf)
> >> +{
> >> + struct led_classdev *led_cdev = dev_get_drvdata(dev);
> >> + struct usbport_trig_data *usbport_data = led_cdev->trigger_data;
> >> + struct usbport_trig_port *port;
> >> + ssize_t ret = 0;
> >> + int len;
> >> +
> >> + list_for_each_entry(port, &usbport_data->ports, list) {
> >> + len = sprintf(buf + ret, "%s\n", port->name);
> >> + if (len >= 0)
> >> + ret += len;
> >> + }
> >> +
> >> + return ret;
> >> +}
> >
> > sysfs is "one value per file", here you are listing a bunch of things in
> > one sysfs file. Please don't do that.
>
> OK. What do you think about creating "ports" subdirectory and creating
> file-per-port in it? Then I'd need to bring back something like
> "new_port" and "remove_port". Does it sound OK?
Maybe, I don't know. Why is "USB" somehow unique here? Why isn't this
the same for PCI slots/ports? pccard? sdcard? thunderbolt?
thanks,
greg k-h
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH V3] leds: trigger: Introduce an USB port trigger Rafał Miłecki <zajec5@gmail.com> - 2016-08-24 00:10 +0200
Re: [PATCH V3] leds: trigger: Introduce an USB port trigger Greg KH <gregkh@linuxfoundation.org> - 2016-08-24 11:30 +0200
Re: [PATCH V3] leds: trigger: Introduce an USB port trigger Rafał Miłecki <zajec5@gmail.com> - 2016-08-24 11:40 +0200
Re: [PATCH V3] leds: trigger: Introduce an USB port trigger Greg KH <gregkh@linuxfoundation.org> - 2016-08-24 23:10 +0200
Re: [PATCH V3] leds: trigger: Introduce an USB port trigger Rafał Miłecki <zajec5@gmail.com> - 2016-08-25 07:20 +0200
Re: [PATCH V3] leds: trigger: Introduce an USB port trigger Greg KH <gregkh@linuxfoundation.org> - 2016-08-25 15:00 +0200
Re: [PATCH V3] leds: trigger: Introduce an USB port trigger Bjørn Mork <bjorn@mork.no> - 2016-08-25 21:00 +0200
Re: [PATCH V3] leds: trigger: Introduce an USB port trigger Greg KH <gregkh@linuxfoundation.org> - 2016-08-25 23:10 +0200
Re: [PATCH V3] leds: trigger: Introduce an USB port trigger Greg KH <gregkh@linuxfoundation.org> - 2016-08-24 11:30 +0200
Re: [PATCH V3] leds: trigger: Introduce an USB port trigger Rafał Miłecki <zajec5@gmail.com> - 2016-08-24 11:30 +0200
Re: [PATCH V3] leds: trigger: Introduce an USB port trigger Greg KH <gregkh@linuxfoundation.org> - 2016-08-24 23:20 +0200
Re: [PATCH V3] leds: trigger: Introduce an USB port trigger Rafał Miłecki <zajec5@gmail.com> - 2016-08-24 13:10 +0200
Re: [PATCH V3] leds: trigger: Introduce an USB port trigger Matthias Brugger <mbrugger@suse.com> - 2016-08-24 14:00 +0200
Re: [PATCH V3] leds: trigger: Introduce an USB port trigger Matthias Brugger <mbrugger@suse.com> - 2016-08-24 13:20 +0200
[PATCH RFC V3.5] leds: trigger: Introduce an USB port trigger Rafał Miłecki <zajec5@gmail.com> - 2016-08-24 20:00 +0200
Re: [PATCH RFC V3.5] leds: trigger: Introduce an USB port trigger Bjørn Mork <bjorn@mork.no> - 2016-08-24 21:20 +0200
Re: [PATCH RFC V3.5] leds: trigger: Introduce an USB port trigger Rafał Miłecki <zajec5@gmail.com> - 2016-08-24 22:50 +0200
Re: [PATCH RFC V3.5] leds: trigger: Introduce an USB port trigger Jacek Anaszewski <j.anaszewski@samsung.com> - 2016-08-25 10:20 +0200
Re: [PATCH RFC V3.5] leds: trigger: Introduce an USB port trigger Matthias Brugger <mbrugger@suse.com> - 2016-08-25 10:30 +0200
Re: [PATCH RFC V3.5] leds: trigger: Introduce an USB port trigger Rafał Miłecki <zajec5@gmail.com> - 2016-08-25 10:40 +0200
Re: [PATCH RFC V3.5] leds: trigger: Introduce an USB port trigger Jacek Anaszewski <j.anaszewski@samsung.com> - 2016-08-25 11:10 +0200
Re: [PATCH RFC V3.5] leds: trigger: Introduce an USB port trigger Alan Stern <stern@rowland.harvard.edu> - 2016-08-25 16:50 +0200
Re: [PATCH RFC V3.5] leds: trigger: Introduce an USB port trigger Jacek Anaszewski <jacek.anaszewski@gmail.com> - 2016-08-25 20:50 +0200
Re: [PATCH RFC V3.5] leds: trigger: Introduce an USB port trigger Alan Stern <stern@rowland.harvard.edu> - 2016-08-25 21:40 +0200
Re: [PATCH RFC V3.5] leds: trigger: Introduce an USB port trigger Alan Stern <stern@rowland.harvard.edu> - 2016-08-25 22:10 +0200
Re: [PATCH RFC V3.5] leds: trigger: Introduce an USB port trigger Rafał Miłecki <zajec5@gmail.com> - 2016-08-26 18:00 +0200
Re: [PATCH RFC V3.5] leds: trigger: Introduce an USB port trigger Jacek Anaszewski <j.anaszewski@samsung.com> - 2016-08-29 10:00 +0200
Re: [PATCH RFC V3.5] leds: trigger: Introduce an USB port trigger Pavel Machek <pavel@ucw.cz> - 2016-08-29 10:10 +0200
Re: [PATCH RFC V3.5] leds: trigger: Introduce an USB port trigger Rafał Miłecki <zajec5@gmail.com> - 2016-08-29 10:30 +0200
Re: [PATCH RFC V3.5] leds: trigger: Introduce an USB port trigger Pavel Machek <pavel@ucw.cz> - 2016-08-29 10:50 +0200
Re: [PATCH RFC V3.5] leds: trigger: Introduce an USB port trigger Rafał Miłecki <zajec5@gmail.com> - 2016-08-29 11:10 +0200
Re: [PATCH RFC V3.5] leds: trigger: Introduce an USB port trigger Pavel Machek <pavel@ucw.cz> - 2016-08-26 22:00 +0200
Re: [PATCH RFC V3.5] leds: trigger: Introduce an USB port trigger Jacek Anaszewski <j.anaszewski@samsung.com> - 2016-08-29 10:40 +0200
Re: [PATCH RFC V3.5] leds: trigger: Introduce an USB port trigger Pavel Machek <pavel@ucw.cz> - 2016-08-26 21:50 +0200
Re: [PATCH RFC V3.5] leds: trigger: Introduce an USB port trigger Rafał Miłecki <zajec5@gmail.com> - 2016-08-25 10:50 +0200
csiph-web