Nico Huber submitted this change.

View Change

Approvals: build bot (Jenkins): Verified Nico Huber: Looks good to me, approved
linux_spi: reorder includes for linux <4.14

This works around a missing header in spidev.h present in older
versions of Linux. Patch is ported from:
https://git.buildroot.net/buildroot/tree/package/flashrom/0001-spi.patch

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: David Hendricks <david.hendricks@gmail.com>
Change-Id: Ieab60f59bc63aca0dc4867f31699dab4167da05b
Reviewed-on: https://review.coreboot.org/c/flashrom/+/35830
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
---
M linux_spi.c
1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/linux_spi.c b/linux_spi.c
index e3d7486..aa73c18 100644
--- a/linux_spi.c
+++ b/linux_spi.c
@@ -26,12 +26,17 @@
#include <unistd.h>
#include <sys/ioctl.h>
#include <linux/types.h>
-#include <linux/spi/spidev.h>
-#include <linux/ioctl.h>
#include "flash.h"
#include "chipdrivers.h"
#include "programmer.h"
#include "spi.h"
+/*
+ * Linux versions prior to v4.14-rc7 may need linux/ioctl.h included here due
+ * to missing from linux/spi/spidev.h. This was fixed in the following commit:
+ * a2b4a79b88b2 spi: uapi: spidev: add missing ioctl header
+ */
+#include <linux/ioctl.h>
+#include <linux/spi/spidev.h>

/* Devices known to work with this module (FIXME: export as struct dev_entry):
* Beagle Bone Black

To view, visit change 35830. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ieab60f59bc63aca0dc4867f31699dab4167da05b
Gerrit-Change-Number: 35830
Gerrit-PatchSet: 5
Gerrit-Owner: David Hendricks <david.hendricks@gmail.com>
Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com>
Gerrit-Reviewer: David Hendricks <david.hendricks@gmail.com>
Gerrit-Reviewer: Nico Huber <nico.h@gmx.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter@users.sourceforge.net>
Gerrit-MessageType: merged