thermal: tegra: aotag: use sensor_register2 API
navneet kumar [Mon, 27 Oct 2014 20:02:39 +0000 (13:02 -0700)]
Use of_thermal_sensor_register2 API to register the
sensor, passing a ssensor_ops struct instead of the
callback functions as separate arguments.

Change-Id: I05f3a3f2f5f330c526609f0f469089d77b55b8e2
Signed-off-by: navneet kumar <navneetk@nvidia.com>
Reviewed-on: http://git-master/r/590502
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>

drivers/thermal/tegra_aotag.c

index e63894a..f89b41b 100644 (file)
@@ -272,8 +272,7 @@ struct aotag_sensor_info_t {
        u32 advertised_id;
        const char *name;
        struct sensor_common_params_t sensor_common_params;
-       int (*of_get_temp)(void*, long*);
-       int (*of_get_trend)(void*, long*);
+       struct thermal_of_sensor_ops sops;
        struct thermal_zone_device *tzd;
        struct fuse_info_t fuse_info;
        s32 therm_a;
@@ -459,8 +458,8 @@ static int aotag_parse_sensor_params(struct platform_device *pdev)
                        pfuse->compensation_a, pfuse->compensation_b);
 
 
-       psensor_info->of_get_temp = aotag_get_temp_generic;
-       psensor_info->of_get_trend = aotag_get_trend_generic;
+       psensor_info->sops.get_temp = aotag_get_temp_generic;
+       psensor_info->sops.get_trend = aotag_get_trend_generic;
        aotag_pdev_print(info, pdev,
                        "sensor found :ID %d, Name: %s\n",
                        psensor_info->id,
@@ -491,12 +490,11 @@ static int aotag_register_sensors(struct platform_device *pdev)
                        "Registering sensor %d\n", ps_info->id);
 
        ptz = NULL;
-       ptz = thermal_zone_of_sensor_register(
+       ptz = thermal_zone_of_sensor_register2(
                        dev,
                        ps_info->id,
                        pdev,
-                       ps_info->of_get_temp,
-                       ps_info->of_get_trend);
+                       &ps_info->sops);
        if (IS_ERR(ptz)) {
                aotag_pdev_print(alert, pdev,
                                "Failed to register sensor %d\n",