diff mbox series

wifi: ath11k: Use of_property_present() to test property presence

Message ID 20250408190211.2505737-2-robh@kernel.org (mailing list archive)
State Accepted
Delegated to: Jeff Johnson
Headers show
Series wifi: ath11k: Use of_property_present() to test property presence | expand

Checks

Context Check Description
wifibot/fixes_present success Fixes tag not required for -next series
wifibot/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
wifibot/tree_selection success Guessed tree name to be wireless-next
wifibot/ynl success Generated files up to date; no warnings/errors; no diff in generated;
wifibot/build_clang fail Errors and warnings before: 8 this patch: 11
wifibot/build_32bit success Errors and warnings before: 0 this patch: 0
wifibot/build_allmodconfig_warn fail Errors and warnings before: 9 this patch: 9
wifibot/build_clang_rust success No Rust files in patch. Skipping build
wifibot/build_tools success No tools touched, skip
wifibot/check_selftest success No net selftest shell script
wifibot/checkpatch success total: 0 errors, 0 warnings, 0 checks, 17 lines checked
wifibot/deprecated_api success None detected
wifibot/header_inline success No static functions without inline keyword in header files
wifibot/kdoc success Errors and warnings before: 0 this patch: 0
wifibot/source_inline success Was 0 now: 0
wifibot/verify_fixes success No Fixes tag
wifibot/verify_signedoff success Signed-off-by tag matches author and committer

Commit Message

Rob Herring (Arm) April 8, 2025, 7:02 p.m. UTC
The use of of_property_read_u32() isn't really correct as
"memory-region" contains phandles (though those happen to be u32s. As
it is just testing for property presence, use of_property_present()
instead.

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
---
I'm assuming this should still go to linux-wireless list? I had to 
manually add that, so looks like recent MAINTAINERS changes aren't quite 
right.

 drivers/net/wireless/ath/ath11k/pci.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Jeff Johnson April 10, 2025, 5:29 p.m. UTC | #1
On 4/8/2025 12:02 PM, Rob Herring (Arm) wrote:
> The use of of_property_read_u32() isn't really correct as
> "memory-region" contains phandles (though those happen to be u32s. As
> it is just testing for property presence, use of_property_present()
> instead.
> 
> Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
> ---
> I'm assuming this should still go to linux-wireless list? I had to 
> manually add that, so looks like recent MAINTAINERS changes aren't quite 
> right.

Yes, it should go to both ath11k and linux-wireless

Johannes has a fix that needs to make its way through the trees:
https://msgid.link/20250329220135.8bfaffbad97d.I946354c2395f4a30b8c435857a92553b1b58df5b@changeid

> 
>  drivers/net/wireless/ath/ath11k/pci.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/wireless/ath/ath11k/pci.c b/drivers/net/wireless/ath/ath11k/pci.c
> index 412f4a134e4a..87ef7f321065 100644
> --- a/drivers/net/wireless/ath/ath11k/pci.c
> +++ b/drivers/net/wireless/ath/ath11k/pci.c
> @@ -929,7 +929,7 @@ static int ath11k_pci_probe(struct pci_dev *pdev,
>  {
>  	struct ath11k_base *ab;
>  	struct ath11k_pci *ab_pci;
> -	u32 soc_hw_version_major, soc_hw_version_minor, addr;
> +	u32 soc_hw_version_major, soc_hw_version_minor;
>  	int ret;
>  	u32 sub_version;
>  
> @@ -955,8 +955,7 @@ static int ath11k_pci_probe(struct pci_dev *pdev,
>  	 * from DT. If memory is reserved from DT for FW, ath11k driver need not
>  	 * allocate memory.
>  	 */
> -	ret = of_property_read_u32(ab->dev->of_node, "memory-region", &addr);
> -	if (!ret)
> +	if (of_property_present(ab->dev->of_node, "memory-region"))
>  		set_bit(ATH11K_FLAG_FIXED_MEM_RGN, &ab->dev_flags);
>  
>  	ret = ath11k_pci_claim(ab_pci, pdev);

LGTM, I'll pick this up
Jeff Johnson April 12, 2025, 4:24 a.m. UTC | #2
On Tue, 08 Apr 2025 14:02:11 -0500, Rob Herring (Arm) wrote:
> The use of of_property_read_u32() isn't really correct as
> "memory-region" contains phandles (though those happen to be u32s. As
> it is just testing for property presence, use of_property_present()
> instead.
> 
> 

Applied, thanks!

[1/1] wifi: ath11k: Use of_property_present() to test property presence
      commit: d118047f82408201eb433a7ff7d505e72515d7e0

Best regards,
diff mbox series

Patch

diff --git a/drivers/net/wireless/ath/ath11k/pci.c b/drivers/net/wireless/ath/ath11k/pci.c
index 412f4a134e4a..87ef7f321065 100644
--- a/drivers/net/wireless/ath/ath11k/pci.c
+++ b/drivers/net/wireless/ath/ath11k/pci.c
@@ -929,7 +929,7 @@  static int ath11k_pci_probe(struct pci_dev *pdev,
 {
 	struct ath11k_base *ab;
 	struct ath11k_pci *ab_pci;
-	u32 soc_hw_version_major, soc_hw_version_minor, addr;
+	u32 soc_hw_version_major, soc_hw_version_minor;
 	int ret;
 	u32 sub_version;
 
@@ -955,8 +955,7 @@  static int ath11k_pci_probe(struct pci_dev *pdev,
 	 * from DT. If memory is reserved from DT for FW, ath11k driver need not
 	 * allocate memory.
 	 */
-	ret = of_property_read_u32(ab->dev->of_node, "memory-region", &addr);
-	if (!ret)
+	if (of_property_present(ab->dev->of_node, "memory-region"))
 		set_bit(ATH11K_FLAG_FIXED_MEM_RGN, &ab->dev_flags);
 
 	ret = ath11k_pci_claim(ab_pci, pdev);