staging: hikey9xx: hi6421v600-regulator: get rid of an static data
Move it to be inside the private data struct. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Link: https://lore.kernel.org/r/ff8b6852c788fd476743eb4ce556e4a97f4b928e.1611212783.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Родитель
0b5a562a9e
Коммит
6436a12504
|
@ -28,9 +28,10 @@ struct hi6421_spmi_reg_info {
|
||||||
struct hi6421_spmi_pmic *pmic;
|
struct hi6421_spmi_pmic *pmic;
|
||||||
u8 eco_mode_mask;
|
u8 eco_mode_mask;
|
||||||
u32 eco_uA;
|
u32 eco_uA;
|
||||||
};
|
|
||||||
|
|
||||||
static DEFINE_MUTEX(enable_mutex);
|
/* Serialize regulator enable logic */
|
||||||
|
struct mutex enable_mutex;
|
||||||
|
};
|
||||||
|
|
||||||
static const unsigned int ldo3_voltages[] = {
|
static const unsigned int ldo3_voltages[] = {
|
||||||
1500000, 1550000, 1600000, 1650000,
|
1500000, 1550000, 1600000, 1650000,
|
||||||
|
@ -118,7 +119,7 @@ static int hi6421_spmi_regulator_enable(struct regulator_dev *rdev)
|
||||||
struct hi6421_spmi_pmic *pmic = sreg->pmic;
|
struct hi6421_spmi_pmic *pmic = sreg->pmic;
|
||||||
|
|
||||||
/* cannot enable more than one regulator at one time */
|
/* cannot enable more than one regulator at one time */
|
||||||
mutex_lock(&enable_mutex);
|
mutex_lock(&sreg->enable_mutex);
|
||||||
usleep_range(HISI_REGS_ENA_PROTECT_TIME,
|
usleep_range(HISI_REGS_ENA_PROTECT_TIME,
|
||||||
HISI_REGS_ENA_PROTECT_TIME + 1000);
|
HISI_REGS_ENA_PROTECT_TIME + 1000);
|
||||||
|
|
||||||
|
@ -127,7 +128,7 @@ static int hi6421_spmi_regulator_enable(struct regulator_dev *rdev)
|
||||||
rdev->desc->enable_mask,
|
rdev->desc->enable_mask,
|
||||||
rdev->desc->enable_mask);
|
rdev->desc->enable_mask);
|
||||||
|
|
||||||
mutex_unlock(&enable_mutex);
|
mutex_unlock(&sreg->enable_mutex);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -312,6 +313,7 @@ static int hi6421_spmi_regulator_probe(struct platform_device *pdev)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
sreg->pmic = pmic;
|
sreg->pmic = pmic;
|
||||||
|
mutex_init(&sreg->enable_mutex);
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_SIZE(regulator_info); i++) {
|
for (i = 0; i < ARRAY_SIZE(regulator_info); i++) {
|
||||||
/* assign per-regulator data */
|
/* assign per-regulator data */
|
||||||
|
|
Загрузка…
Ссылка в новой задаче