From patchwork Mon Jun 10 14:28:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Davis X-Patchwork-Id: 13692126 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 BAF62C27C55 for ; Mon, 10 Jun 2024 14:29:10 +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:References:In-Reply-To: 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: List-Owner; bh=I351TtF1qTL5cuCy8m+ShJ7n6C02yKDuxIQdUIC1yiE=; b=ub+6d4ygydw4O9 V+szH0FFNHilsBiDTNx8xVWpbZ63v0qRYQB5ZipZe6X5PYqR6RC7HFEluneTROvIOnSKiTUCU5OX7 ryr7ElRB9oUNUfHLmTTdOLCLm3gC6Rf56so2JfEkcMDfx2p2hqysvTGc0ICFhkPHNeSd4App4voTa YKgI8vZAZJZdg4oydLJC91Cz0nTMzz0aWE4mlaPwQR52YUYnw/ZeRNPi0FB+pBlKqSwaudoLhGlnO OeteH3F5aKkoHTvfyjt5s82s9cDUc8o9RPMpdt4iwYJHfX02AP6J6gVOGYewtrPTfAZKNCmeza9d/ 6JUvdeYbEJ9A1f/EmjwQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sGg0u-00000005Pdw-3Gs9; Mon, 10 Jun 2024 14:28:48 +0000 Received: from lelv0142.ext.ti.com ([198.47.23.249]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sGg0q-00000005Pbe-3RXg for linux-arm-kernel@lists.infradead.org; Mon, 10 Jun 2024 14:28:46 +0000 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 45AESc6O125310; Mon, 10 Jun 2024 09:28:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1718029718; bh=pvtv1w8mptVyobEHSvk6AkP2PCKKbZqvPVKxMdTdMJs=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=kDtyKVVrbj54kAINAYDqnXhVizPBqg+OqsnzJs4CCIaKYHyoSzdKi9V/IFxbzQB9h T6ixiZ3ZP1truT1tlqkidn5L3zBJmsovZVR7Zca58ZYEFra0J02HehDFgW32ICpFJ8 sSR31JfwoiECVcJObrW4qZzI/B81/v6BItE7Bj3Q= Received: from DFLE115.ent.ti.com (dfle115.ent.ti.com [10.64.6.36]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 45AESciR005779 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 10 Jun 2024 09:28:38 -0500 Received: from DFLE110.ent.ti.com (10.64.6.31) by DFLE115.ent.ti.com (10.64.6.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Mon, 10 Jun 2024 09:28:38 -0500 Received: from lelvsmtp5.itg.ti.com (10.180.75.250) by DFLE110.ent.ti.com (10.64.6.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Mon, 10 Jun 2024 09:28:38 -0500 Received: from fllvsmtp8.itg.ti.com ([10.249.42.149]) by lelvsmtp5.itg.ti.com (8.15.2/8.15.2) with ESMTP id 45AESbiJ095574; Mon, 10 Jun 2024 09:28:38 -0500 From: Andrew Davis To: Sebastian Reichel , Florian Fainelli CC: Broadcom internal kernel review list , , , , Andrew Davis Subject: [PATCH 2/5] power: reset: brcmstb: Use device_get_match_data() for matching Date: Mon, 10 Jun 2024 09:28:33 -0500 Message-ID: <20240610142836.168603-2-afd@ti.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240610142836.168603-1-afd@ti.com> References: <20240610142836.168603-1-afd@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240610_072844_964756_A3BBBC15 X-CRM114-Status: GOOD ( 13.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 Use device_get_match_data() for finding the matching node and fetching the match data all in one. Signed-off-by: Andrew Davis Acked-by: Florian Fainelli --- drivers/power/reset/brcmstb-reboot.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/drivers/power/reset/brcmstb-reboot.c b/drivers/power/reset/brcmstb-reboot.c index 797f0079bb590..db5b7120eadd0 100644 --- a/drivers/power/reset/brcmstb-reboot.c +++ b/drivers/power/reset/brcmstb-reboot.c @@ -83,24 +83,16 @@ static const struct reset_reg_mask reset_bits_65nm = { .sw_mstr_rst_mask = BIT(31), }; -static const struct of_device_id of_match[] = { - { .compatible = "brcm,brcmstb-reboot", .data = &reset_bits_40nm }, - { .compatible = "brcm,bcm7038-reboot", .data = &reset_bits_65nm }, - {}, -}; - static int brcmstb_reboot_probe(struct platform_device *pdev) { int rc; struct device_node *np = pdev->dev.of_node; - const struct of_device_id *of_id; - of_id = of_match_node(of_match, np); - if (!of_id) { - pr_err("failed to look up compatible string\n"); + reset_masks = device_get_match_data(&pdev->dev); + if (!reset_masks) { + pr_err("failed to get match data\n"); return -EINVAL; } - reset_masks = of_id->data; regmap = syscon_regmap_lookup_by_phandle(np, "syscon"); if (IS_ERR(regmap)) { @@ -130,6 +122,12 @@ static int brcmstb_reboot_probe(struct platform_device *pdev) return rc; } +static const struct of_device_id of_match[] = { + { .compatible = "brcm,brcmstb-reboot", .data = &reset_bits_40nm }, + { .compatible = "brcm,bcm7038-reboot", .data = &reset_bits_65nm }, + {}, +}; + static struct platform_driver brcmstb_reboot_driver = { .probe = brcmstb_reboot_probe, .driver = {