Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.49 KB | None | 0 0
  1. diff --git a/drivers/thermal/armada_thermal.c b/drivers/thermal/armada_thermal.c
  2. index 53129de59dd9..5f4c7427f7b1 100644
  3. --- a/drivers/thermal/armada_thermal.c
  4. +++ b/drivers/thermal/armada_thermal.c
  5. @@ -136,17 +136,6 @@ struct armada_drvdata {
  6. } data;
  7. };
  8.  
  9. -/*
  10. - * struct armada_thermal_sensor - hold the information of one thermal sensor
  11. - * @thermal: pointer to the local private structure
  12. - * @tzd: pointer to the thermal zone device
  13. - * @id: identifier of the thermal sensor
  14. - */
  15. -struct armada_thermal_sensor {
  16. - struct armada_thermal_priv *priv;
  17. - int id;
  18. -};
  19. -
  20. static void armadaxp_init(struct platform_device *pdev,
  21. struct armada_thermal_priv *priv)
  22. {
  23. @@ -429,16 +418,15 @@ static struct thermal_zone_device_ops legacy_ops = {
  24. .get_temp = armada_get_temp_legacy,
  25. };
  26.  
  27. -static int armada_get_temp(void *_sensor, int *temp)
  28. +static int armada_get_temp(int id, void *priv, int *temp)
  29. {
  30. - struct armada_thermal_sensor *sensor = _sensor;
  31. - struct armada_thermal_priv *priv = sensor->priv;
  32. + struct armada_thermal_priv *priv = priv;
  33. int ret;
  34.  
  35. mutex_lock(&priv->update_lock);
  36.  
  37. /* Select the desired channel */
  38. - ret = armada_select_channel(priv, sensor->id);
  39. + ret = armada_select_channel(priv, id);
  40. if (ret)
  41. goto unlock_mutex;
  42.  
  43. @@ -460,7 +448,7 @@ static int armada_get_temp(void *_sensor, int *temp)
  44. }
  45.  
  46. static const struct thermal_zone_of_device_ops of_ops = {
  47. - .get_temp = armada_get_temp,
  48. + .get_temp_id = armada_get_temp,
  49. };
  50.  
  51. static unsigned int armada_mc_to_reg_temp(struct armada_thermal_data *data,
  52. @@ -922,17 +910,8 @@ static int armada_thermal_probe(struct platform_device *pdev)
  53. * channel has one sensor.
  54. */
  55. for (sensor_id = 0; sensor_id <= priv->data->cpu_nr; sensor_id++) {
  56. - sensor = devm_kzalloc(&pdev->dev,
  57. - sizeof(struct armada_thermal_sensor),
  58. - GFP_KERNEL);
  59. - if (!sensor)
  60. - return -ENOMEM;
  61. -
  62. - /* Register the sensor */
  63. - sensor->priv = priv;
  64. - sensor->id = sensor_id;
  65. tz = devm_thermal_zone_of_sensor_register(&pdev->dev,
  66. - sensor->id, sensor,
  67. + sensor_id, priv,
  68. &of_ops);
  69. if (IS_ERR(tz)) {
  70. dev_info(&pdev->dev, "Thermal sensor %d unavailable\n",
  71. @@ -947,7 +926,7 @@ static int armada_thermal_probe(struct platform_device *pdev)
  72. * critical trip points will simply be ignored by the driver.
  73. */
  74. if (irq > 0 && !priv->overheat_sensor)
  75. - armada_configure_overheat_int(priv, tz, sensor->id);
  76. + armada_configure_overheat_int(priv, tz, sensor_id);
  77. }
  78.  
  79. /* Just complain if no overheat interrupt was set up */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement