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>
gpio: tegra: remove dead code

Tegra is DT only, so remove platform code.
While at it remove unused struct.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
mmc: tegra: fix typo

Missed OR, so we never enabled failure interrupt
status bits, which prevented the eMMC detect logic
to work properly.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
tegra: disable more lowlevel unsafe switch optimizations

fno-jump-tables isn't enough to guard against
gcc switch optimizations that are unsafe to use
in code that runs before relocation.

The switch-tree-conversion opt pass may generate
lookup tables that are placed in the data section
and accessed via absolute adressing, which fails
prior to relocation.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
tegra: source MSELECT clock from CLK_M

We need to reprogram PLL_P at a later time, so
we have to make sure MSELECT is able to operate
correctly when we stop PLL_P.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
tegra: add Tegra3 kconfig symbol

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
tegra: add Tegra3 ramsize detection

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
tegra: add Tegra3 mem initcall

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
tegra: recognize T30 in debug UART code

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
pinctrl: tegra: add Tegra3 driver

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>