From: "Marek Behún" <kabel@kernel.org>
To: linux-leds@vger.kernel.org
Cc: "Pavel Machek" <pavel@ucw.cz>,
dmurphy@ti.com, "Marek Behún" <kabel@kernel.org>,
"Simon Guinot" <simon.guinot@sequanux.org>
Subject: [PATCH leds 2/2] leds: ns2: do not guard OF match pointer with of_match_ptr
Date: Wed, 23 Sep 2020 16:18:40 +0200 [thread overview]
Message-ID: <20200923141840.6333-3-kabel@kernel.org> (raw)
In-Reply-To: <20200923141840.6333-1-kabel@kernel.org>
Do not match OF match pointer with of_match_ptr, so that even if
CONFIG_OF is disabled, the driver can still be bound via another method.
Move definition of of_ns2_leds_match just before ns2_led_driver
definition, since it is not needed sooner.
Signed-off-by: Marek Behún <kabel@kernel.org>
Cc: Simon Guinot <simon.guinot@sequanux.org>
---
drivers/leds/leds-ns2.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/leds/leds-ns2.c b/drivers/leds/leds-ns2.c
index 427b5059206a5..4ea6e61aacddf 100644
--- a/drivers/leds/leds-ns2.c
+++ b/drivers/leds/leds-ns2.c
@@ -239,12 +239,6 @@ static int ns2_led_register(struct device *dev, struct fwnode_handle *node,
return ret;
}
-static const struct of_device_id of_ns2_leds_match[] = {
- { .compatible = "lacie,ns2-leds", },
- {},
-};
-MODULE_DEVICE_TABLE(of, of_ns2_leds_match);
-
static int ns2_led_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
@@ -272,11 +266,17 @@ static int ns2_led_probe(struct platform_device *pdev)
return 0;
}
+static const struct of_device_id of_ns2_leds_match[] = {
+ { .compatible = "lacie,ns2-leds", },
+ {},
+};
+MODULE_DEVICE_TABLE(of, of_ns2_leds_match);
+
static struct platform_driver ns2_led_driver = {
.probe = ns2_led_probe,
.driver = {
.name = "leds-ns2",
- .of_match_table = of_match_ptr(of_ns2_leds_match),
+ .of_match_table = of_ns2_leds_match,
},
};
--
2.26.2
next prev parent reply other threads:[~2020-09-23 14:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-23 14:18 [PATCH leds 0/2] leds: ns2: convert to fwnode API Marek Behún
2020-09-23 14:18 ` [PATCH leds 1/2] " Marek Behún
2020-09-26 13:27 ` Simon Guinot
2020-09-23 14:18 ` Marek Behún [this message]
2020-09-24 8:14 ` [PATCH leds 0/2] " Simon Guinot
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=20200923141840.6333-3-kabel@kernel.org \
--to=kabel@kernel.org \
--cc=dmurphy@ti.com \
--cc=linux-leds@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=simon.guinot@sequanux.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.