Browse Source

Merge pull request #14912 from blocktrron/pr-k510-mtd-rw

mtd-rw: fix build failure with kernel 5.10
lilik-openwrt-22.03
David Bauer 4 years ago
committed by GitHub
parent
commit
8b61940c82
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 1 deletions
  1. +2
    -1
      kernel/mtd-rw/Makefile
  2. +24
    -0
      kernel/mtd-rw/patches/0001-mtd-disabled.patch

+ 2
- 1
kernel/mtd-rw/Makefile View File

@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=mtd-rw
PKG_VERSION:=git-20160214
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_MIRROR_HASH:=c44db17c3e05079116a1704f277642c9ce6f5ca4fa380c60f7e6d44509dc16be
@ -29,6 +29,7 @@ define KernelPackage/mtd-rw
SUBMENU:=Other modules
TITLE:=Write-enabler for MTD partitions
FILES:=$(PKG_BUILD_DIR)/mtd-rw.ko
DEPENDS:=@!(TARGET_x86||TARGET_bcm27xx||TARGET_octeontx)
endef
define KernelPackage/mtd-rw/description


+ 24
- 0
kernel/mtd-rw/patches/0001-mtd-disabled.patch View File

@ -0,0 +1,24 @@
--- a/mtd-rw.c
+++ b/mtd-rw.c
@@ -54,7 +54,11 @@ MODULE_PARM_DESC(i_want_a_brick, "Make a
static int set_writeable(unsigned n, bool w)
{
+#ifndef CONFIG_MTD
+ struct mtd_info *mtd = -ENOSYS;
+#else
struct mtd_info *mtd = get_mtd_device(NULL, n);
+#endif
int err;
if (IS_ERR(mtd)) {
@@ -76,7 +80,9 @@ static int set_writeable(unsigned n, boo
err = 0;
}
+#ifdef CONFIG_MTD
put_mtd_device(mtd);
+#endif
return err;
}

Loading…
Cancel
Save