u-boot/drivers
Marek Vasut ea9619aed6 sf: Correct data types in stm_is_locked_sr()
The stm_is_locked_sr() function is picked from Linux kernel. For reason
unknown, the 64bit data types used by the function and present in Linux
were replaced with 32bit unsigned ones, which causes trouble.

The testcase performed was done using ST M25P80 chip.
The command used was:
 => sf protect unlock 0 0x10000

The call chain starts in stm_unlock(), which calls stm_is_locked_sr()
with negative ofs argument. This works fine in Linux, where the "ofs"
is loff_t, which is signed long long, while this fails in U-Boot, where
"ofs" is u32 (unsigned int). Because of this signedness problem, the
expression past the return statement to be incorrectly evaluated to 1,
which in turn propagates back to stm_unlock() and results in -EINVAL.

The correction is very simple, just use the correctly sized data types
with correct signedness in the function to make it work as intended.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Reviewed-by: Jagan Teki <jteki@openedev.com>
2016-03-12 19:55:42 +05:30
..
adc sandbox: add ADC driver 2015-11-02 10:38:00 +09:00
bios_emulator dm: pci: Convert bios_emu to use the driver model PCI API 2016-01-24 12:07:19 +08:00
block Use correct spelling of "U-Boot" 2016-02-06 12:00:59 +01:00
bootcount bootcount: Correct #endif comment to match, other aesthetics 2016-01-08 10:15:43 -05:00
clk clk: uniphier: add Media I/O clock driver for UniPhier SoCs 2016-02-14 16:36:13 +09:00
core dm: Remove device_probe_child() 2016-01-28 21:01:23 -07:00
cpu x86: Move MP initialization codes into a common place 2015-07-14 18:03:16 -06:00
crypto powerpc/SECURE_BOOT: Add PAMU driver 2016-02-24 08:40:55 -08:00
ddr Use correct spelling of "U-Boot" 2016-02-06 12:00:59 +01:00
demo drivers: hierarchize drivers Kconfig menu 2015-08-12 20:47:44 -04:00
dfu mmc: store hwpart in the block device 2016-01-13 21:05:19 -05:00
dma drivers: dma: ti-edma3: convert driver to adopt driver model 2016-02-23 16:14:46 +05:30
fpga Revert "arm: socfpga: set the fpga global bit to disable HPS to FPGA signals" 2016-02-04 12:43:21 +01:00
gpio gpio: uniphier: add driver for UniPhier GPIO controller 2016-02-29 03:50:15 +09:00
hwmon mailaddr: Update mail address 2016-01-27 15:32:05 +01:00
i2c mvtwsi: Fix breakage introduced by "Fix mvtwsi not working on sun6i and newer sunxi SoCs" 2016-01-26 17:58:02 +01:00
input tegra: keyboard: Fix the init order 2016-02-16 09:17:49 -07:00
led dm: led: Tidy up SPL options for the led and led-gpio 2015-09-02 21:28:22 -06:00
memory Various Makefiles: Add SPDX-License-Identifier tags 2015-11-10 09:19:52 -05:00
misc superio: Add SMSC SIO1007 driver 2016-02-21 13:42:52 +08:00
mmc mmc: uniphier: add driver for UniPhier SD/MMC host controller 2016-02-29 03:50:15 +09:00
mtd sf: Correct data types in stm_is_locked_sr() 2016-03-12 19:55:42 +05:30
net net: phy: atheros: Fix problem with phy_reset() clearing BMCR 2016-02-26 13:32:37 -06:00
pch x86: pch9: Implement get_io_base op 2016-02-05 12:47:21 +08:00
pci pci: Fix compiler warnings in dm_pciauto_setup_device() 2016-02-26 08:53:10 -07:00
pcmcia powerpc: mpc824x: remove MPC824X cpu support 2015-01-05 12:08:55 -05:00
pinctrl pinctrl: uniphier: guard uniphier directory with CONFIG_PINCTRL_UNIPHIER 2016-03-09 01:11:04 +09:00
power pmic: tps65218: add useful functions and defines 2016-02-24 18:44:07 -05:00
pwm tegra: video: Move LCD driver to use the DM PWM driver 2016-02-16 09:17:53 -07:00
qe board: ls1043ardb: Add micro QE support for ls1043ardb 2016-02-24 08:51:14 -08:00
ram ram: rename CONFIG_SPL_RAM_SUPPORT to CONFIG_SPL_RAM 2015-08-18 13:46:02 -04:00
remoteproc drivers: remoteproc: rproc-uclass: Fix check for NULL pointers 2015-12-05 18:22:32 -05:00
rtc rtc: Add MCP79411 support to DS1307 rtc driver 2015-11-04 15:19:12 -08:00
serial Revert "dm: ns16550: Add support for reg-offset property" 2016-02-29 10:26:20 -05:00
soc Use correct spelling of "U-Boot" 2016-02-06 12:00:59 +01:00
sound of: clean up OF_CONTROL ifdef conditionals 2015-08-18 13:46:05 -04:00
spi dm: ti_qspi: Fix conversion of address to a pointer 2016-03-12 19:55:42 +05:30
thermal imx: mx7: fix the temperature checking for Rev1.1 2016-01-07 17:53:11 +01:00
timer sandbox: timer: Support the early timer 2016-02-26 08:53:10 -07:00
tpm tpm: st33zp24: Add tpm st33zp24 spi support 2016-01-28 21:01:22 -07:00
twserial drivers: convert makefiles to Kbuild style 2013-10-31 13:26:01 -04:00
usb usb: dwc2: disable erroneous overcurrent condition 2016-03-05 02:21:36 +01:00
video video: Add S3C24xx framebuffer support 2016-02-22 18:07:17 +01:00
watchdog imx_watchdog: always set minimal timeout in reset_cpu 2016-01-07 17:54:53 +01:00
Kconfig dm: pwm: Add a PWM uclass 2016-01-21 20:42:36 -07:00
Makefile drivers: ddr: Add DDR2 SDRAM controller driver for Microchip PIC32. 2016-02-01 22:14:01 +01:00