From: Andrew Davis <afd@ti.com>
To: Sebastian Reichel <sre@kernel.org>,
Florian Fainelli <florian.fainelli@broadcom.com>
Cc: Broadcom internal kernel review list
<bcm-kernel-feedback-list@broadcom.com>,
<linux-pm@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>, Andrew Davis <afd@ti.com>
Subject: [PATCH 2/5] power: reset: brcmstb: Use device_get_match_data() for matching
Date: Mon, 10 Jun 2024 09:28:33 -0500 [thread overview]
Message-ID: <20240610142836.168603-2-afd@ti.com> (raw)
In-Reply-To: <20240610142836.168603-1-afd@ti.com>
Use device_get_match_data() for finding the matching node and fetching
the match data all in one.
Signed-off-by: Andrew Davis <afd@ti.com>
---
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 = {
--
2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2024-06-10 14:29 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-10 14:28 [PATCH 1/5] power: reset: brcmstb: Use normal driver register function Andrew Davis
2024-06-10 14:28 ` Andrew Davis [this message]
2024-06-16 12:32 ` [PATCH 2/5] power: reset: brcmstb: Use device_get_match_data() for matching Florian Fainelli
2024-06-10 14:28 ` [PATCH 3/5] power: reset: brcmstb: Use syscon_regmap_lookup_by_phandle_args() helper Andrew Davis
2024-06-11 6:15 ` Dhruva Gole
2024-06-16 12:30 ` Florian Fainelli
2024-06-10 14:28 ` [PATCH 4/5] power: reset: brcmstb: Use devm_register_sys_off_handler() Andrew Davis
2024-06-11 6:17 ` Dhruva Gole
2024-06-16 12:31 ` Florian Fainelli
2024-06-10 14:28 ` [PATCH 5/5] power: reset: brcmstb: Do not go into infinite loop if reset fails Andrew Davis
2024-06-11 6:21 ` Dhruva Gole
2024-06-16 12:33 ` Florian Fainelli
2024-06-11 6:09 ` [PATCH 1/5] power: reset: brcmstb: Use normal driver register function Dhruva Gole
2024-06-16 12:31 ` Florian Fainelli
2024-08-28 22:17 ` Sebastian Reichel
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=20240610142836.168603-2-afd@ti.com \
--to=afd@ti.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=florian.fainelli@broadcom.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=sre@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;
as well as URLs for NNTP newsgroup(s).