Changeset 691 for trunk/ft2232_spi.c


Ignore:
Timestamp:
Aug 19, 2009 3:27:58 PM (4 years ago)
Author:
hailfinger
Message:

If FT2232H SPI is not enabled, it should be compiled out completely. We
can't remove ft2232_spi.o from unconditional OBJS yet due to our
makefile structure (make features), but this patch adds #ifdefs around
all FT2232H code, so the net effect is the same.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@…>
Acked-by: Stefan Reinauer <stepan@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ft2232_spi.c

    r679 r691  
    1818 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA 
    1919 */ 
     20 
     21#if FT2232_SPI_SUPPORT == 1 
    2022 
    2123#include <stdio.h> 
     
    2628#include "flash.h" 
    2729#include "spi.h" 
    28  
    29 #if FT2232_SPI_SUPPORT == 1 
    30  
    3130#include <ftdi.h> 
    3231 
     
    298297} 
    299298 
    300 #else 
    301 int ft2232_spi_init(void) 
    302 { 
    303         fprintf(stderr, "FT2232 SPI support was not compiled in\n"); 
    304         exit(1); 
    305 } 
    306  
    307 int ft2232_spi_send_command(unsigned int writecnt, unsigned int readcnt, 
    308                 const unsigned char *writearr, unsigned char *readarr) 
    309 { 
    310         fprintf(stderr, "FT2232 SPI support was not compiled in\n"); 
    311         exit(1); 
    312 } 
    313  
    314 int ft2232_spi_read(struct flashchip *flash, uint8_t *buf, int start, int len) 
    315 { 
    316         fprintf(stderr, "FT2232 SPI support was not compiled in\n"); 
    317         exit(1); 
    318 } 
    319  
    320 int ft2232_spi_write_256(struct flashchip *flash, uint8_t *buf) 
    321 { 
    322         fprintf(stderr, "FT2232 SPI support was not compiled in\n"); 
    323         exit(1); 
    324 } 
    325299#endif 
Note: See TracChangeset for help on using the changeset viewer.