diff options
author | stefanct <stefanct@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1> | 2012-03-13 00:18:19 +0000 |
---|---|---|
committer | stefanct <stefanct@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1> | 2012-03-13 00:18:19 +0000 |
commit | d8595e7cce12464667a11aa55e5241e5060fe5e5 (patch) | |
tree | b10ec294018a6fd534f4676587332beb7b654f45 /linux_spi.c | |
parent | 870bbe0db4e7ce2040cb4575ba9713dcc8beb145 (diff) | |
download | flashrom-d8595e7cce12464667a11aa55e5241e5060fe5e5.tar.gz |
Make the presence of Linux SPI headers mandatory for linux_spi.
This solution is copied from ft2232_spi and is equally hacky.
Thanks to M.K. for investigating the history of <linux/spi/spidev.h>, which
led to a hopefully more robust check.
Signed-off-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>
Acked-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>
git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@1517 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'linux_spi.c')
-rw-r--r-- | linux_spi.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/linux_spi.c b/linux_spi.c index 17d003e..f4d30c9 100644 --- a/linux_spi.c +++ b/linux_spi.c @@ -17,6 +17,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#if CONFIG_LINUX_SPI == 1 + #include <stdio.h> #include <string.h> #include <stdlib.h> @@ -24,6 +26,7 @@ #include <errno.h> #include <ctype.h> #include <unistd.h> +#include <linux/types.h> #include <linux/spi/spidev.h> #include <sys/ioctl.h> #include "flash.h" @@ -176,3 +179,5 @@ static int linux_spi_write_256(struct flashctx *flash, uint8_t *buf, return spi_write_chunked(flash, buf, start, len, ((unsigned int)getpagesize()) - 4); } + +#endif // CONFIG_LINUX_SPI == 1 |