From 91fe4da6b61b370e7f22122b07d3e9da8cf6f3b0 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Wed, 28 Oct 2015 17:03:59 +0100 Subject: [PATCH] spi: Add declaration for spi_flash_cmd_bp_unlock This patch removes compilation warning: +../drivers/mtd/spi/sf_probe.c: In function 'spi_flash_validate_params': +../drivers/mtd/spi/sf_probe.c:402:3: warning: implicit declaration of function 'spi_flash_cmd_bp_unlock' [-Wimplicit-function-declaration] Also add missing flash parameter: +../drivers/mtd/spi/sf_probe.c: In function 'spi_flash_validate_params': +../drivers/mtd/spi/sf_probe.c:402:3: error: too few arguments to function 'spi_flash_cmd_bp_unlock' + ret = spi_flash_cmd_bp_unlock(); Signed-off-by: Michal Simek --- drivers/mtd/spi/sf_internal.h | 2 ++ drivers/mtd/spi/sf_probe.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/spi/sf_internal.h b/drivers/mtd/spi/sf_internal.h index f8e426729f4..63d2081f656 100644 --- a/drivers/mtd/spi/sf_internal.h +++ b/drivers/mtd/spi/sf_internal.h @@ -190,6 +190,8 @@ static inline int spi_flash_cmd_write_disable(struct spi_flash *flash) return spi_flash_cmd(flash->spi, CMD_WRITE_DISABLE, NULL, 0); } +int spi_flash_cmd_bp_unlock(struct spi_flash *flash); + /* * Send the read status command to the device and wait for the wip * (write-in-progress) bit to clear itself. diff --git a/drivers/mtd/spi/sf_probe.c b/drivers/mtd/spi/sf_probe.c index c205b192efd..bf84cebd71a 100644 --- a/drivers/mtd/spi/sf_probe.c +++ b/drivers/mtd/spi/sf_probe.c @@ -399,7 +399,7 @@ static int spi_flash_validate_params(struct spi_slave *spi, u8 *idcode, #if defined(CONFIG_SPI_FLASH_SST) if(params->flags == SST_LOCKBP) { int ret; - ret = spi_flash_cmd_bp_unlock(); + ret = spi_flash_cmd_bp_unlock(flash); if (ret) { debug("SF: fail to unlock block protection\n"); return ret; -- 2.47.3