u-boot-brain/drivers
Peng Fan 4fbad92e73 mtd: spi: check return value of spi_setup_slave
Need to check value of spi_setup_slave and spi_setup_slave_fdt.
If their return value 'bus' is NULL, there is no need to pass it
to following spi_flash_probe_tail.

If 'bus' is null, the original function flow is as following:
spi_flash_probe
	|->spi_setup_slave
	|->spi_probe_bus_tail
		|->spi_flash_probe_slave
		|->spi_free_slave
Alougth check the pointer in spi_free_slave is ok, checking the return value
of spi_setup_slave and spi_setup_slave_fdt is better.

Before this fix:
"
=> sf probe 0:2
FSL_QSPI: Not a valid cs !
SF: Failed to set up slave
data abort
pc : [<fff66dcc>]          lr : [<fff7628c>]
reloc pc : [<87814dcc>]    lr : [<8782428c>]
sp : fdf4fcf0  ip : e630396c     fp : fe0d0888
r10: fffa2538  r9 : fdf4feb8     r8 : 02625a00
r7 : 00000002  r6 : fff94ec0     r5 : 00000000  r4 : 9355553c
r3 : 1af0593c  r2 : cb3fe030     r1 : fff94eb8  r0 : e59ff018
Flags: nZCv  IRQs off  FIQs off  Mode SVC_32
Resetting CPU ...
"

After this fix:
"
=> sf probe 0:2
FSL_QSPI: Not a valid cs !
Failed to initialize SPI flash at 0:2
"
No data abort using this patch.

Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
2015-04-22 17:06:13 +05:30
..
bios_emulator bios_emulator: Add some VESA interface debugging 2015-01-23 17:24:16 -07:00
block ahci: mmio_base is a virtual address 2015-04-18 16:54:29 -04:00
bootcount qe: move immap_qe.h from arch directory into common directory 2014-07-22 16:25:54 -07:00
core dm: core: Add device children and sibling functions 2015-04-18 11:11:19 -06:00
crypto Merge branch 'master' of git://git.denx.de/u-boot-mpc85xx 2015-03-05 20:50:30 -05:00
ddr MPC8541/MPC8555: Enable SS_EN in DDR_SDRAM_CLK_CNLT register 2015-04-20 10:15:28 -07:00
demo common: Make sure arch-specific map_sysmem() is defined 2015-04-18 11:11:09 -06:00
dfu dfu: nand: Verify writes 2015-03-30 23:24:38 -05:00
dma dma: keystone_nav: remove spurious qm_cfg verification 2014-11-06 11:04:39 -05:00
fpga fpga: xilinx: Show fpga info if defined 2015-01-21 10:25:43 +01:00
gpio sandbox: Move GPIO CONFIGs to Kconfig 2015-04-18 11:11:37 -06:00
hwmon dtt: add ds620 support 2015-04-10 14:23:23 +02:00
i2c sandbox: Move CONFIG_SYS_I2C_SANDBOX to Kconfig 2015-04-18 11:11:38 -06:00
input i8042: Add keyboard enable logic in kbd_reset() 2015-04-18 11:11:16 -06:00
memory ARM: keystone: aemif: move aemif driver to drivers/memory/ti-aemif.c 2014-06-19 17:53:58 -04:00
misc sandbox: cros_ec: Add Kconfig for sandbox EC config 2015-04-18 11:11:16 -06:00
mmc ARM: bcm283x: move SoC headers to mach-bcm283x/include/mach 2015-03-28 09:03:09 -04:00
mtd mtd: spi: check return value of spi_setup_slave 2015-04-22 17:06:13 +05:30
net net: pch_gbe: Fix pch_gbe device name 2015-04-20 17:57:13 -05:00
pci dm: x86: pci: Add a PCI driver for driver model 2015-04-18 11:11:09 -06:00
pcmcia powerpc: mpc824x: remove MPC824X cpu support 2015-01-05 12:08:55 -05:00
power sunxi: axp221: Use vbus-available rather then vbus-usable for vbus-detect 2015-04-15 16:17:17 +02:00
pwm pwm, imx6: add support for pwm modul on imx6 2014-07-23 12:25:42 +02:00
qe net: cosmetic: Fix var naming net <-> eth drivers 2015-04-18 11:11:33 -06:00
rtc remove unnecessary version.h includes 2015-03-24 10:50:50 -04:00
serial serial: pl01x: fix PL010 regression 2015-04-21 10:05:42 -04:00
soc soc: keystone_serdes: generalize configuration mechanism 2014-10-23 11:27:28 -04:00
sound sandbox: exynos: Move CONFIG_SOUND_SANDBOX to Kconfig 2015-04-18 11:11:39 -06:00
spi zynq: spi: Remove unnecessary error condition 2015-04-22 16:49:51 +05:30
thermal dm: Expand and complete Kconfig in drivers/ 2015-02-12 10:35:33 -07:00
tpm sandbox: Move CONFIG_TPM_TIS_SANDBOX to Kconfig 2015-04-18 11:11:38 -06:00
twserial drivers: convert makefiles to Kbuild style 2013-10-31 13:26:01 -04:00
usb net: cosmetic: Fix var naming net <-> eth drivers 2015-04-18 11:11:33 -06:00
video Merge branch 'master' of git://git.denx.de/u-boot-video 2015-04-20 09:13:52 -04:00
watchdog watchdog/imx_watchdog: do not set WCR_WDW 2015-03-25 16:52:16 +01:00
Kconfig Create API to map between CPU physical and bus addresses 2015-04-14 05:47:59 +02:00
Makefile Merge branch 'master' of git://git.denx.de/u-boot-fsl-qoriq 2014-11-26 11:23:26 -05:00