chiark / gitweb /
mtd_probe: add needed include, modprobe blacklist flag, and change some whitespace
authorKay Sievers <kay.sievers@vrfy.org>
Wed, 23 Jun 2010 20:29:58 +0000 (22:29 +0200)
committerKay Sievers <kay.sievers@vrfy.org>
Wed, 23 Jun 2010 20:29:58 +0000 (22:29 +0200)
extras/mtd_probe/75-probe_mtd.rules
extras/mtd_probe/mtd_probe.c
extras/mtd_probe/mtd_probe.h
extras/mtd_probe/probe_smartmedia.c

index 1d1b398175d337287ee621a24006eebb27c3297d..184fda58a921fb2585424f60f64780d981e9b0b8 100644 (file)
@@ -1,10 +1,8 @@
-#probe mtd devices for FTL
+# do not edit this file, it will be overwritten on update
 
 ACTION!="add", GOTO="mtd_probe_end"
 
 KERNEL=="mtd*ro", IMPORT{program}="mtd_probe $tempnode"
-KERNEL=="mtd*ro", ENV{MTD_FTL}=="smartmedia", RUN+="/sbin/modprobe sm_ftl"
-
+KERNEL=="mtd*ro", ENV{MTD_FTL}=="smartmedia", RUN+="/sbin/modprobe -bv sm_ftl"
 
 LABEL="mtd_probe_end"
-
index d335b0628aab31281c06612438189bdf50cb31ce..e45867ffa9557dc003c36606f6213d548f2e49fc 100644 (file)
@@ -1,7 +1,4 @@
 /*
- * mtd_probe.c
- * This file is part of mtd_probe
- *
  * Copyright (C) 2010 - Maxim Levitsky
  *
  * mtd_probe is free software; you can redistribute it and/or modify
@@ -16,7 +13,7 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with mtd_probe; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, 
+ * Foundation, Inc., 51 Franklin St, Fifth Floor,
  * Boston, MA  02110-1301  USA
  */
 #include "mtd_probe.h"
@@ -29,8 +26,8 @@
 #include <unistd.h>
 #include <stdlib.h>
 
-int main(int argc, char** argv) {
-
+int main(int argc, char** argv)
+{
        if (argc != 2) {
                printf("usage: mtd_probe /dev/mtd[n]\n");
                return 1;
index 845a7a13d92d0f9d1938f8469088d0380f3dc6ef..30396d07f62b416be7a771b3365010699d4026ac 100644 (file)
@@ -1,7 +1,4 @@
 /*
- * mtd_probe.h
- * This file is part of mtd_probe
- *
  * Copyright (C) 2010 - Maxim Levitsky
  *
  * mtd_probe is free software; you can redistribute it and/or modify
@@ -19,6 +16,7 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, 
  * Boston, MA  02110-1301  USA
  */
+
 #include <mtd/mtd-user.h>
 
 /* Full oob structure as written on the flash */
index ab6edea4b140a09597670deaa58f3eee7cf169a5..78841f05da8fef1664da1e3039c022563cffe471 100644 (file)
@@ -1,7 +1,4 @@
 /*
- * probe_smartmedia.c
- * This file is part of mtd_probe
- *
  * Copyright (C) 2010 - Maxim Levitsky
  *
  * mtd_probe is free software; you can redistribute it and/or modify
@@ -23,7 +20,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <mtd/mtd-user.h>
-
+#include <string.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
@@ -37,9 +34,10 @@ static const uint8_t cis_signature[] = {
 };
 
 
-void probe_smart_media(int mtd_fd, mtd_info_t* info) {
-
+void probe_smart_media(int mtd_fd, mtd_info_t* info)
+{
        char* cis_buffer = malloc(SM_SECTOR_SIZE);
+
        if (!cis_buffer)
                return;