meta-digi-arm: Patch kobs-ng for 3.10 kernel.

Signed-off-by: Alex Gonzalez <alex.gonzalez@digi.com>
This commit is contained in:
Alex Gonzalez 2013-07-11 18:29:56 +02:00
parent f5aa5e1a74
commit 107be1bf23
3 changed files with 113 additions and 0 deletions

View File

@ -0,0 +1,68 @@
From b8b59262cfddf3ddc68708ce0b242781df4377ae Mon Sep 17 00:00:00 2001
From: Alex Gonzalez <alex.gonzalez@digi.com>
Date: Thu, 11 Jul 2013 17:56:40 +0200
Subject: [PATCH] Remove MEMSETOOBSEL ioctl call.
It has been removed a long time ago, it does nothing on 2.6.35, and it
was finally removed from the ABI later on so it's not available on 3.10
header.
Signed-off-by: Alex Gonzalez <alex.gonzalez@digi.com>
---
src/mtd.c | 23 -----------------------
1 file changed, 23 deletions(-)
diff --git a/src/mtd.c b/src/mtd.c
index 4dbb878..0ae1ece 100644
--- a/src/mtd.c
+++ b/src/mtd.c
@@ -426,8 +426,6 @@ void mtd_dump(struct mtd_data *md)
}
-static struct nand_oobinfo none_oobinfo = { .useecc = MTD_NANDECC_OFF };
-
int parse_nfc_geometry(struct mtd_data *md)
{
FILE *node;
@@ -766,8 +764,6 @@ void mtd_close(struct mtd_data *md)
mp = &md->part[i];
if (mp->fd != -1) {
- (void)ioctl(mp->fd, MEMSETOOBSEL,
- &mp->old_oobinfo);
close(mp->fd);
}
@@ -809,31 +805,12 @@ int mtd_set_ecc_mode(struct mtd_data *md, int ecc)
fprintf(stderr, "mtd: device %s can't switch to normal\n", mp->name);
continue;
}
-
- if (r == -ENOTTY) {
- r = ioctl(mp->fd, MEMSETOOBSEL, &mp->old_oobinfo);
- if (r != 0) {
- fprintf(stderr, "mtd: device %s can't ioctl MEMSETOOBSEL\n", mp->name);
- continue;
- }
- mp->oobinfochanged = 0;
- }
} else {
r = ioctl(mp->fd, MTDFILEMODE, (void *)MTD_MODE_RAW);
if (r != 0 && r != -ENOTTY) {
fprintf(stderr, "mtd: device %s can't switch to RAW\n", mp->name);
continue;
}
-
- if (r == -ENOTTY) {
- r = ioctl(mp->fd, MEMSETOOBSEL, &none_oobinfo);
- if (r != 0) {
- fprintf(stderr, "mtd: device %s can't ioctl MEMSETOOBSEL\n", mp->name);
- continue;
- }
- mp->oobinfochanged = 1;
- } else
- mp->oobinfochanged = 2;
}
mp->ecc = ecc;

View File

@ -0,0 +1,41 @@
From 3284813587c14ff30f64df56a830a48c6be8cbb2 Mon Sep 17 00:00:00 2001
From: Alex Gonzalez <alex.gonzalez@digi.com>
Date: Thu, 11 Jul 2013 18:06:41 +0200
Subject: [PATCH] Rename MTD_MODE_* to MTD_FILE_MODE_*
On the 3.10 kernel, this ioctl has changed name.
Signed-off-by: Alex Gonzalez <alex.gonzalez@digi.com>
---
src/mtd.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/mtd.c b/src/mtd.c
index 0ae1ece..79734fb 100644
--- a/src/mtd.c
+++ b/src/mtd.c
@@ -614,7 +614,7 @@ struct mtd_data *mtd_open(const struct mtd_config *cfg, int flags)
miu = &mp->info;
- r = ioctl(mp->fd, MTDFILEMODE, (void *)MTD_MODE_NORMAL);
+ r = ioctl(mp->fd, MTDFILEMODE, (void *)MTD_FILE_MODE_NORMAL);
if (r != 0 && r != -ENOTTY) {
fprintf(stderr, "mtd: device %s can't switch to normal\n", mp->name);
goto out;
@@ -800,13 +800,13 @@ int mtd_set_ecc_mode(struct mtd_data *md, int ecc)
continue;
if (ecc == 1) {
- r = ioctl(mp->fd, MTDFILEMODE, (void *)MTD_MODE_NORMAL);
+ r = ioctl(mp->fd, MTDFILEMODE, (void *)MTD_FILE_MODE_NORMAL);
if (r != 0 && r != -ENOTTY) {
fprintf(stderr, "mtd: device %s can't switch to normal\n", mp->name);
continue;
}
} else {
- r = ioctl(mp->fd, MTDFILEMODE, (void *)MTD_MODE_RAW);
+ r = ioctl(mp->fd, MTDFILEMODE, (void *)MTD_FILE_MODE_RAW);
if (r != 0 && r != -ENOTTY) {
fprintf(stderr, "mtd: device %s can't switch to RAW\n", mp->name);
continue;

View File

@ -15,6 +15,10 @@ SRC_URI = "${DIGI_MIRROR}/${PN}-${PV}.tar.gz \
"
SRC_URI_append_ccardimx28js += "file://0005-version-parse-MX-arch-to-select-rom-version.patch"
SRC_URI_append = '${@base_version_less_or_equal("PREFERRED_VERSION_linux-dey", "2.6.35.14", "", " \
file://0006-Remove-MEMSETOOBSEL-ioctl-call.patch \
file://0007-Rename-MTD_MODE_-to-MTD_FILE_MODE_.patch \
", d)}'
SRC_URI[md5sum] = "9fce401b6c90e851f0335b9ca3a649a9"
SRC_URI[sha256sum] = "ef25f5c9033500c236b1894436bddc4e20b90bc17585fbcdf9fe3bbbd9f15781"