airoha: pwm: use devm
Removes the need for a remove function in platform_device. Signed-off-by: Rosen Penev <rosenp@gmail.com> Link: https://github.com/openwrt/openwrt/pull/18660 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
This commit is contained in:
parent
aec2de120f
commit
aa4c96b925
1 changed files with 2 additions and 14 deletions
|
@ -48,7 +48,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||||
obj-$(CONFIG_PWM_ATMEL_HLCDC_PWM) += pwm-atmel-hlcdc.o
|
obj-$(CONFIG_PWM_ATMEL_HLCDC_PWM) += pwm-atmel-hlcdc.o
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/drivers/pwm/pwm-airoha.c
|
+++ b/drivers/pwm/pwm-airoha.c
|
||||||
@@ -0,0 +1,400 @@
|
@@ -0,0 +1,388 @@
|
||||||
+// SPDX-License-Identifier: GPL-2.0
|
+// SPDX-License-Identifier: GPL-2.0
|
||||||
+/*
|
+/*
|
||||||
+ * Copyright 2022 Markus Gothe <markus.gothe@genexis.eu>
|
+ * Copyright 2022 Markus Gothe <markus.gothe@genexis.eu>
|
||||||
|
@ -414,18 +414,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||||
+ if (IS_ERR(pc->regmap))
|
+ if (IS_ERR(pc->regmap))
|
||||||
+ return PTR_ERR(pc->regmap);
|
+ return PTR_ERR(pc->regmap);
|
||||||
+
|
+
|
||||||
+ platform_set_drvdata(pdev, pc);
|
+ return devm_pwmchip_add(&pdev->dev, &pc->chip);
|
||||||
+
|
|
||||||
+ 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;
|
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
+static const struct of_device_id airoha_pwm_of_match[] = {
|
+static const struct of_device_id airoha_pwm_of_match[] = {
|
||||||
|
@ -440,7 +429,6 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||||
+ .of_match_table = airoha_pwm_of_match,
|
+ .of_match_table = airoha_pwm_of_match,
|
||||||
+ },
|
+ },
|
||||||
+ .probe = airoha_pwm_probe,
|
+ .probe = airoha_pwm_probe,
|
||||||
+ .remove = airoha_pwm_remove,
|
|
||||||
+};
|
+};
|
||||||
+module_platform_driver(airoha_pwm_driver);
|
+module_platform_driver(airoha_pwm_driver);
|
||||||
+
|
+
|
||||||
|
|
Loading…
Reference in a new issue