public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rtc subsystem, use ENOIOCTLCMD where appropriate
Date: Thu, 18 May 2006 13:30:03 -0700 (PDT)	[thread overview]
Message-ID: <e4ilgb$f10$1@terminus.zytor.com> (raw)
In-Reply-To: 20060517232742.2ac4ccaa@inspiron

Followup to:  <20060517232742.2ac4ccaa@inspiron>
By author:    Alessandro Zummo <alessandro.zummo@towertech.it>
In newsgroup: linux.dev.kernel
> > 
> > and ENOTTY is the return value for "Inappropriate ioctl for device":
> >
> 
>  you're right. I'll go for ENOTTY. thanks.
> 

ENOIOCTLCMD is right here, *except* in the very last hunk, because
it's a request to the upper layers to emulate the operation:

> --- linux-rtc.orig/drivers/rtc/rtc-dev.c	2006-05-17 01:18:19.000000000 +0200
> +++ linux-rtc/drivers/rtc/rtc-dev.c	2006-05-17 01:26:01.000000000 +0200
> @@ -141,13 +141,13 @@ static int rtc_dev_ioctl(struct inode *i
>  	/* try the driver's ioctl interface */
>  	if (ops->ioctl) {
>  		err = ops->ioctl(class_dev->dev, cmd, arg);
> -		if (err != -EINVAL)
> +		if (err != -ENOIOCTLCMD)
>  			return err;
>  	}
>  
>  	/* if the driver does not provide the ioctl interface
>  	 * or if that particular ioctl was not implemented
> -	 * (-EINVAL), we will try to emulate here.
> +	 * (-ENOIOCTLCMD), we will try to emulate here.
>  	 */
>  
>  	switch (cmd) {
> @@ -233,7 +233,7 @@ static int rtc_dev_ioctl(struct inode *i
>  		break;
>  
>  	default:
> -		err = -EINVAL;
> +		err = -ENOIOCTLCMD;
>  		break;
>  	}
>  

The last hunk should be ENOTTY.

	-hpa


---
~Randy
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/




  reply	other threads:[~2006-05-18 20:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-16 23:30 [PATCH] rtc subsystem, use ENOIOCTLCMD where appropriate Alessandro Zummo
2006-05-17 21:25 ` Randy.Dunlap
2006-05-17 21:27   ` Alessandro Zummo
2006-05-18 20:30     ` H. Peter Anvin [this message]
2006-05-18 22:32       ` Ingo Oeser
2006-05-18 22:38         ` H. Peter Anvin

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='e4ilgb$f10$1@terminus.zytor.com' \
    --to=hpa@zytor.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