From patchwork Fri Jan 6 07:27:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ivan T . Ivanov" X-Patchwork-Id: 13091003 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C9E69C54E76 for ; Fri, 6 Jan 2023 07:29:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=9sPWeysZclOiR9aLVS+xUNejGB1QHLl/U8q7QqIosnA=; b=X3rykG5S9Gq8YJ 8WbcVcqygjSf/sN42teCxIDPkO/+TETCF91IDM2h2wML9JRNWHqGJ46HJBHIFxSqhUQPyP2VxjXAv UBtYvnICas5vh9TN3uo1bWP5T/271Stn3Frr7jzA8uemEtqb5uS/IV2+5UmToc/xmeT5W0Gm6G4ri Jf1hq7ziApq2mfePSYpxepmO1sOx7iwZ+V9tLwlVrV7o94YSN+Lc2iRqGBLvREuq2yUJlT7oh4lO8 bRkuPyGkYcBF7iI49bhtmK83oaoOhy0b6dQsMd3GNfxmnowE/X+Pt8pjyDks/WwE5XJR6ppOyZLIB Z5BRXhv5eUg9yw5hHIVA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pDh99-006LnF-Fv; Fri, 06 Jan 2023 07:28:11 +0000 Received: from smtp-out1.suse.de ([195.135.220.28]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pDh95-006LlH-9q for linux-arm-kernel@lists.infradead.org; Fri, 06 Jan 2023 07:28:09 +0000 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 3922E244F0; Fri, 6 Jan 2023 07:28:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1672990082; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=qcHUiVAjJO3DMY5+VXRQErLJFnEpu+52N7JyRTTtab8=; b=Obnz0JTZbqZVSRu5rHlgGY7Yld96w/YO9gpnshQBxWPxVzcBSGZn0HYGLtbSnYlqH5JBin PwpyF/Wnx/FAL6sYxVRzp78ORRdQfTZyQ7uMO7uerv+zCesMaG1mDu8SWK6YtylZa2Ykqx rQYra1Xo7uoBaiVbwzfK57281Dxf/TM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1672990082; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=qcHUiVAjJO3DMY5+VXRQErLJFnEpu+52N7JyRTTtab8=; b=0n5SWdt2T2a2g8v/Cm3hugx00Bfu6ro6SXuTprzvpAu/F9VDwejNc8vPScqNx6W8QlGW7j ASgXtMZN9+iokUCQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 14E5A13596; Fri, 6 Jan 2023 07:28:02 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id Gg2+BILNt2OMMwAAMHmgww (envelope-from ); Fri, 06 Jan 2023 07:28:02 +0000 From: "Ivan T. Ivanov" To: aspriel@gmail.com, marcan@marcan.st Cc: franky.lin@broadcom.com, hante.meuleman@broadcom.com, rmk+kernel@armlinux.org.uk, kvalo@kernel.org, davem@davemloft.net, devicetree@vger.kernel.org, edumazet@google.com, krzysztof.kozlowski+dt@linaro.org, kuba@kernel.org, pabeni@redhat.com, robh+dt@kernel.org, linux-arm-kernel@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, SHA-cyfmac-dev-list@infineon.com, "Ivan T. Ivanov" Subject: [PATCH] brcmfmac: of: Use board compatible string for board type Date: Fri, 6 Jan 2023 09:27:46 +0200 Message-Id: <20230106072746.29516-1-iivanov@suse.de> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230105_232807_510511_2E0B49E7 X-CRM114-Status: GOOD ( 11.69 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org When "brcm,board-type" is not explicitly set in devicetree fallback to board compatible string for board type. Some of the existing devices rely on the most compatible device string to find best firmware files, including Raspberry PI's[1]. Fixes: 7682de8b3351 ("wifi: brcmfmac: of: Fetch Apple properties") [1] https://bugzilla.opensuse.org/show_bug.cgi?id=1206697#c13 Signed-off-by: Ivan T. Ivanov Reviewed-by: Hector Martin --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c index a83699de01ec..fdd0c9abc1a1 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c @@ -79,7 +79,8 @@ void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type, /* Apple ARM64 platforms have their own idea of board type, passed in * via the device tree. They also have an antenna SKU parameter */ - if (!of_property_read_string(np, "brcm,board-type", &prop)) + err = of_property_read_string(np, "brcm,board-type", &prop); + if (!err) settings->board_type = prop; if (!of_property_read_string(np, "apple,antenna-sku", &prop)) @@ -87,7 +88,7 @@ void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type, /* Set board-type to the first string of the machine compatible prop */ root = of_find_node_by_path("/"); - if (root && !settings->board_type) { + if (root && err) { char *board_type; const char *tmp;