From 5f307a98fadcded368bbe8f95c445d0cc152a93e Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Wed, 23 Jun 2010 22:29:58 +0200 Subject: [PATCH] mtd_probe: add needed include, modprobe blacklist flag, and change some whitespace --- extras/mtd_probe/75-probe_mtd.rules | 6 ++---- extras/mtd_probe/mtd_probe.c | 9 +++------ extras/mtd_probe/mtd_probe.h | 4 +--- extras/mtd_probe/probe_smartmedia.c | 10 ++++------ 4 files changed, 10 insertions(+), 19 deletions(-) diff --git a/extras/mtd_probe/75-probe_mtd.rules b/extras/mtd_probe/75-probe_mtd.rules index 1d1b39817..184fda58a 100644 --- a/extras/mtd_probe/75-probe_mtd.rules +++ b/extras/mtd_probe/75-probe_mtd.rules @@ -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" - diff --git a/extras/mtd_probe/mtd_probe.c b/extras/mtd_probe/mtd_probe.c index d335b0628..e45867ffa 100644 --- a/extras/mtd_probe/mtd_probe.c +++ b/extras/mtd_probe/mtd_probe.c @@ -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 #include -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; diff --git a/extras/mtd_probe/mtd_probe.h b/extras/mtd_probe/mtd_probe.h index 845a7a13d..30396d07f 100644 --- a/extras/mtd_probe/mtd_probe.h +++ b/extras/mtd_probe/mtd_probe.h @@ -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 /* Full oob structure as written on the flash */ diff --git a/extras/mtd_probe/probe_smartmedia.c b/extras/mtd_probe/probe_smartmedia.c index ab6edea4b..78841f05d 100644 --- a/extras/mtd_probe/probe_smartmedia.c +++ b/extras/mtd_probe/probe_smartmedia.c @@ -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 #include #include - +#include #include #include #include @@ -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; -- 2.30.2