On Linux the ease and write size have to be aligned. This patch uses step_size
(which is already aligned to erase block size) during erase, aligns full_size
to writesize and uses it while writing.
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
- convert "." in variable names to "_"
- use supplied state name instead of hardcoded "STATE_" as prefix
- let OPT_DUMP_SHELL start after all chars
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This patch changes the -i, --init parameter to initialize the state storage and
_not_ load the contents. The original behaviour was to load and not fail on
error.
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Which is faster than walking over the filesystem representation of the device
tree in /proc or /sys.
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
src/libdt.c:97:11: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
printf(data);
^~~~
src/libdt.c:2241:5: warning: data argument not used by format string [-Wformat-extra-args]
node->full_name);
^
src/libdt.c:2248:54: warning: more '%' conversions than data arguments [-Wformat]
fprintf(stderr, "%s: no 'label' property found in %s\n", partition_node->full_name);
~^
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
When asked to initialize the state with the --init option
actually store the state, even when no variable is modified.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
We used to describe the backend with a combination of a nodepath
and partname:<name>. This is cumbersome and error prone to parse.
Instead, describe the backend with a phandle that directly points
to the partition. The resulting code is easier to read and the
devicetrees are easier to understand. Tested with both mtd and
EEPROM device, both with partitions with an offset != 0.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Error handling in scripts cannot work correctly when error messages are
sent to stdout. Send them to stderr instead where they belong to.
To not confuse scripts by debug output, sent this type of messages to stderr as
well.
Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This implementation of 'pr_debug' does not need a device...
Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
In order to enable more debug output the symbol DEBUG must be defined and
not ENABLE_DEBUG.
Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Instead of matching DOS partitions with partname:<number> this
should be made explicit with a different type parser, like dospartid:<id>.
Since this is unused just remove it for now.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
mmc devices only have a "name" property that reads 00000.
The partitions have a property "partition" telling the
partition index.
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
strdup will segfault, if udev_device_get_devnode does not find the part.
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>