devmem2: fix patch
authorChris Larson <chris_larson@mentor.com>
Wed, 12 Jan 2011 19:39:32 +0000 (12:39 -0700)
committerChris Larson <chris_larson@mentor.com>
Wed, 12 Jan 2011 19:39:41 +0000 (12:39 -0700)
Signed-off-by: Chris Larson <chris_larson@mentor.com>
recipes/devmem2/devmem2.bb
recipes/devmem2/devmem2/devmem2-fixups-2.patch

index 4f92586..e3c444b 100644 (file)
@@ -1,6 +1,6 @@
 DESCRIPTION = "Simple program to read/write from/to any location in memory."
 LICENSE = "GPLv2"
-PR = "r5"
+PR = "r6"
 
 SRC_URI = "http://www.lartmaker.nl/lartware/port/devmem2.c \
            file://devmem2-fixups-2.patch"
index 05dde41..9217734 100644 (file)
@@ -1,5 +1,9 @@
---- devmem2/devmem2.c.orig     2006-08-31 17:21:45.000000000 -0600
-+++ devmem2/devmem2.c  2006-09-02 09:09:29.000000000 -0600
+---
+ devmem2.c |  145 ++++++++++++++++++++++++++++++++++++--------------------------
+ 1 file changed, 86 insertions(+), 59 deletions(-)
+
+--- devmem2-1.0-r5.orig/devmem2.c
++++ devmem2-1.0-r5/devmem2.c
 @@ -20,7 +20,7 @@
   * but WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 -              exit(1);
 -      }
 -      target = strtoul(argv[1], 0, 0);
--
--      if(argc > 2)
--              access_type = tolower(argv[2][0]);
 +    void *map_base, *virt_addr;
 +    unsigned long read_result, write_val;
 +    off_t target;
 +    int access_type = 'w';
 +    char fmt_str[128];
 +    size_t data_size;
-+
+
+-      if(argc > 2)
+-              access_type = tolower(argv[2][0]);
 +    if(argc < 2) {
 +      fprintf(stderr, "\nUsage:\t%s { address } [ type [ data ] ]\n"
 +          "\taddress : memory address to act upon\n"