[prev in list] [next in list] [prev in thread] [next in thread] 

List:       uclinux-dev
Subject:    RE: [uClinux-dev] function write in char driver (ARM - AT91)
From:       "rflores" <rflores () gcmcom ! com>
Date:       2007-06-25 7:46:41
Message-ID: 20070625074602.598D584851 () mail ! gcmcom ! info
[Download RAW message or body]

Hi All,

Thanks Greg, this is the problem.... I have changed to O_RDWD and works
fine.

Thanks.

-----Mensaje original-----
De: uclinux-dev-bounces@uclinux.org [mailto:uclinux-dev-bounces@uclinux.org]
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 doesn’t the kernel call to spi_write when the 
> application invokes the write function?
> 
>  
> 
> Thanks in advance
> 
>  
> 
> Ramón Flores
> 
>  
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> uClinux-dev mailing list
> uClinux-dev@uclinux.org
> http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
> This message was resent by uclinux-dev@uclinux.org
> To unsubscribe see:
> http://mailman.uclinux.org/mailman/options/uclinux-dev


-- 
------------------------------------------------------------------------
Greg Ungerer  --  Chief Software Dude       EMAIL:     gerg@snapgear.com
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
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

_______________________________________________
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic