lkml.org 
[lkml]   [2006]   [May]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] rtc subsystem, use ENOIOCTLCMD where appropriate
Date
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/



-
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/

\
 
 \ /
  Last update: 2006-05-18 22:33    [W:0.034 / U:0.352 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site