On 10/20/2010 10:05 PM, R, Durgadoss wrote:
+/* trip point temperatures may be configurable */
  static struct device_attribute trip_point_attrs[] = {
-       __ATTR(trip_point_0_type, 0444, trip_point_type_show, NULL),
-       __ATTR(trip_point_0_temp, 0444, trip_point_temp_show, NULL),
-       __ATTR(trip_point_1_type, 0444, trip_point_type_show, NULL),
-       __ATTR(trip_point_1_temp, 0444, trip_point_temp_show, NULL),
-       __ATTR(trip_point_2_type, 0444, trip_point_type_show, NULL),
-       __ATTR(trip_point_2_temp, 0444, trip_point_temp_show, NULL),
-       __ATTR(trip_point_3_type, 0444, trip_point_type_show, NULL),
-       __ATTR(trip_point_3_temp, 0444, trip_point_temp_show, NULL),
-       __ATTR(trip_point_4_type, 0444, trip_point_type_show, NULL),
-       __ATTR(trip_point_4_temp, 0444, trip_point_temp_show, NULL),
-       __ATTR(trip_point_5_type, 0444, trip_point_type_show, NULL),
-       __ATTR(trip_point_5_temp, 0444, trip_point_temp_show, NULL),
-       __ATTR(trip_point_6_type, 0444, trip_point_type_show, NULL),
-       __ATTR(trip_point_6_temp, 0444, trip_point_temp_show, NULL),
-       __ATTR(trip_point_7_type, 0444, trip_point_type_show, NULL),
-       __ATTR(trip_point_7_temp, 0444, trip_point_temp_show, NULL),
-       __ATTR(trip_point_8_type, 0444, trip_point_type_show, NULL),
-       __ATTR(trip_point_8_temp, 0444, trip_point_temp_show, NULL),
-       __ATTR(trip_point_9_type, 0444, trip_point_type_show, NULL),
-       __ATTR(trip_point_9_temp, 0444, trip_point_temp_show, NULL),
-       __ATTR(trip_point_10_type, 0444, trip_point_type_show, NULL),
-       __ATTR(trip_point_10_temp, 0444, trip_point_temp_show, NULL),
-       __ATTR(trip_point_11_type, 0444, trip_point_type_show, NULL),
-       __ATTR(trip_point_11_temp, 0444, trip_point_temp_show, NULL),
+       __ATTR(trip_point_0_type, S_IRUGO, trip_point_type_show, NULL),
+       __ATTR(trip_point_0_temp, S_IRUGO | S_IWUSR, trip_point_temp_show,
+               trip_point_temp_store),

while this might be a nice cleanup (minus the line wrap damage), it really does not belong in this patch, and really should be separate (and upstream); mixing this sort of cosmetic/cleanup with real code is really a disaster for us.-subsys_initcall(thermal_init);

+fs_initcall(thermal_init);

this might need justification...
+
+#define KELVIN_TO_CELSIUS(t)   (long)(((long)t-2732>= 0) ?    \
+                               ((long)t-2732+5)/10 : ((long)t-2732-5)/10)
+#define CELSIUS_TO_KELVIN(t)   ((t)*10+2732)

doesn't the kernel already have macros for this?


_______________________________________________
Meego-kernel mailing list
[email protected]
http://lists.meego.com/listinfo/meego-kernel

Reply via email to