From: Jagan Teki Date: Wed, 10 Aug 2016 10:39:13 +0530 Subject: [U-Boot] [PATCH v2 07/22] sf: Adopt flash table INFO macro from Linux In-Reply-To: <11516e0d-f2dd-cd04-b0a5-4a35ebc18630@ti.com> References: <1470773041-13812-1-git-send-email-jteki@openedev.com> <1470773041-13812-8-git-send-email-jteki@openedev.com> <11516e0d-f2dd-cd04-b0a5-4a35ebc18630@ti.com> Message-ID: <4f6fda59-b3e1-040f-3f7d-d648d36d28e6@openedev.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wednesday 10 August 2016 10:34 AM, Vignesh R wrote: > > > On Wednesday 10 August 2016 01:33 AM, Jagan Teki wrote: >> INFO macro make flash table entries more adjustable like >> adding new flash_info attributes, update ID length bytes >> and so on and more over it will sync to Linux way of defining >> flash_info attributes. > [...] >> diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c >> index 7f6e9ae..58d5a6a 100644 >> --- a/drivers/mtd/spi/spi_flash.c >> +++ b/drivers/mtd/spi/spi_flash.c >> @@ -924,6 +924,31 @@ static int micron_quad_enable(struct spi_flash *flash) >> } >> #endif >> >> +static const struct spi_flash_params *spi_flash_read_id(struct spi_flash *flash) >> +{ >> + int tmp; >> + u8 id[5]; >> + const struct spi_flash_params *params; >> + >> + tmp = spi_flash_cmd(flash->spi, CMD_READ_ID, id, 5); >> + if (tmp < 0) { >> + printf("SF: error %d reading JEDEC ID\n", tmp); >> + return ERR_PTR(tmp); >> + } >> + > > Could we have debug() to print the JEDEC IDs read as before? Not necessary, and anyway jedec id is printing in failure/unsupported case.