From: Catalin Popescu Date: Thu, 16 Jan 2025 08:47:02 +0000 (+0100) Subject: net: rfkill: gpio: allow booting in blocked state X-Git-Tag: v6.15-rc1~160^2~184^2~66 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2882bf7dd4f5dc732aa98d206026582cc136cb4d;p=thirdparty%2Fkernel%2Flinux.git net: rfkill: gpio: allow booting in blocked state By default, rfkill state is unblocked and this behavior is not configurable. Add support for booting in blocked state based on the presence of a devicetree property. Signed-off-by: Catalin Popescu Link: https://patch.msgid.link/20250116084702.3473176-2-catalin.popescu@leica-geosystems.com Signed-off-by: Johannes Berg --- diff --git a/net/rfkill/rfkill-gpio.c b/net/rfkill/rfkill-gpio.c index 9fa019e0dcadd..41e657e977618 100644 --- a/net/rfkill/rfkill-gpio.c +++ b/net/rfkill/rfkill-gpio.c @@ -162,6 +162,9 @@ static int rfkill_gpio_probe(struct platform_device *pdev) if (!rfkill->rfkill_dev) return -ENOMEM; + if (device_property_present(&pdev->dev, "default-blocked")) + rfkill_init_sw_state(rfkill->rfkill_dev, true); + ret = rfkill_register(rfkill->rfkill_dev); if (ret < 0) goto err_destroy;