Hi All, Thanks Greg, this is the problem.... I have changed to O_RDWD and works fine.
Thanks. -----Mensaje original----- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] En nombre de Greg Ungerer Enviado el: domingo, 24 de junio de 2007 14:22 Para: uClinux development list Asunto: Re: [uClinux-dev] function write in char driver (ARM - AT91) Hi Ramon, rflores wrote: >[snip] > The code in the application side is: > > > > /int fd;/ > > /char buf[80];/ > > /fd = open (/dev/swspi,rw);/ ^^^^ Not an appropriate argument type for this field. The flags field of open() is an int. Read the "open" manual page for details. Regards Greg > > /if (fd == -1){/ > > / printf(\nUnable to open device\n);/ > > / return (-1);/ > > /}/ > > /printf(\nSpi device descriptor = %d\n,fd);/ > > /strcpy(buf,\nSWPI write function\n);/ > > /printf(write return = %d,write(fd,buf,sizeof(buf)));/ > > / / > > > > And the execution is: > > > > Sash command shell (version 1.1.1) > > /> > > /> > > /> llaccess test > > SWSPI: Open > > > > Spi device descriptor = 3 > > > > write return = -1 > > SWSPI: Close > > /> > > > > Where is the problem? Why doesnt the kernel call to spi_write when the > application invokes the write function? > > > > Thanks in advance > > > > Ramón Flores > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > uClinux-dev mailing list > [email protected] > http://mailman.uclinux.org/mailman/listinfo/uclinux-dev > This message was resent by [email protected] > To unsubscribe see: > http://mailman.uclinux.org/mailman/options/uclinux-dev -- ------------------------------------------------------------------------ Greg Ungerer -- Chief Software Dude EMAIL: [EMAIL PROTECTED] SnapGear -- a Secure Computing Company PHONE: +61 7 3435 2888 825 Stanley St, FAX: +61 7 3891 3630 Woolloongabba, QLD, 4102, Australia WEB: http://www.SnapGear.com _______________________________________________ uClinux-dev mailing list [email protected] http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by [email protected] To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev _______________________________________________ uClinux-dev mailing list [email protected] http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by [email protected] To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev
