Re: your mail

Alan Cox (alan@lxorguk.ukuu.org.uk)
Wed, 13 Mar 2002 19:43:32 +0000 (GMT)


> It has been tested on x86 for almost 2 years and on Alpha & Sparc too with
> various calculators.

One oddity - some other comments

> +static int tipar_open(struct inode *inode, struct file *file)
> +{
> + unsigned int minor = minor(inode->i_rdev) - TIPAR_MINOR_0;
> +
> + if (minor >= PP_NO)
> + return -ENXIO;
> +
> + init_ti_parallel(minor);
> +
> + MOD_INC_USE_COUNT;

You should remove these and use in 2.4 + . Also what stops multiple
simultaneous runs of init_ti_parallel if two people open it at once ?

> +static unsigned int tipar_poll(struct file *file, poll_table * wait)
> +{
> + unsigned int mask=0;
> + return mask;
> +}

That seems unfinished ??

> +static int tipar_ioctl(struct inode *inode, struct file *file,
> + unsigned int cmd, unsigned long arg)
> + case O_NONBLOCK:
> + file->f_flags |= O_NONBLOCK;
> + return 0;

O_NDELAY is set by fcntl - your driver never needs this.

> + default:
> + retval = -EINVAL;

SuS says -ENOTTY here (lots of drivers get this wrong still)

> +static long long tipar_lseek(struct file * file, long long offset, int origin)
> +{
> + return -ESPIPE;
> +}

There is a generic no_llseek function

> +/* Major & minor number for character devices */
> +#define TIPAR_MAJOR 61

These don't appear to be officially assigned via lanana ?
-
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/