[openwrt/openwrt] airoha: pwm: use devm
LEDE Commits
lede-commits at lists.infradead.org
Thu May 1 16:34:41 PDT 2025
ansuel pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/aa4c96b9250c06d07cde145441e391453f87ccb2
commit aa4c96b9250c06d07cde145441e391453f87ccb2
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Sat Apr 26 16:48:12 2025 -0700
airoha: pwm: use devm
Removes the need for a remove function in platform_device.
Signed-off-by: Rosen Penev <rosenp at gmail.com>
Link: https://github.com/openwrt/openwrt/pull/18660
Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
.../108-pwm-airoha-Add-support-for-EN7581-SoC.patch | 16 ++--------------
1 file changed, 2 insertions(+), 14 deletions(-)
diff --git a/target/linux/airoha/patches-6.6/108-pwm-airoha-Add-support-for-EN7581-SoC.patch b/target/linux/airoha/patches-6.6/108-pwm-airoha-Add-support-for-EN7581-SoC.patch
index 8f83c696c4..0b114d5f53 100644
--- a/target/linux/airoha/patches-6.6/108-pwm-airoha-Add-support-for-EN7581-SoC.patch
+++ b/target/linux/airoha/patches-6.6/108-pwm-airoha-Add-support-for-EN7581-SoC.patch
@@ -48,7 +48,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo at kernel.org>
obj-$(CONFIG_PWM_ATMEL_HLCDC_PWM) += pwm-atmel-hlcdc.o
--- /dev/null
+++ b/drivers/pwm/pwm-airoha.c
-@@ -0,0 +1,400 @@
+@@ -0,0 +1,388 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright 2022 Markus Gothe <markus.gothe at genexis.eu>
@@ -414,18 +414,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo at kernel.org>
+ if (IS_ERR(pc->regmap))
+ return PTR_ERR(pc->regmap);
+
-+ platform_set_drvdata(pdev, pc);
-+
-+ return pwmchip_add(&pc->chip);
-+}
-+
-+static int airoha_pwm_remove(struct platform_device *pdev)
-+{
-+ struct airoha_pwm *pc = platform_get_drvdata(pdev);
-+
-+ pwmchip_remove(&pc->chip);
-+
-+ return 0;
++ return devm_pwmchip_add(&pdev->dev, &pc->chip);
+}
+
+static const struct of_device_id airoha_pwm_of_match[] = {
@@ -440,7 +429,6 @@ Signed-off-by: Lorenzo Bianconi <lorenzo at kernel.org>
+ .of_match_table = airoha_pwm_of_match,
+ },
+ .probe = airoha_pwm_probe,
-+ .remove = airoha_pwm_remove,
+};
+module_platform_driver(airoha_pwm_driver);
+
More information about the lede-commits
mailing list