Commit b025605c authored by Jérôme Pouiller's avatar Jérôme Pouiller Committed by Greg Kroah-Hartman
Browse files

staging: wfx: don't print useless error messages



During chip probing, if error does not come from secure boot (for
exemple when firmware has been found), others errors probably appears.

It is not necessary to say to user that the error does not come from
secure boot. So, drop the message saying "no error reported by secure
boot".

BTW, we take the opportunity to simplify print_boot_status().

Signed-off-by: default avatarJérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20191217161318.31402-13-Jerome.Pouiller@silabs.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 46112d55
Loading
Loading
Loading
Loading
+10 −16
Original line number Diff line number Diff line
@@ -61,7 +61,7 @@
#define DCA_TIMEOUT  50 // milliseconds
#define WAKEUP_TIMEOUT 200 // milliseconds

static const char * const fwio_error_strings[] = {
static const char * const fwio_errors[] = {
	[ERR_INVALID_SEC_TYPE] = "Invalid section type or wrong encryption",
	[ERR_SIG_VERIF_FAILED] = "Signature verification failed",
	[ERR_AES_CTRL_KEY] = "AES control key not initialized",
@@ -220,22 +220,16 @@ static int upload_firmware(struct wfx_dev *wdev, const u8 *data, size_t len)

static void print_boot_status(struct wfx_dev *wdev)
{
	u32 val32;
	u32 reg;

	sram_reg_read(wdev, WFX_STATUS_INFO, &val32);
	if (val32 == 0x12345678) {
		dev_info(wdev->dev, "no error reported by secure boot\n");
	} else {
		sram_reg_read(wdev, WFX_ERR_INFO, &val32);
		if (val32 < ARRAY_SIZE(fwio_error_strings) &&
		    fwio_error_strings[val32])
			dev_info(wdev->dev, "secure boot error: %s\n",
				 fwio_error_strings[val32]);
	sram_reg_read(wdev, WFX_STATUS_INFO, &reg);
	if (reg == 0x12345678)
		return;
	sram_reg_read(wdev, WFX_ERR_INFO, &reg);
	if (reg < ARRAY_SIZE(fwio_errors) && fwio_errors[reg])
		dev_info(wdev->dev, "secure boot: %s\n", fwio_errors[reg]);
	else
			dev_info(wdev->dev,
				 "secure boot error: Unknown (0x%02x)\n",
				 val32);
	}
		dev_info(wdev->dev, "secure boot: Error %#02x\n", reg);
}

static int load_firmware_secure(struct wfx_dev *wdev)