diff mbox series

[2/2] net: rfkill: gpio: add DT support

Message ID 20221221104803.1693874-2-p.zabel@pengutronix.de (mailing list archive)
State Not Applicable
Delegated to: Netdev Maintainers
Headers show
Series [1/2] dt-bindings: net: Add rfkill-gpio binding | expand

Checks

Context Check Description
netdev/tree_selection success Guessed tree name to be net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers warning 4 maintainers not CCed: edumazet@google.com davem@davemloft.net pabeni@redhat.com kuba@kernel.org
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 21 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Philipp Zabel Dec. 21, 2022, 10:48 a.m. UTC
Allow probing rfkill-gpio via device tree. This just hooks up the
already existing support that was started in commit 262c91ee5e52 ("net:
rfkill: gpio: prepare for DT and ACPI support") via the "rfkill-gpio"
compatible.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
---
 net/rfkill/rfkill-gpio.c | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Krzysztof Kozlowski Dec. 22, 2022, 10:32 a.m. UTC | #1
On 21/12/2022 11:48, Philipp Zabel wrote:
> Allow probing rfkill-gpio via device tree. This just hooks up the
> already existing support that was started in commit 262c91ee5e52 ("net:
> rfkill: gpio: prepare for DT and ACPI support") via the "rfkill-gpio"
> compatible.
> 
> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
> ---
>  net/rfkill/rfkill-gpio.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/net/rfkill/rfkill-gpio.c b/net/rfkill/rfkill-gpio.c
> index f5afc9bcdee6..9f763654cd27 100644
> --- a/net/rfkill/rfkill-gpio.c
> +++ b/net/rfkill/rfkill-gpio.c
> @@ -157,12 +157,21 @@ static const struct acpi_device_id rfkill_acpi_match[] = {
>  MODULE_DEVICE_TABLE(acpi, rfkill_acpi_match);
>  #endif
>  
> +#ifdef CONFIG_OF

__maybe_unused instead

> +static const struct of_device_id rfkill_of_match[] = {
> +	{ .compatible = "rfkill-gpio", },
> +	{ },
> +};
> +MODULE_DEVICE_TABLE(of, rfkill_of_match);


Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/net/rfkill/rfkill-gpio.c b/net/rfkill/rfkill-gpio.c
index f5afc9bcdee6..9f763654cd27 100644
--- a/net/rfkill/rfkill-gpio.c
+++ b/net/rfkill/rfkill-gpio.c
@@ -157,12 +157,21 @@  static const struct acpi_device_id rfkill_acpi_match[] = {
 MODULE_DEVICE_TABLE(acpi, rfkill_acpi_match);
 #endif
 
+#ifdef CONFIG_OF
+static const struct of_device_id rfkill_of_match[] = {
+	{ .compatible = "rfkill-gpio", },
+	{ },
+};
+MODULE_DEVICE_TABLE(of, rfkill_of_match);
+#endif
+
 static struct platform_driver rfkill_gpio_driver = {
 	.probe = rfkill_gpio_probe,
 	.remove = rfkill_gpio_remove,
 	.driver = {
 		.name = "rfkill_gpio",
 		.acpi_match_table = ACPI_PTR(rfkill_acpi_match),
+		.of_match_table = of_match_ptr(rfkill_of_match),
 	},
 };