@@ -2642,45 +2642,6 @@ static int regulator_ena_gpio_ctrl(struct regulator_dev *rdev, bool enable)
2642
2642
return 0 ;
2643
2643
}
2644
2644
2645
- /**
2646
- * _regulator_delay_helper - a delay helper function
2647
- * @delay: time to delay in microseconds
2648
- *
2649
- * Delay for the requested amount of time as per the guidelines in:
2650
- *
2651
- * Documentation/timers/timers-howto.rst
2652
- *
2653
- * The assumption here is that these regulator operations will never used in
2654
- * atomic context and therefore sleeping functions can be used.
2655
- */
2656
- static void _regulator_delay_helper (unsigned int delay )
2657
- {
2658
- unsigned int ms = delay / 1000 ;
2659
- unsigned int us = delay % 1000 ;
2660
-
2661
- if (ms > 0 ) {
2662
- /*
2663
- * For small enough values, handle super-millisecond
2664
- * delays in the usleep_range() call below.
2665
- */
2666
- if (ms < 20 )
2667
- us += ms * 1000 ;
2668
- else
2669
- msleep (ms );
2670
- }
2671
-
2672
- /*
2673
- * Give the scheduler some room to coalesce with any other
2674
- * wakeup sources. For delays shorter than 10 us, don't even
2675
- * bother setting up high-resolution timers and just busy-
2676
- * loop.
2677
- */
2678
- if (us >= 10 )
2679
- usleep_range (us , us + 100 );
2680
- else
2681
- udelay (us );
2682
- }
2683
-
2684
2645
/**
2685
2646
* _regulator_check_status_enabled - check if regulator status can be
2686
2647
* interpreted as "regulator is enabled"
@@ -2733,7 +2694,7 @@ static int _regulator_do_enable(struct regulator_dev *rdev)
2733
2694
s64 remaining = ktime_us_delta (end , ktime_get_boottime ());
2734
2695
2735
2696
if (remaining > 0 )
2736
- _regulator_delay_helper (remaining );
2697
+ fsleep (remaining );
2737
2698
}
2738
2699
2739
2700
if (rdev -> ena_pin ) {
@@ -2767,7 +2728,7 @@ static int _regulator_do_enable(struct regulator_dev *rdev)
2767
2728
int time_remaining = delay ;
2768
2729
2769
2730
while (time_remaining > 0 ) {
2770
- _regulator_delay_helper (rdev -> desc -> poll_enabled_time );
2731
+ fsleep (rdev -> desc -> poll_enabled_time );
2771
2732
2772
2733
if (rdev -> desc -> ops -> get_status ) {
2773
2734
ret = _regulator_check_status_enabled (rdev );
@@ -2786,7 +2747,7 @@ static int _regulator_do_enable(struct regulator_dev *rdev)
2786
2747
return - ETIMEDOUT ;
2787
2748
}
2788
2749
} else {
2789
- _regulator_delay_helper (delay );
2750
+ fsleep (delay );
2790
2751
}
2791
2752
2792
2753
trace_regulator_enable_complete (rdev_get_name (rdev ));
@@ -3730,7 +3691,7 @@ static int _regulator_do_set_voltage(struct regulator_dev *rdev,
3730
3691
}
3731
3692
3732
3693
/* Insert any necessary delays */
3733
- _regulator_delay_helper (delay );
3694
+ fsleep (delay );
3734
3695
3735
3696
if (best_val >= 0 ) {
3736
3697
unsigned long data = best_val ;
0 commit comments