From 02e2b33c1c81d06827e426b0d63e22be0e878c03 Mon Sep 17 00:00:00 2001 From: Alexander Lunev Date: Wed, 3 Nov 2021 07:46:15 +0300 Subject: [PATCH] bcm43xxx: corrected SDIO_CCCR_HIGHSPEED_SHS bit handling --- drivers/wireless/ieee80211/bcm43xxx/bcmf_sdio.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/wireless/ieee80211/bcm43xxx/bcmf_sdio.c b/drivers/wireless/ieee80211/bcm43xxx/bcmf_sdio.c index 76b3ddda78..4b4a410925 100644 --- a/drivers/wireless/ieee80211/bcm43xxx/bcmf_sdio.c +++ b/drivers/wireless/ieee80211/bcm43xxx/bcmf_sdio.c @@ -255,8 +255,12 @@ int bcmf_probe(FAR struct bcmf_sdio_dev_s *sbus) */ ret = bcmf_read_reg(sbus, 0, SDIO_CCCR_HIGHSPEED, &value); + if (ret != OK) + { + goto exit_error; + } - if (ret & SDIO_CCCR_HIGHSPEED_SHS) + if (value & SDIO_CCCR_HIGHSPEED_SHS) { /* If the chip confirms its High-Speed capability, * enable the High-Speed mode. @@ -264,6 +268,10 @@ int bcmf_probe(FAR struct bcmf_sdio_dev_s *sbus) ret = bcmf_write_reg(sbus, 0, SDIO_CCCR_HIGHSPEED, SDIO_CCCR_HIGHSPEED_EHS); + if (ret != OK) + { + goto exit_error; + } } else {