i2c/spi: match of_modaliases

i2c/spi devices in the devicetree often come with a "vendor,device"
comaptible string. These do not match in barebox, so add a
device_match_of_modalias function which does exactly that.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Load PBL into SRAM

This allows to load all the lowlevel init code, including the
uncompressor, inside SRAM and not just the bare init part. This is
useful when pbl is used as a first-stage bootloader but is loaded by an
external firmware.

Signed-off-by: David Vincent <freesilicon@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
mtd: m25p80: set driver id_table

This sets the id_table in the driver correctly so that the driver
can match to the various types of flashes, not only "m25p80".

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
spi: imx: drop use of enum

enum imx_spi_devtype is used as index into an array of controller types.
This makes the controller type handling unnecessarily complicated. Just
drop the enum and instead of an array use different statically initialized
structs and referene them by name.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
spi: imx: Use IS_ENABLED to drop ifdefs

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
spi: imx: Use device ids

To let the driver work on all SoCs without the use of cpu_is_*()

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
remove redundant NULL check on free

free() already checks the pointer to be non
NULL. No need to do it again.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
commands: edit: properly propagate error code

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
common: env: properly propagate error code

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
lib: math: fix return path (numstack may be NULL)

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
lib: libbb: f should never be NULL

We assume it to be non NULL in other places, so
we are in much greater trouble if it actually is.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
usb: ulpi: fix logic-op

Checking register bits is a bitwise operation.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
usb: dfu: fix error path to avoid NULL ptr deref

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
net: usb: smsc95xx: fix wrong phy reset condition

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
net: usb: asix: properly propagate error code

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
mtd: core: avoid possible NULL ptr deref

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
clk: avoid possible NULL ptr deref

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
net: net_read_uint32: assert that only 32 bit are read

On some architectures (e.g. alpha, amd64, arm64, ia64, s390x, mips64)
sizeof(ulong) is 8 which made net_read_uint32 actually read too much and
even returned the wrong value on big endian machines.
(Note the second issue isn't that critical though, because the only
architecture from the list above that uses big endian byte order is s390x
...)

Also change the argument to void * because the pointer is not necessarily
properly aligned.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
nfs: fix mount prog version in portmap lookup

We're speaking rpc mount version 2 (i.e. the same version as the
implemented nfs protocol), so also specify that in the lookup.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
nfs: skip over stale rpc packets

When a former transaction was aborted by hitting Ctrl-C the old reply might
still hang in the ethernet controller making all further transactions fail.

So just skip over old replies.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>