linux-pwm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Thierry Reding <thierry.reding@gmail.com>,
	Lee Jones <lee.jones@linaro.org>
Cc: linux-pwm@vger.kernel.org, kernel@pengutronix.de
Subject: [PATCH 24/47] pwm: mxs: Simplify using devm_pwmchip_add()
Date: Wed,  7 Jul 2021 18:28:12 +0200	[thread overview]
Message-ID: <20210707162835.1772882-25-u.kleine-koenig@pengutronix.de> (raw)
In-Reply-To: <20210707162835.1772882-1-u.kleine-koenig@pengutronix.de>

This allows to drop the platform_driver's remove function. This is the
only user of driver data so this can go away, too.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/pwm/pwm-mxs.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/drivers/pwm/pwm-mxs.c b/drivers/pwm/pwm-mxs.c
index 558dc1de8f5d..766dbc58dad8 100644
--- a/drivers/pwm/pwm-mxs.c
+++ b/drivers/pwm/pwm-mxs.c
@@ -150,24 +150,15 @@ static int mxs_pwm_probe(struct platform_device *pdev)
 	if (ret)
 		return dev_err_probe(&pdev->dev, ret, "failed to reset PWM\n");
 
-	ret = pwmchip_add(&mxs->chip);
+	ret = devm_pwmchip_add(&pdev->dev, &mxs->chip);
 	if (ret < 0) {
 		dev_err(&pdev->dev, "failed to add pwm chip %d\n", ret);
 		return ret;
 	}
 
-	platform_set_drvdata(pdev, mxs);
-
 	return 0;
 }
 
-static int mxs_pwm_remove(struct platform_device *pdev)
-{
-	struct mxs_pwm_chip *mxs = platform_get_drvdata(pdev);
-
-	return pwmchip_remove(&mxs->chip);
-}
-
 static const struct of_device_id mxs_pwm_dt_ids[] = {
 	{ .compatible = "fsl,imx23-pwm", },
 	{ /* sentinel */ }
@@ -180,7 +171,6 @@ static struct platform_driver mxs_pwm_driver = {
 		.of_match_table = mxs_pwm_dt_ids,
 	},
 	.probe = mxs_pwm_probe,
-	.remove = mxs_pwm_remove,
 };
 module_platform_driver(mxs_pwm_driver);
 
-- 
2.30.2


  parent reply	other threads:[~2021-07-07 16:29 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-07 16:27 [PATCH 00/47] pwm: Make pwmchip_remove return void Uwe Kleine-König
2021-07-07 16:27 ` [PATCH 01/47] pwm: lpc32xx: Don't modify HW state in .probe() after the PWM chip was registered Uwe Kleine-König
2021-07-07 16:27 ` [PATCH 02/47] pwm: mxs: " Uwe Kleine-König
2021-07-07 16:27 ` [PATCH 03/47] pwm: img: Don't modify HW state in .remove() callback Uwe Kleine-König
2021-07-07 16:27 ` [PATCH 04/47] pwm: rockchip: " Uwe Kleine-König
2021-07-07 16:27 ` [PATCH 05/47] pwm: stm32-lp: " Uwe Kleine-König
2021-07-07 16:27 ` [PATCH 06/47] pwm: hibvt: Disable the clock only after the PWM was unregistered Uwe Kleine-König
2021-07-07 16:27 ` [PATCH 07/47] pwm: rockchip: Unprepare clocks " Uwe Kleine-König
2021-07-07 16:27 ` [PATCH 08/47] pwm: tiehrpwm: Unprepare clock " Uwe Kleine-König
2021-07-07 16:27 ` [PATCH 09/47] pwm: ntxec: Drop useless assignment to struct pwmchip::base Uwe Kleine-König
2021-07-07 16:27 ` [PATCH 10/47] pwm: jz4740: Improve compile coverage by allowing to enable on !MIPS Uwe Kleine-König
2021-07-07 16:27 ` [PATCH 11/47] pwm: keembay: Improve compile coverage by allowing to enable on !ARM64 Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 12/47] pwm: ab8500: Simplify using devm_pwmchip_add() Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 13/47] pwm: bcm-kona: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 14/47] pwm: ep93xx: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 15/47] pwm: fsl-ftm: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 16/47] pwm: imx27: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 17/47] pwm: intel-lgm: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 18/47] pwm: iqs620a: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 19/47] pwm: jz4740: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 20/47] pwm: keembay: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 21/47] pwm: lp3943: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 22/47] pwm: lpc32xx: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 23/47] pwm: mediatek: " Uwe Kleine-König
2021-07-07 16:28 ` Uwe Kleine-König [this message]
2021-07-07 16:28 ` [PATCH 25/47] pwm: ntxec: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 26/47] pwm: pxa: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 27/47] pwm: raspberrypi-poe: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 28/47] pwm: sl28cpld: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 29/47] pwm: stm32-lp: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 30/47] pwm: tiecap: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 31/47] pwm: twl-led: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 32/47] pwm: twl: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 33/47] pwm: atmel-hlcdc: Don't check the return code of pwmchip_remove() Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 34/47] pwm: atmel-tcb: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 35/47] pwm: brcmstb: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 36/47] pwm: cros-ec: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 37/47] pwm: img: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 38/47] pwm: imx-tpm: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 39/47] pwm: mtk-disp: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 40/47] pwm: omap-dmtimer: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 41/47] pwm: pca9685: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 42/47] pwm: rcar: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 43/47] pwm: renesas-tpu: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 44/47] pwm: samsung: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 45/47] pwm: sifive: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 46/47] pwm: sun4i: " Uwe Kleine-König
2021-07-07 16:28 ` [PATCH 47/47] pwm: Make pwmchip_remove() return void Uwe Kleine-König

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=20210707162835.1772882-25-u.kleine-koenig@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=kernel@pengutronix.de \
    --cc=lee.jones@linaro.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=thierry.reding@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).