public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Seewer Philippe" <philippe.seewer@bfh.ch>
To: "Kaiwan N Billimoria" <kaiwan@designergraphix.com>
Cc: <linux-kernel@vger.kernel.org>
Subject: Re: Stuck creating sysfs hooks for a driver..
Date: Wed, 15 Feb 2006 09:48:06 +0100	[thread overview]
Message-ID: <43F2EAC6.6070505@bfh.ch> (raw)
In-Reply-To: <pan.2006.02.15.08.46.27.708727@bfh.ch>



On Wed, 15 Feb 2006 13:24:28 +0530, Kaiwan N Billimoria wrote:
> 
> 
>Hello All,
>
>I am in the process of porting a 2.4 temperature sensor device driver (the National 
>Semiconductor LM70CILD-3 temperature sensor eval board) to the 2.6 Linux kernel 
>(specifically to v 2.6.15.3 <http://2.6.15.3>), with the intention of submitting it for inclusion. 
>All ok, except this: am stuck on inserting an entry in /sys instead of /proc for the
>driver (as that is suggested as the new "correct" interface to userspace).
>
>I have read some documentation on sysfs and Rubini's lddbus example in
>the LDD3 book; however, i am still a little confused: do we really need
>to create a new /sys/bus/<driver_name> for each device inserted into
>the lernel at runtime? if (probably) not, where _exactly_ do i create
>my entry, and of course, _how _ exactly?
>
>FYI, my driver is a char driver and does not require a major/minor pair as the UI is via proc, 
>and hopefully now, sysfs.
>(For those interested, pl find the source here: http://www.designergraphix.com/kaiwan/projects/lm70CILD3.c )
>
>So i guess what i'm also trying to say is this: as i don't require a major/minor pair, i'm abviously
>not using register_chrdev() or the cdev() interface..hence i don't have a kobject and auto-inclusion in
>the sysfs tree (isn't that right?). So... how exactly do i get my sysfs hooks in - as the 
>device_create_file() API requires struct device and struct device_attribute parameters.
>
>Have any of you come across sample code/howto/tutorial out there that demonstrates just this (creating 
>arbitrary sysfs hooks)? Request your help as i'm stuck here...(i also looked through
>Documentation/filesystems/sysfs.txt but was unable to properly map it to code...  ). 
>
>Perhaps, as the usual googling did not turn up a full-fledged howto on this topic, it's time for a 
>knowledgeable person(s) out there to write one? I feel this would be v useful in the Documentation/ branch..
>Just a suggestion..
>
>TIA, kaiwan.
> 
> 

Hmmm...

I don't know if this'll really help, but have a look at
drivers/firmware/edd.c

       reply	other threads:[~2006-02-15  8:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <pan.2006.02.15.08.46.27.708727@bfh.ch>
2006-02-15  8:48 ` Seewer Philippe [this message]
2006-02-15  7:54 Stuck creating sysfs hooks for a driver Kaiwan N Billimoria
2006-02-15 22:13 ` Greg KH
2006-02-16 11:33   ` Kaiwan N Billimoria
2006-02-16 12:16     ` Arjan van de Ven
2006-02-16 16:41     ` Greg KH
2006-02-19 13:23     ` Jean Delvare
2006-02-21  6:18       ` Kaiwan N Billimoria

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=43F2EAC6.6070505@bfh.ch \
    --to=philippe.seewer@bfh.ch \
    --cc=kaiwan@designergraphix.com \
    --cc=linux-kernel@vger.kernel.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