spi: Use error return value in sf_ops
authorSimon Glass <sjg@chromium.org>
Tue, 14 Oct 2014 05:42:05 +0000 (23:42 -0600)
committerSimon Glass <sjg@chromium.org>
Wed, 22 Oct 2014 16:36:50 +0000 (10:36 -0600)
commitae242cbfd0fc2b9e791688b3d9d6a19900ff3d31
tree979374b651b6093922481786d08a44a2cd76ec42
parentff0960f9a018952cbaab59c0d87b6e0338c8f04c
spi: Use error return value in sf_ops

Adjust spi_flash_probe_slave() to return an error value instead of a
pointer so we get the correct error return.

Have the caller allocate memory for spi_flash to simplify error handling,
and also so that driver model can use its existing allocated memory.

Add a spi.h include in the sf_params file.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
drivers/mtd/spi/sf_probe.c