LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Rodolfo Giometti <giometti@enneenne.com>
To: Greg KH <greg@kroah.com>
Cc: linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	David Woodhouse <dwmw2@infradead.org>,
	Dave Jones <davej@redhat.com>
Subject: Re: [PATCH 1/8] LinuxPPS core support.
Date: Mon, 11 Feb 2008 19:31:53 +0100	[thread overview]
Message-ID: <20080211183153.GA19771@enneenne.com> (raw)
In-Reply-To: <20080211152542.GD25505@kroah.com>

On Mon, Feb 11, 2008 at 07:25:42AM -0800, Greg KH wrote:
> On Mon, Feb 11, 2008 at 10:53:46AM +0100, Rodolfo Giometti wrote:
> > On Fri, Feb 08, 2008 at 10:45:31PM -0800, Greg KH wrote:
> > > 
> > > As you are adding sysfs files, please also describe them in
> > > Documentation/ABI/ in this same series of patches.
> > 
> > Ok. I'm going to add them under "testing".
> > 
> > > Why not use a default attribute group?
> > > 
> > > That way the files are created before the uevent is issued, and the
> > > amount of code you have to write is much smaller.
> > 
> > What do you mean exactly? I don't understand what you wish. :'(
> 
> If you use a 'struct device' you can use a default attribute group for
> that device to be created whenever it is added.
> 
> However you are not using the driver core that way, you are just calling
> device_create(), which doesn't work that way.
> 
> But you can just use an attribute group instead, which still saves you a
> lot of code, try using that instead (sysfs_create_group()).
> 
> Or go all the way and embed a 'struct device' in your structure, and
> create a bus, then you can use the default attribute group, although
> that might be a bit more work :)

I see but how can I manage the fact that files "assert" and "clear"
are created according to pps->info.mode field content?

See the code:

int pps_sysfs_create_source_entry(struct pps_device *pps)
{
        int ret;

        /* Create file "assert" and "clear" according to source capability */
        if (pps->info.mode & PPS_CAPTUREASSERT) {
                ret = device_create_file(pps->dev, &dev_attr_assert);
                if (ret)
                        dev_err(pps->dev, "unable to create \"assert\" "
                                        "sysfs entry");
        }

        if (pps->info.mode & PPS_CAPTURECLEAR) {
                ret = device_create_file(pps->dev, &dev_attr_clear);
                if (ret)
                        dev_err(pps->dev, "unable to create \"clear\" "
                                        "sysfs entry");
        }

        ret = device_create_file(pps->dev, &dev_attr_mode);
        if (ret)
                dev_err(pps->dev, "unable to create \"mode\" sysfs entry");

Do you think is better create these files anyway and in case report a
NULL string?

Thanks,

Rodolfo

-- 

GNU/Linux Solutions                  e-mail:    giometti@enneenne.com
Linux Device Driver                             giometti@gnudd.com
Embedded Systems                     		giometti@linux.it
UNIX programming                     phone:     +39 349 2432127

  reply	other threads:[~2008-02-11 18:29 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-08 18:00 LinuxPPS: the PPS Linux implementation Rodolfo Giometti
2008-02-08 18:00 ` [PATCH 1/8] LinuxPPS core support Rodolfo Giometti
2008-02-08 18:00   ` [PATCH 2/8] PPS: basic documentation file Rodolfo Giometti
2008-02-08 18:00     ` [PATCH 3/8] PPS: userland header file for PPS API Rodolfo Giometti
2008-02-08 18:00       ` [PATCH 4/8] PPS: documentation programs and examples Rodolfo Giometti
2008-02-08 18:00         ` [PATCH 5/8] PPS: LinuxPPS clients support Rodolfo Giometti
2008-02-08 18:00           ` [PATCH 6/8] PPS: serial " Rodolfo Giometti
2008-02-08 18:00             ` [PATCH 7/8] PPS: example program to enable PPS support on serial ports Rodolfo Giometti
2008-02-08 18:00               ` [PATCH 8/8] PPS: parallel port clients support Rodolfo Giometti
2008-02-08 19:11   ` [PATCH 1/8] LinuxPPS core support Sam Ravnborg
2008-02-09  6:45   ` Greg KH
2008-02-11  9:53     ` Rodolfo Giometti
2008-02-11 15:25       ` Greg KH
2008-02-11 18:31         ` Rodolfo Giometti [this message]
2008-02-11 18:42           ` Rodolfo Giometti

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=20080211183153.GA19771@enneenne.com \
    --to=giometti@enneenne.com \
    --cc=akpm@linux-foundation.org \
    --cc=davej@redhat.com \
    --cc=dwmw2@infradead.org \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: [PATCH 1/8] LinuxPPS core support.' \
    /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

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).