Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 363962
b: refs/heads/master
c: f155333
h: refs/heads/master
v: v3
  • Loading branch information
Eduardo Valentin authored and Greg Kroah-Hartman committed Apr 8, 2013
1 parent 0533f03 commit a499a12
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 537eb9364ccdce6713f55dc004ceb76b63735ba9
refs/heads/master: f1553334236701f1c790d6dc800d8f327b6c5166
27 changes: 22 additions & 5 deletions trunk/drivers/staging/ti-soc-thermal/ti-bandgap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1305,12 +1305,18 @@ int ti_bandgap_probe(struct platform_device *pdev)
for (i = 0; i < bgp->conf->sensor_count; i++) {
char *domain;

if (bgp->conf->sensors[i].register_cooling)
bgp->conf->sensors[i].register_cooling(bgp, i);
if (bgp->conf->sensors[i].register_cooling) {
ret = bgp->conf->sensors[i].register_cooling(bgp, i);
if (ret)
goto remove_sensors;
}

domain = bgp->conf->sensors[i].domain;
if (bgp->conf->expose_sensor)
bgp->conf->expose_sensor(bgp, i, domain);
if (bgp->conf->expose_sensor) {
domain = bgp->conf->sensors[i].domain;
ret = bgp->conf->expose_sensor(bgp, i, domain);
if (ret)
goto remove_last_cooling;
}
}

/*
Expand All @@ -1329,6 +1335,17 @@ int ti_bandgap_probe(struct platform_device *pdev)

return 0;

remove_last_cooling:
if (bgp->conf->sensors[i].unregister_cooling)
bgp->conf->sensors[i].unregister_cooling(bgp, i);
remove_sensors:
for (i--; i >= 0; i--) {
if (bgp->conf->sensors[i].unregister_cooling)
bgp->conf->sensors[i].unregister_cooling(bgp, i);
if (bgp->conf->remove_sensor)
bgp->conf->remove_sensor(bgp, i);
}
ti_bandgap_power(bgp, false);
disable_clk:
if (TI_BANDGAP_HAS(bgp, CLK_CTRL))
clk_disable_unprepare(bgp->fclock);
Expand Down
5 changes: 5 additions & 0 deletions trunk/drivers/staging/ti-soc-thermal/ti-thermal-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,11 @@ int ti_thermal_register_cpu_cooling(struct ti_bandgap *bgp, int id)
if (!data)
return -EINVAL;

if (!cpufreq_get_current_driver()) {
dev_dbg(bgp->dev, "no cpufreq driver yet\n");
return -EPROBE_DEFER;
}

/* Register cooling device */
data->cool_dev = cpufreq_cooling_register(cpu_present_mask);
if (IS_ERR_OR_NULL(data->cool_dev)) {
Expand Down

0 comments on commit a499a12

Please sign in to comment.