Re: [PATCH 2/6] staging: ft1000: Use misc device instead self created device.

From: Belisko Marek
Date: Tue Nov 23 2010 - 09:00:44 EST


On Tue, Nov 23, 2010 at 2:53 PM, Jiri Slaby <jirislaby@xxxxxxxxx> wrote:
> On 11/23/2010 01:29 PM, Marek Belisko wrote:
>> Use simple misc device for ioctl driver funtionality testing.
>>
>> Signed-off-by: Marek Belisko <marek.belisko@xxxxxxxxxxxxxxx>
>> ---
>> Âdrivers/staging/ft1000/ft1000-usb/ft1000_chdev.c | Â 90 ++++++++++++++++++---
>> Â1 files changed, 77 insertions(+), 13 deletions(-)
>>
>> diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_chdev.c b/drivers/staging/ft1000/ft1000-usb/ft1000_chdev.c
>> index 1aec926..d1784a3 100644
>> --- a/drivers/staging/ft1000/ft1000-usb/ft1000_chdev.c
>> +++ b/drivers/staging/ft1000/ft1000-usb/ft1000_chdev.c
>> @@ -32,6 +32,7 @@
>> Â#include <linux/poll.h>
>> Â#include <linux/netdevice.h>
>> Â#include <linux/delay.h>
>> +#include <linux/miscdevice.h>
>>
>> Â#include <linux/fs.h>
>> Â#include <linux/kmod.h>
>> @@ -78,6 +79,47 @@ static struct file_operations ft1000fops =
>>    .llseek     = no_llseek,
>> Â};
>>
>> +struct ft1000_misc_device {
>> + Â Â struct miscdevice dev;
>> + Â Â int inf_id;
>> +};
>> +
>> +#define FREE_ID (0xFF)
>> +
>> +/* we support just 3 devices */
>> +#define MAX_DEVICE 3
>
> No, why this should be converted to miscdevice? Leave it as chrdev.
Is there any problem with using miscdev? Old interface create /dev nodes with
calling kernel thread and some usermode_helper or whatever. Just
convert to misc dev
where this is done automatically.
>
> regards,
> --
> js
>

thanks,

marek

--
as simple and primitive as possible
-------------------------------------------------
Marek Belisko - OPEN-NANDRA
Freelance Developer

Ruska Nova Ves 219 | Presov, 08005 Slovak Republic
Tel: +421 915 052 184
skype: marekwhite
icq: 290551086
web: http://open-nandra.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/