From: Wei Yongjun <weiyj.lk@gmail.com>
To: Zhang Rui <rui.zhang@intel.com>, Eduardo Valentin <edubezval@gmail.com>
Cc: Wei Yongjun <weiyongjun1@huawei.com>, linux-pm@vger.kernel.org
Subject: [PATCH -next] thermal: qoriq: Remove unnecessary platform_set_drvdata()
Date: Tue, 23 Aug 2016 15:01:28 +0000 [thread overview]
Message-ID: <1471964488-28313-1-git-send-email-weiyj.lk@gmail.com> (raw)
From: Wei Yongjun <weiyongjun1@huawei.com>
The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
drivers/thermal/qoriq_thermal.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/drivers/thermal/qoriq_thermal.c b/drivers/thermal/qoriq_thermal.c
index 644ba52..d01eca0 100644
--- a/drivers/thermal/qoriq_thermal.c
+++ b/drivers/thermal/qoriq_thermal.c
@@ -217,15 +217,13 @@ static int qoriq_tmu_probe(struct platform_device *pdev)
data->sensor_id = qoriq_tmu_get_sensor_id();
if (data->sensor_id < 0) {
dev_err(&pdev->dev, "Failed to get sensor id\n");
- ret = -ENODEV;
- goto err_iomap;
+ return -ENODEV;
}
data->regs = of_iomap(np, 0);
if (!data->regs) {
dev_err(&pdev->dev, "Failed to get memory region\n");
- ret = -ENODEV;
- goto err_iomap;
+ return -ENODEV;
}
qoriq_tmu_init_device(data); /* TMU initialization */
@@ -254,9 +252,6 @@ static int qoriq_tmu_probe(struct platform_device *pdev)
err_tmu:
iounmap(data->regs);
-err_iomap:
- platform_set_drvdata(pdev, NULL);
-
return ret;
}
@@ -270,7 +265,6 @@ static int qoriq_tmu_remove(struct platform_device *pdev)
tmu_write(data, TMR_DISABLE, &data->regs->tmr);
iounmap(data->regs);
- platform_set_drvdata(pdev, NULL);
return 0;
}
next reply other threads:[~2016-08-23 15:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-23 15:01 Wei Yongjun [this message]
2016-08-24 6:41 ` [PATCH -next] thermal: qoriq: Remove unnecessary platform_set_drvdata() Zhang Rui
2016-09-08 7:17 ` Troy Jia
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=1471964488-28313-1-git-send-email-weiyj.lk@gmail.com \
--to=weiyj.lk@gmail.com \
--cc=edubezval@gmail.com \
--cc=linux-pm@vger.kernel.org \
--cc=rui.zhang@intel.com \
--cc=weiyongjun1@huawei.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).