]> rtime.felk.cvut.cz Git - hercules2020/nv-tegra/linux-4.4.git/commitdiff
tegra: thermal: remove fwd decl
authorSrikar Srimath Tirumala <srikars@nvidia.com>
Tue, 18 Oct 2016 20:43:36 +0000 (13:43 -0700)
committermobile promotions <svcmobile_promotions@nvidia.com>
Tue, 29 Nov 2016 07:28:49 +0000 (23:28 -0800)
Move routines to remove forward declarations

Bug 200233003

Change-Id: I0e876bfff0a7fb2a8d2a9e27ad48958a1eba840c
Signed-off-by: Srikar Srimath Tirumala <srikars@nvidia.com>
Reviewed-on: http://git-master/r/1240757
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Navneet Kumar <navneetk@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Jon Mayo <jmayo@nvidia.com>
drivers/thermal/tegra/soctherm.c

index 6a8a28c9377ef0055f104e85a3d3913613f1ec5b..f725eb633317c0e67292a7b1c8b5629325fe1876 100644 (file)
@@ -267,62 +267,6 @@ static int tegra_thermctl_get_temp(void *data, int *out_temp)
        return 0;
 }
 
-static int
-thermtrip_program(struct device *dev, const struct tegra_tsensor_group *sg,
-                 int trip_temp);
-static int
-throttrip_program(struct device *dev, const struct tegra_tsensor_group *sg,
-                 struct soctherm_throt_cfg *stc, int trip_temp);
-static struct soctherm_throt_cfg *
-find_throttle_cfg_by_name(struct tegra_soctherm *ts, const char *name);
-
-static int tegra_thermctl_set_trip_temp(void *data, int trip, int temp)
-{
-       struct tegra_thermctl_zone *zone = data;
-       struct thermal_zone_device *tz = zone->tz;
-       struct tegra_soctherm *ts = zone->ts;
-       const struct tegra_tsensor_group *sg = zone->sg;
-       struct device *dev = zone->dev;
-       enum thermal_trip_type type;
-       int ret;
-
-       if (!tz)
-               return -EINVAL;
-
-       ret = tz->ops->get_trip_type(tz, trip, &type);
-       if (ret)
-               return ret;
-
-       if (type == THERMAL_TRIP_CRITICAL) {
-               return thermtrip_program(dev, sg, temp);
-       } else if (type == THERMAL_TRIP_HOT) {
-               int i;
-
-               for (i = 0; i < THROTTLE_SIZE; i++) {
-                       struct thermal_cooling_device *cdev;
-                       struct soctherm_throt_cfg *stc;
-
-                       if (!ts->throt_cfgs[i].init)
-                               continue;
-
-                       cdev = ts->throt_cfgs[i].cdev;
-                       if (get_thermal_instance(tz, cdev, trip))
-                               stc = find_throttle_cfg_by_name(ts, cdev->type);
-                       else
-                               continue;
-
-                       return throttrip_program(dev, sg, stc, temp);
-               }
-       }
-
-       return 0;
-}
-
-static const struct thermal_zone_of_device_ops tegra_of_thermal_ops = {
-       .get_temp = tegra_thermctl_get_temp,
-       .set_trip_temp = tegra_thermctl_set_trip_temp,
-};
-
 /**
  * enforce_temp_range() - check and enforce temperature range [min, max]
  * @trip_temp: the trip temperature to check
@@ -453,6 +397,53 @@ find_throttle_cfg_by_name(struct tegra_soctherm *ts, const char *name)
        return NULL;
 }
 
+static int tegra_thermctl_set_trip_temp(void *data, int trip, int temp)
+{
+       struct tegra_thermctl_zone *zone = data;
+       struct thermal_zone_device *tz = zone->tz;
+       struct tegra_soctherm *ts = zone->ts;
+       const struct tegra_tsensor_group *sg = zone->sg;
+       struct device *dev = zone->dev;
+       enum thermal_trip_type type;
+       int ret;
+
+       if (!tz)
+               return -EINVAL;
+
+       ret = tz->ops->get_trip_type(tz, trip, &type);
+       if (ret)
+               return ret;
+
+       if (type == THERMAL_TRIP_CRITICAL) {
+               return thermtrip_program(dev, sg, temp);
+       } else if (type == THERMAL_TRIP_HOT) {
+               int i;
+
+               for (i = 0; i < THROTTLE_SIZE; i++) {
+                       struct thermal_cooling_device *cdev;
+                       struct soctherm_throt_cfg *stc;
+
+                       if (!ts->throt_cfgs[i].init)
+                               continue;
+
+                       cdev = ts->throt_cfgs[i].cdev;
+                       if (get_thermal_instance(tz, cdev, trip))
+                               stc = find_throttle_cfg_by_name(ts, cdev->type);
+                       else
+                               continue;
+
+                       return throttrip_program(dev, sg, stc, temp);
+               }
+       }
+
+       return 0;
+}
+
+static const struct thermal_zone_of_device_ops tegra_of_thermal_ops = {
+       .get_temp = tegra_thermctl_get_temp,
+       .set_trip_temp = tegra_thermctl_set_trip_temp,
+};
+
 static int get_hot_temp(struct thermal_zone_device *tz, int *trip, int *temp)
 {
        int ntrips, i, ret;