Hi Rui, > > On 五, 2012-04-06 at 16:41 +0530, Durgadoss R wrote: > > Some of the thermal drivers using the Generic Thermal Framework > > require (all/some) trip points to be writeable. This patch makes > > the trip point temperatures writeable on a per-trip point basis, > > and modifies the required function call in thermal.c. This patch > > also updates the Documentation to reflect the new change. > > > I'm okay with this patch, except some minor comments. > > > Signed-off-by: Durgadoss R <durgadoss.r@xxxxxxxxx> > > Acked-by: Zhang Rui <rui.zhang@xxxxxxxxx> Thank you.. > > > --- > > v1 > > * patch1/2: Code for making trip points writeable > > * patch2/2: Change the callee in thermal.c > > v2 > > * Make both the changes in a single patch > > * Update Documentation/thermal/sysfs-api.txt > > v3 > > * Re-submitting, on top of the latest mainline kernel > > --- > > Documentation/thermal/sysfs-api.txt | 4 +- > > drivers/acpi/thermal.c | 4 +- > > drivers/thermal/thermal_sys.c | 112 +++++++++++++++++++++++---------- > -- > > include/linux/thermal.h | 10 ++- > > 4 files changed, 87 insertions(+), 43 deletions(-) > > > > > +/** > > * thermal_zone_device_register - register a new thermal zone device > > * @type: the thermal zone device type > > * @trips: the number of trip points the thermal zone support > > + * @flag: a bit string indicating the writeablility of trip points > > * @devdata: private device data > > * @ops: standard thermal zone device callbacks > > * @tc1: thermal coefficient 1 for passive calculations > > @@ -1107,7 +1147,7 @@ EXPORT_SYMBOL(thermal_zone_device_update); > > * section 11.1.5.1 of the ACPI specification 3.0. > > */ > > struct thermal_zone_device *thermal_zone_device_register(char *type, > > - int trips, void *devdata, > > + int trips, int flag, void *devdata, > > const struct thermal_zone_device_ops *ops, > > int tc1, int tc2, int passive_delay, int polling_delay) > > { > > Do we need a simple check of the "flag" parameter? > e.g, > if (flag >> trips) > return -EINVAL; I agree with you. Will add this check and send v4 of the patch. > > BTW, should we introduce some helper function like this > THERMAL_SET_TRIP_WRITABLE (trip, flag) flag |= 1 << trip; > Since the callers of this API pass the flag, I thought they will handle this. Thanks, Durga ��.n��������+%������w��{.n�����{�����ܨ}���Ơz�j:+v�����w����ޙ��&�)ߡ�a����z�ޗ���ݢj��w�f