of_gpio: return error if no device found

of_get_named_gpio_flags used to return 'ret' when no device
is found, but 'ret' is zero here. Return an error instead.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
devfs-core: return new cdev also for mtd partitions

__devfs_add_partition returns the newly created cdev, but in case
of mtd partitions it accidently returns 0. Fix this.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
ARM: at91: add missing break

Otherwise SAM A5d35 would be detected as A5d36.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Acked-by: Bo Shen <voice.shen@atmel.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
treewide: fix signedness mixups in printf format specifiers

This most likely doesn't fix any real bugs, but it's the
right thing to do and reduces the noise level with static
checkers.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
imx-image: don't leak file handle

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
video: displaytimings: remove two broken error messages

The error messages would dereference the just checked NULL
ptr. As those messages don't add much value without further
info just remove them.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
video: imx-ipu-v3: remove unneeded 'dmfc' check

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Suggested-by: Fabio Estevam <festevam@gmail.com>
don't cast negative error codes to unsigned size_t

The cast prevents us from doing proper error checking.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
commands: uimage: remove redundant error message

uimage_verify already prints an error message if the CRC
is wrong. Romove the never reached redundant message in
the caller.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Fix AT91 UDC driver on boards without vbus.

From 4ea2bd2e1ca18136d7cfd61643bc8d8187b1495f Mon Sep 17 00:00:00 2001
From: Owen Kirby <osk@exegin.com>
Date: Wed, 16 Apr 2014 17:45:18 -0700
Subject: [PATCH] Fix AT91 UDC driver on boards without vbus.

While porting Barebox to one of our boards, we found that the AT91 UDC driver
will fail to connect to USB hosts, and will spam the console with errors if
the VBUS pin isn't connected.

Signed-off-by: Owen Kirby <osk@exegin.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
commands: loady: fix Y-Modem/G option name in help message

Actually loady command uses '-g' option for Y-Modem/G mode
selection; see loady() function:

    while ((opt = getopt(argc, argv, "b:t:g")) > 0) {
        switch (opt) {
    ...
        case 'g':
            is_ymodemg = 1;
            break;

By mistake help message show '-y' option for Y-Modem/G mode
selection.

This patch fixes the problem.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
make: fix searchpath of generated autoconf.h

If barebox is builded out-of-tree we don't find the autogenerated
autoconf.h because we search in the srctree.

With this patch we don't get this error message:

cc1: fatal error: /[...]/barebox/include/generated/autoconf.h: No such file or directory

Signed-off-by: Silvio Fricke <silvio.fricke@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
genenv: fix tempdir creation when target is a relative path

when $target is a path relative to $objtree the script fails.
This is because we cd to $basedir and then copy to $tempdir which
then is no longer valid. Fix this by converting $tempdir to an
absolute path first.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Tested-by: Christoph Fritz <chf.fritz@googlemail.com>
mtd: nand-bb: use list_for_each_entry_safe

We need list_for_each_entry_safe in dev_remove_bb_dev since the
list entries are removed during iteration over the list.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reported-by: Alexander Aring <alex.aring@gmail.com>
mtd: nand-mxs: Return bitflips

The read_page hook shall return the number of bitflips. Implement
that.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>