2008-05-22 09:47:31     Warnings in Character driver

Document created by Aaronwu Employee on Aug 6, 2013
Version 1Show Document
  • View in full screen mode

2008-05-22 09:47:31     Warnings in Character driver

Appalayagari Sreedhar (INDIA)

Message: 56145   

 

Hi,

 

I am writing a character driver for my flash device.

 

I am facing some warnings.

 

drivers/FLASH/flash.c: In function âFLASH_Readâ:

drivers/FLASH/flash.c:131: warning: âcliâ is deprecated (declared at include/linux/interrupt.h:197)

drivers/FLASH/flash.c:154: warning: âstiâ is deprecated (declared at include/linux/interrupt.h:201)

drivers/FLASH/flash.c: In function âFLASH_Writeâ:

drivers/FLASH/flash.c:282: warning: âcliâ is deprecated (declared at include/linux/interrupt.h:197)

drivers/FLASH/flash.c:289: warning: âstiâ is deprecated (declared at include/linux/interrupt.h:201)

drivers/FLASH/flash.c: At top level:

drivers/FLASH/flash.c:565: warning: initialization from incompatible pointer type

drivers/FLASH/flash.c:566: warning: initialization from incompatible pointer type

drivers/FLASH/flash.c:567: warning: initialization from incompatible pointer type

 

In the driver file i have programmed like this.

 

static const struct file_operations m28w640_fops = {

 

        .owner          = THIS_MODULE,

        .read           = read_m28w640hs_flash,

        .write          = write_m28w640hs_flash,

        .ioctl          = ioctl_m28w640hs_flash,

        .open           = open_m28w640hs_flash,

        .release        = close_m28w640hs_flash,

};

 

 

 

Can someone tell me  how to remove these warnings and also is i am doing wrong anything.

 

Thanks in advance.

 

Best Regards,Sreedhar.

 

 

QuoteReplyEditDelete

 

 

2008-05-22 12:24:46     Re: Warnings in Character driver

Mike Frysinger (UNITED STATES)

Message: 56153   

 

the warning messages include line numbers for you to read and figure out what you're doing wrong

 

but more importantly, why are you writing a character driver for a flash device ?  those are exposed as MTD devices, not char devices.  and further, why are you even writing your own driver ?  that chip is CFI compliant which means it should just work if you declare the resources properly.  refer to the way we handle the parallel flash for our ezkits/stamps.

QuoteReplyEditDelete

 

 

2008-05-23 02:43:24     Re: Warnings in Character driver

Appalayagari Sreedhar (INDIA)

Message: 56168   

 

Thanks Mike,

 

I tried to clear the warnings, but i could not do it so i have posted it in forum, anyway thankyou very much.

 

I tried to use the existing cfi mtd drivers but i could not as i am new to uclinux.

 

Will there be any problem if write as a character driver for flash devices.

 

I want to know whether it will create any problem if i write the character driver for mtd devices.

 

Can you help me how to work with mtd driver. I tried enabling the cfi driver. but i did not succeded.

 

Best Regards,Sreedhar.

QuoteReplyEditDelete

 

 

2008-05-23 02:54:23     Re: Warnings in Character driver

Mike Frysinger (UNITED STATES)

Message: 56170   

 

if you dont write a mtd driver, you get to waste your time reimplementing every utility out there to access flash media that you may need so that it works with your custom char driver that no one will support ... your choice

 

as i said, you can check out how we access the different parallel flashes on the stamps and ezkits by simply using the physmap flashing and telling it to prob the memory region with the cfi driver.  you can try starting here:

http://docs.blackfin.uclinux.org/doku.php?id=enabling_jffs2

Attachments

    Outcomes