Linux wireless drivers development
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: "Alexis Lothoré" <alexis.lothore@bootlin.com>,
	linux-wireless@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>,
	Adham Abozaeid <adham.abozaeid@microchip.com>,
	Ajay Singh <ajay.kathat@microchip.com>,
	Claudiu Beznea <claudiu.beznea@tuxon.dev>,
	Conor Dooley <conor+dt@kernel.org>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Kalle Valo <kvalo@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>, Rob Herring <robh@kernel.org>,
	devicetree@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH v2 3/4] wifi: wilc1000: Fold chip_allow_sleep()/chip_wakeup() into wlan.c
Date: Tue, 27 Aug 2024 18:23:58 +0200	[thread overview]
Message-ID: <23f8f3c4-31c8-4971-b914-3b36fc0b446b@denx.de> (raw)
In-Reply-To: <9bc68261-9d5a-463c-82e8-c7a630dda79e@bootlin.com>

On 8/27/24 10:14 AM, Alexis Lothoré wrote:
> On 8/23/24 18:08, Marek Vasut wrote:
>> Neither chip_allow_sleep()/chip_wakeup() is used outside of wlan.c .
>> Make both functions static and remove both the exported symbol and
>> entries from wlan.h .
>>
>> Make chip_allow_sleep() return error code in preparation for the
>> follow up patches.
>>
>> Move acquire_bus() and release_bus() to avoid forward declaration
>> of chip_allow_sleep()/chip_wakeup().
>>
>> Signed-off-by: Marek Vasut <marex@denx.de>
>> ---
>> Cc: "David S. Miller" <davem@davemloft.net>
>> Cc: Adham Abozaeid <adham.abozaeid@microchip.com>
>> Cc: Ajay Singh <ajay.kathat@microchip.com>
>> Cc: Alexis Lothoré <alexis.lothore@bootlin.com>
>> Cc: Claudiu Beznea <claudiu.beznea@tuxon.dev>
>> Cc: Conor Dooley <conor+dt@kernel.org>
>> Cc: Eric Dumazet <edumazet@google.com>
>> Cc: Jakub Kicinski <kuba@kernel.org>
>> Cc: Kalle Valo <kvalo@kernel.org>
>> Cc: Krzysztof Kozlowski <krzk+dt@kernel.org>
>> Cc: Marek Vasut <marex@denx.de>
>> Cc: Paolo Abeni <pabeni@redhat.com>
>> Cc: Rob Herring <robh@kernel.org>
>> Cc: devicetree@vger.kernel.org
>> Cc: linux-wireless@vger.kernel.org
>> Cc: netdev@vger.kernel.org
>> ---
>> V2: New patch
>> ---
>>   .../net/wireless/microchip/wilc1000/wlan.c    | 47 +++++++++----------
>>   .../net/wireless/microchip/wilc1000/wlan.h    |  2 -
>>   2 files changed, 23 insertions(+), 26 deletions(-)
>>
>> diff --git a/drivers/net/wireless/microchip/wilc1000/wlan.c b/drivers/net/wireless/microchip/wilc1000/wlan.c
>> index 1aab2f2dc159f..5fbba6876bd07 100644
>> --- a/drivers/net/wireless/microchip/wilc1000/wlan.c
>> +++ b/drivers/net/wireless/microchip/wilc1000/wlan.c
>> @@ -12,20 +12,6 @@
>>   
>>   #define WAKE_UP_TRIAL_RETRY		10000
>>   
>> -static inline void acquire_bus(struct wilc *wilc, enum bus_acquire acquire)
>> -{
>> -	mutex_lock(&wilc->hif_cs);
>> -	if (acquire == WILC_BUS_ACQUIRE_AND_WAKEUP && wilc->power_save_mode)
>> -		chip_wakeup(wilc);
>> -}
>> -
>> -static inline void release_bus(struct wilc *wilc, enum bus_release release)
>> -{
>> -	if (release == WILC_BUS_RELEASE_ALLOW_SLEEP && wilc->power_save_mode)
>> -		chip_allow_sleep(wilc);
>> -	mutex_unlock(&wilc->hif_cs);
>> -}
>> -
>>   static void wilc_wlan_txq_remove(struct wilc *wilc, u8 q_num,
>>   				 struct txq_entry_t *tqe)
>>   {
>> @@ -555,7 +541,7 @@ static struct rxq_entry_t *wilc_wlan_rxq_remove(struct wilc *wilc)
>>   	return rqe;
>>   }
>>   
>> -void chip_allow_sleep(struct wilc *wilc)
>> +static int chip_allow_sleep(struct wilc *wilc)
>>   {
>>   	u32 reg = 0;
>>   	const struct wilc_hif_func *hif_func = wilc->hif_func;
>> @@ -584,7 +570,7 @@ void chip_allow_sleep(struct wilc *wilc)
>>   	while (--trials) {
>>   		ret = hif_func->hif_read_reg(wilc, to_host_from_fw_reg, &reg);
>>   		if (ret)
>> -			return;
>> +			return ret;
> 
> Forwarding error codes sounds like a good idea, but neither this patch nor the
> next one is reading the return value from any chip_allow_sleep[XXX] function, so
> it does not bring much value.

I will add a follow up patch to this one which adds the error handling, 
since there is a lot of it to propagate the errors through. It will be 
in V3.

  reply	other threads:[~2024-08-27 16:42 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-23 16:08 [PATCH v2 1/4] dt-bindings: wireless: wilc1000: Document WILC3000 compatible string Marek Vasut
2024-08-23 16:08 ` [PATCH v2 2/4] wifi: wilc1000: Fold wilc_get_chipid() into wlan.c Marek Vasut
2024-08-23 17:46   ` Simon Horman
2024-08-23 20:38     ` Marek Vasut
2024-08-24 12:44       ` Simon Horman
2024-08-24 21:18         ` Marek Vasut
2024-08-27  7:51   ` Alexis Lothoré
2024-08-27 15:34     ` Marek Vasut
2024-08-28  7:48       ` Alexis Lothoré
2024-08-23 16:08 ` [PATCH v2 3/4] wifi: wilc1000: Fold chip_allow_sleep()/chip_wakeup() " Marek Vasut
2024-08-27  8:14   ` Alexis Lothoré
2024-08-27 16:23     ` Marek Vasut [this message]
2024-08-23 16:08 ` [PATCH v2 4/4] wifi: wilc1000: Add WILC3000 support Marek Vasut
2024-08-27  8:28   ` Alexis Lothoré
2024-08-27 16:31     ` Marek Vasut
2024-08-24  6:22 ` [PATCH v2 1/4] dt-bindings: wireless: wilc1000: Document WILC3000 compatible string Krzysztof Kozlowski
2024-08-24 21:21   ` Marek Vasut

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=23f8f3c4-31c8-4971-b914-3b36fc0b446b@denx.de \
    --to=marex@denx.de \
    --cc=adham.abozaeid@microchip.com \
    --cc=ajay.kathat@microchip.com \
    --cc=alexis.lothore@bootlin.com \
    --cc=claudiu.beznea@tuxon.dev \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=kvalo@kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox