From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
To: jic23@kernel.org, edubezval@gmail.com, rui.zhang@intel.com
Cc: linux-iio@vger.kernel.org, linux-pm@vger.kernel.org,
Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Subject: [RFC PATCH v1 2/3] thermal: use iio binding calls
Date: Tue, 25 Aug 2015 12:58:31 -0700 [thread overview]
Message-ID: <1440532712-5025-3-git-send-email-srinivas.pandruvada@linux.intel.com> (raw)
In-Reply-To: <1440532712-5025-1-git-send-email-srinivas.pandruvada@linux.intel.com>
Register zone temperature sensor as IIO device during zone registration.
Also IIO device is removed during zone removal.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
---
drivers/thermal/thermal_core.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index 4ca211b..c48f62e 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -1834,10 +1834,15 @@ struct thermal_zone_device *thermal_zone_device_register(const char *type,
mutex_unlock(&thermal_governor_lock);
+ if (thermal_iio_sensor_register(tz))
+ goto unregister;
+
if (!tz->tzp || !tz->tzp->no_hwmon) {
result = thermal_add_hwmon_sysfs(tz);
- if (result)
+ if (result) {
+ thermal_iio_sensor_unregister(tz);
goto unregister;
+ }
}
mutex_lock(&thermal_list_lock);
@@ -1920,7 +1925,7 @@ void thermal_zone_device_unregister(struct thermal_zone_device *tz)
device_remove_file(&tz->device, &dev_attr_policy);
remove_trip_attrs(tz);
thermal_set_governor(tz, NULL);
-
+ thermal_iio_sensor_unregister(tz);
thermal_remove_hwmon_sysfs(tz);
release_idr(&thermal_tz_idr, &thermal_idr_lock, tz->id);
idr_destroy(&tz->idr);
--
2.4.3
next prev parent reply other threads:[~2015-08-25 19:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-25 19:58 [RFC PATCH v1 0/3] thermal: iio bindings Srinivas Pandruvada
2015-08-25 19:58 ` [RFC PATCH v1 1/3] thermal: iio device for thermal sensor Srinivas Pandruvada
2015-08-31 16:52 ` Jonathan Cameron
2015-08-25 19:58 ` Srinivas Pandruvada [this message]
2015-08-25 19:58 ` [RFC PATCH v1 3/3] thermal: user space governor: Notification for IIO bindings Srinivas Pandruvada
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=1440532712-5025-3-git-send-email-srinivas.pandruvada@linux.intel.com \
--to=srinivas.pandruvada@linux.intel.com \
--cc=edubezval@gmail.com \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rui.zhang@intel.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).