From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Himanshu Chauhan <hschauhan@nulltrace.org>
Cc: Jean Delvare <khali@linux-fr.org>,
Guenter Roeck <guenter.roeck@ericsson.com>,
lm-sensors@lm-sensors.org, linux-kernel@vger.kernel.org
Subject: Re: [lm-sensors] [PATCH] hwmon class driver registration with a device number
Date: Thu, 6 Oct 2011 16:46:00 +0100 [thread overview]
Message-ID: <20111006164600.071213e1@lxorguk.ukuu.org.uk> (raw)
In-Reply-To: <20111006151232.GA3267@ubuntu.ubuntu-domain>
> AFAIK, the current sysfs interface is to read standard attributes from
> the device. My reasoning is:
and any other attributes.
> 1. This will give hwmon devices to have their "dev" in their sysfs folder
> as like other classes and in turn be visible in /dev by mdev or udev.
Well there is in theory no reason a device shouldn't do that, but most
sysfs devices don't need to so making it generic seems odd.
> 2. Implementing IOCTL if required. I know that kernel hackers believe
> they are "backdoors" and "can't be done right" but sometimes there
> isn't any get away with them. I don't know when their support will
> be completely removed. Rather, I see that instead of deprecation,
> new IOCTL vectors like compat_ioctl have been introduced.
Certain things need ioctl, in fact some problems are *very* hard to
solve any other way: transactional updates (changing a set of fields at
once all or none), and query/response data being two.
> 2. During probing, for each device, call "hwmon_device_register_numbered"
> and let mdev create a /dev node for it. I don't say that this interface
> be imposed on drivers. If they want they can still call "hwmon_device_register"
> if they don't want to implement standard ioctl, read, write calls.
I guess I don't see why a device that is more than just a monitoring
interface can't allocate a misc device or similar if it needs one.
For the more complex cases take a look at drivers/staging/iio also.
next prev parent reply other threads:[~2011-10-06 15:48 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-05 17:13 Himanshu Chauhan
2011-10-05 18:30 ` Guenter Roeck
2011-10-06 4:06 ` Himanshu Chauhan
2011-10-06 5:19 ` Guenter Roeck
2011-10-06 7:43 ` [lm-sensors] " Jean Delvare
2011-10-06 15:12 ` Himanshu Chauhan
2011-10-06 15:46 ` Alan Cox [this message]
2011-10-06 16:25 ` Himanshu Chauhan
2011-10-06 15:15 ` Guenter Roeck
2011-10-06 16:43 ` Himanshu Chauhan
2011-10-05 19:33 ` Greg KH
2011-10-06 4:10 ` Himanshu Chauhan
2011-10-06 18:25 ` Greg KH
2011-10-06 19:07 ` [lm-sensors] " Guenter Roeck
2011-10-07 6:42 ` Himanshu Chauhan
2011-10-07 6:52 ` Greg KH
2011-10-07 9:56 ` Himanshu Chauhan
2011-10-07 11:11 ` Jonathan Cameron
2011-10-07 15:46 ` Greg KH
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=20111006164600.071213e1@lxorguk.ukuu.org.uk \
--to=alan@lxorguk.ukuu.org.uk \
--cc=guenter.roeck@ericsson.com \
--cc=hschauhan@nulltrace.org \
--cc=khali@linux-fr.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lm-sensors@lm-sensors.org \
/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
all inboxes | Powered by JetHome®