Fix a deadlock in pse_pi_get_current_limit and pse_pi_set_current_limit caused by consecutive mutex_lock calls. One in the function itself and another in pse_pi_get_voltage. Resolve the issue by using the unlocked version of pse_pi_get_voltage instead.
Unified · Split
| @@ -319,7 +319,7 @@ static int pse_pi_get_current_limit(struct regulator_dev *rdev) · 318 unmodified lines | ||
| 319 | 319 | goto out; |
| 320 | 320 | mW = ret; |
| 321 | 321 | |
| 322 | − ret = pse_pi_get_voltage(rdev); | |
| 322 | + ret = _pse_pi_get_voltage(rdev); | |
| 323 | 323 | if (!ret) { |
| 324 | 324 | dev_err(pcdev->dev, "Voltage null\n"); |
| 325 | 325 | ret = -ERANGE; |
| @@ -356,7 +356,7 @@ static int pse_pi_set_current_limit(struct regulator_dev *rdev, int min_uA, · 30 unmodified lines | ||
| 356 | 356 | |
| 357 | 357 | id = rdev_get_id(rdev); |
| 358 | 358 | mutex_lock(&pcdev->lock); |
| 359 | − ret = pse_pi_get_voltage(rdev); | |
| 359 | + ret = _pse_pi_get_voltage(rdev); | |
| 360 | 360 | if (!ret) { |
| 361 | 361 | dev_err(pcdev->dev, "Voltage null\n"); |
| 362 | 362 | ret = -ERANGE; |