[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100827163436.GB13030@core.coreip.homeip.net>
Date: Fri, 27 Aug 2010 09:34:36 -0700
From: Dmitry Torokhov <dmitry.torokhov@...il.com>
To: Henrik Rydberg <rydberg@...omail.se>
Cc: Rafi Rubin <rafi@...s.upenn.edu>, jkosina@...e.cz,
linux-input@...r.kernel.org, linux-kernel@...r.kernel.org,
chatty@...c.fr, micki@...rig.com
Subject: Re: [PATCH 4/4] firmware sysfs node
On Fri, Aug 27, 2010 at 02:09:05PM +0200, Henrik Rydberg wrote:
> On 08/26/2010 06:54 AM, Rafi Rubin wrote:
>
> > Signed-off-by: Rafi Rubin <rafi@...s.upenn.edu>
> > ---
> > drivers/hid/hid-ntrig.c | 21 +++++++++++++++++++++
> > 1 files changed, 21 insertions(+), 0 deletions(-)
> >
> > diff --git a/drivers/hid/hid-ntrig.c b/drivers/hid/hid-ntrig.c
> > index ab0ca7f..e341e88 100644
> > --- a/drivers/hid/hid-ntrig.c
> > +++ b/drivers/hid/hid-ntrig.c
> > @@ -375,6 +375,26 @@ static ssize_t set_deactivate_slack(struct device *dev,
> > static DEVICE_ATTR(deactivate_slack, S_IWUSR | S_IRUGO, show_deactivate_slack,
> > set_deactivate_slack);
> >
> > +static ssize_t show_firmware(struct device *dev,
> > + struct device_attribute *attr,
> > + char *buf)
> > +{
> > + struct hid_device *hdev = container_of(dev, struct hid_device, dev);
> > + struct ntrig_data *nd = hid_get_drvdata(hdev);
> > +
> > + if (!(nd->firmware_version[0] || nd->firmware_version[1] ||
> > + nd->firmware_version[2] || nd->firmware_version[3]))
> > + return sprintf(buf, "Firmware version unavailable");
>
>
> If this sysfs node should really be added (see EVIO), it is probably better if
> it returns the same format for all devices. If all numbers are zero, that is
> understandable also by someone reading the node.
>
Yes, I think we should stick it into input_id and be done with it. Note
that input_id is not only available via EVIOCGID ioctl but also already
exported in sysfs.
--
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists