linux-leds.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Juergen Borleis <jbe@pengutronix.de>,
	kernel@pengutronix.de, linux-doc@vger.kernel.org,
	Jonathan Corbet <corbet@lwn.net>,
	linux-kernel@vger.kernel.org, Pavel Machek <pavel@ucw.cz>,
	linux-leds@vger.kernel.org
Subject: Re: [PATCH] leds: trigger/tty: feature data direction
Date: Thu, 22 Apr 2021 16:39:45 +0200	[thread overview]
Message-ID: <20210422143945.n5gqkeh2y2jm6ece@pengutronix.de> (raw)
In-Reply-To: <YIEuSPS11fkSwQ7N@kroah.com>

[-- Attachment #1: Type: text/plain, Size: 1190 bytes --]

Hello Greg,

On Thu, Apr 22, 2021 at 10:05:28AM +0200, Greg Kroah-Hartman wrote:
> On Thu, Apr 22, 2021 at 09:47:02AM +0200, Juergen Borleis wrote:
> > +static ssize_t dirfilter_show(struct device *dev,
> > +			      struct device_attribute *attr, char *buf)
> > +{
> > +	struct ledtrig_tty_data *trigger_data = led_trigger_get_drvdata(dev);
> > +
> > +	if (trigger_data->indirection)
> > +		return (ssize_t)sprintf(buf, "in\n");
> > +	if (trigger_data->outdirection)
> > +		return (ssize_t)sprintf(buf, "out\n");
> > +	return (ssize_t)sprintf(buf, "inout\n");
> 
> sysfs_emit() please.
> 
> And you are adding new sysfs files, that requires an update to
> Documentation/ABI/ please do so.

I agree to these two suggestions.

> But why are you adding random new sysfs values to a class device?  That
> feels really wrong.

This is quite usual for triggers and there is IMHO no way around this.
And it is also save as led_trigger_set() emits an uevent after a trigger
was activated.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2021-04-22 14:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-22  7:47 [PATCH] leds: trigger/tty: feature data direction Juergen Borleis
2021-04-22  8:05 ` Greg Kroah-Hartman
2021-04-22 14:39   ` Uwe Kleine-König [this message]
2021-04-22 14:36 ` Uwe Kleine-König
2021-04-25 22:44 ` Pavel Machek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210422143945.n5gqkeh2y2jm6ece@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=corbet@lwn.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=jbe@pengutronix.de \
    --cc=kernel@pengutronix.de \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=pavel@ucw.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).