diff options
Diffstat (limited to 'drivers/power/avs/smartreflex.c')
-rw-r--r-- | drivers/power/avs/smartreflex.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/drivers/power/avs/smartreflex.c b/drivers/power/avs/smartreflex.c index 08a8a299f1fd..14cce7addbb9 100644 --- a/drivers/power/avs/smartreflex.c +++ b/drivers/power/avs/smartreflex.c | |||
@@ -552,7 +552,7 @@ int sr_configure_minmax(struct omap_sr *sr) | |||
552 | 552 | ||
553 | /** | 553 | /** |
554 | * sr_enable() - Enables the smartreflex module. | 554 | * sr_enable() - Enables the smartreflex module. |
555 | * @voltdm: VDD pointer to which the SR module to be configured belongs to. | 555 | * @sr: pointer to which the SR module to be configured belongs to. |
556 | * @volt: The voltage at which the Voltage domain associated with | 556 | * @volt: The voltage at which the Voltage domain associated with |
557 | * the smartreflex module is operating at. | 557 | * the smartreflex module is operating at. |
558 | * This is required only to program the correct Ntarget value. | 558 | * This is required only to program the correct Ntarget value. |
@@ -561,16 +561,16 @@ int sr_configure_minmax(struct omap_sr *sr) | |||
561 | * enable a smartreflex module. Returns 0 on success. Returns error | 561 | * enable a smartreflex module. Returns 0 on success. Returns error |
562 | * value if the voltage passed is wrong or if ntarget value is wrong. | 562 | * value if the voltage passed is wrong or if ntarget value is wrong. |
563 | */ | 563 | */ |
564 | int sr_enable(struct voltagedomain *voltdm, unsigned long volt) | 564 | int sr_enable(struct omap_sr *sr, unsigned long volt) |
565 | { | 565 | { |
566 | struct omap_volt_data *volt_data; | 566 | struct omap_volt_data *volt_data; |
567 | struct omap_sr *sr = _sr_lookup(voltdm); | ||
568 | struct omap_sr_nvalue_table *nvalue_row; | 567 | struct omap_sr_nvalue_table *nvalue_row; |
569 | int ret; | 568 | int ret; |
570 | 569 | ||
571 | if (IS_ERR(sr)) { | 570 | if (!sr) { |
572 | pr_warning("%s: omap_sr struct for voltdm not found\n", __func__); | 571 | pr_warn("%s: NULL omap_sr from %pF\n", __func__, |
573 | return PTR_ERR(sr); | 572 | (void *)_RET_IP_); |
573 | return -EINVAL; | ||
574 | } | 574 | } |
575 | 575 | ||
576 | volt_data = omap_voltage_get_voltdata(sr->voltdm, volt); | 576 | volt_data = omap_voltage_get_voltdata(sr->voltdm, volt); |
@@ -612,17 +612,16 @@ int sr_enable(struct voltagedomain *voltdm, unsigned long volt) | |||
612 | 612 | ||
613 | /** | 613 | /** |
614 | * sr_disable() - Disables the smartreflex module. | 614 | * sr_disable() - Disables the smartreflex module. |
615 | * @voltdm: VDD pointer to which the SR module to be configured belongs to. | 615 | * @sr: pointer to which the SR module to be configured belongs to. |
616 | * | 616 | * |
617 | * This API is to be called from the smartreflex class driver to | 617 | * This API is to be called from the smartreflex class driver to |
618 | * disable a smartreflex module. | 618 | * disable a smartreflex module. |
619 | */ | 619 | */ |
620 | void sr_disable(struct voltagedomain *voltdm) | 620 | void sr_disable(struct omap_sr *sr) |
621 | { | 621 | { |
622 | struct omap_sr *sr = _sr_lookup(voltdm); | 622 | if (!sr) { |
623 | 623 | pr_warn("%s: NULL omap_sr from %pF\n", __func__, | |
624 | if (IS_ERR(sr)) { | 624 | (void *)_RET_IP_); |
625 | pr_warning("%s: omap_sr struct for voltdm not found\n", __func__); | ||
626 | return; | 625 | return; |
627 | } | 626 | } |
628 | 627 | ||