mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Richard Gooch <rgooch@ras.ucalgary.ca>
To: arjanv@redhat.com
Cc: Per Niva <pna@mendosus.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Added devfs support for i386 msr/cpuid driver
Date: Mon, 27 Aug 2001 08:52:45 -0600	[thread overview]
Message-ID: <200108271452.f7REqjT15752@vindaloo.ras.ucalgary.ca> (raw)
In-Reply-To: <3B8A2C1F.63AF4AE7@redhat.com>
In-Reply-To: <Pine.LNX.4.33.0108271031010.12684-102000@subcentral.mendosus.org> <3B8A2C1F.63AF4AE7@redhat.com>

Arjan van de Ven writes:
> > 
> >  int __init msr_init(void)
> >  {
> > +#ifdef CONFIG_DEVFS_FS
> > +    devfs_handle = devfs_register(NULL, "cpu/msr", DEVFS_FL_DEFAULT, 0, 0,
> > +                                  S_IFREG | S_IRUGO | S_IWUSR,
> > +                                  &msr_fops, NULL);
> > +#else
> >    if (register_chrdev(MSR_MAJOR, "cpu/msr", &msr_fops)) {
> >      printk(KERN_ERR "msr: unable to get major %d for msr\n",
> >            MSR_MAJOR);
> >      return -EBUSY;
> >    }
> > +#endif
> 
> this must be wrong as you don't check for devfs_register failures...

The reason it's wrong is because he put #ifdef's in there. The
functions should just be called unconditionally. The #ifdef's are in
the header.

> Also why devfs can't just use register_chrdev and not touch ALL
> drivers is beyond me, but it has been like that for a while now...

Huh?!? I thought that should be obvious. Think about it,
register_chrdev() registers a *major*, whereas devfs_register()
registers an individual device node. The former has no way of
representing which devices are detected, the latter sets up a 1:1
relationship between devices and device nodes (which is what people
actually want).

				Regards,

					Richard....
Permanent: rgooch@atnf.csiro.au
Current:   rgooch@ras.ucalgary.ca

  parent reply	other threads:[~2001-08-27 14:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-27  8:43 Per Niva
2001-08-27 11:16 ` Arjan van de Ven
2001-08-27 14:52 ` Richard Gooch [this message]
2001-08-27 14:55   ` Per Niva
2001-09-03 19:57   ` Richard Gooch

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=200108271452.f7REqjT15752@vindaloo.ras.ucalgary.ca \
    --to=rgooch@ras.ucalgary.ca \
    --cc=arjanv@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pna@mendosus.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®