You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
440 B

  1. --- a/mtd-rw.c
  2. +++ b/mtd-rw.c
  3. @@ -54,7 +54,11 @@ MODULE_PARM_DESC(i_want_a_brick, "Make a
  4. static int set_writeable(unsigned n, bool w)
  5. {
  6. +#ifndef CONFIG_MTD
  7. + struct mtd_info *mtd = -ENOSYS;
  8. +#else
  9. struct mtd_info *mtd = get_mtd_device(NULL, n);
  10. +#endif
  11. int err;
  12. if (IS_ERR(mtd)) {
  13. @@ -76,7 +80,9 @@ static int set_writeable(unsigned n, boo
  14. err = 0;
  15. }
  16. +#ifdef CONFIG_MTD
  17. put_mtd_device(mtd);
  18. +#endif
  19. return err;
  20. }