linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] pwm: pwm-mxs: use devm_platform_ioremap_resource() to simplify code
@ 2019-09-24  9:42 Anson Huang
  2019-09-24  9:42 ` [PATCH 2/2] pwm: pwm-mxs: Use 'dev' instead of dereferencing it repeatedly Anson Huang
  2019-09-24 11:02 ` [PATCH 1/2] pwm: pwm-mxs: use devm_platform_ioremap_resource() to simplify code Thierry Reding
  0 siblings, 2 replies; 4+ messages in thread
From: Anson Huang @ 2019-09-24  9:42 UTC (permalink / raw)
  To: thierry.reding, shawnguo, s.hauer, kernel, festevam, linux-pwm,
	linux-arm-kernel, linux-kernel
  Cc: Linux-imx

Use the new helper devm_platform_ioremap_resource() which wraps the
platform_get_resource() and devm_ioremap_resource() together, to
simplify the code.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
	- This is a resend version of patch: https://patchwork.kernel.org/patch/11048365/
---
 drivers/pwm/pwm-mxs.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/pwm/pwm-mxs.c b/drivers/pwm/pwm-mxs.c
index 04c0f6b..b14376b 100644
--- a/drivers/pwm/pwm-mxs.c
+++ b/drivers/pwm/pwm-mxs.c
@@ -126,15 +126,13 @@ static int mxs_pwm_probe(struct platform_device *pdev)
 {
 	struct device_node *np = pdev->dev.of_node;
 	struct mxs_pwm_chip *mxs;
-	struct resource *res;
 	int ret;
 
 	mxs = devm_kzalloc(&pdev->dev, sizeof(*mxs), GFP_KERNEL);
 	if (!mxs)
 		return -ENOMEM;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	mxs->base = devm_ioremap_resource(&pdev->dev, res);
+	mxs->base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(mxs->base))
 		return PTR_ERR(mxs->base);
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-09-24 11:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-24  9:42 [PATCH 1/2] pwm: pwm-mxs: use devm_platform_ioremap_resource() to simplify code Anson Huang
2019-09-24  9:42 ` [PATCH 2/2] pwm: pwm-mxs: Use 'dev' instead of dereferencing it repeatedly Anson Huang
2019-09-24 10:53   ` Thierry Reding
2019-09-24 11:02 ` [PATCH 1/2] pwm: pwm-mxs: use devm_platform_ioremap_resource() to simplify code Thierry Reding

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).