Skip to content

Commit f920ec7

Browse files
Sachin Kamatbroonie
authored andcommitted
regulator: max8660: Silence checkpatch warnings
Silences the following type of error/warnings: ERROR: that open brace { should be on the previous line WARNING: Missing a blank line after declarations Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Mark Brown <broonie@linaro.org>
1 parent 67f76a9 commit f920ec7

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

‎drivers/regulator/max8660.c‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,12 @@ struct max8660 {
8585

8686
static int max8660_write(struct max8660 *max8660, u8 reg, u8 mask, u8 val)
8787
{
88-
static const u8 max8660_addresses[MAX8660_N_REGS] =
89-
{ 0x10, 0x12, 0x20, 0x23, 0x24, 0x29, 0x2a, 0x32, 0x33, 0x39, 0x80 };
88+
static const u8 max8660_addresses[MAX8660_N_REGS] = {
89+
0x10, 0x12, 0x20, 0x23, 0x24, 0x29, 0x2a, 0x32, 0x33, 0x39, 0x80 };
9090

9191
int ret;
9292
u8 reg_val = (max8660->shadow_regs[reg] & mask) | val;
93+
9394
dev_vdbg(&max8660->client->dev, "Writing reg %02x with %02x\n",
9495
max8660_addresses[reg], reg_val);
9596

@@ -111,29 +112,32 @@ static int max8660_dcdc_is_enabled(struct regulator_dev *rdev)
111112
struct max8660 *max8660 = rdev_get_drvdata(rdev);
112113
u8 val = max8660->shadow_regs[MAX8660_OVER1];
113114
u8 mask = (rdev_get_id(rdev) == MAX8660_V3) ? 1 : 4;
115+
114116
return !!(val & mask);
115117
}
116118

117119
static int max8660_dcdc_enable(struct regulator_dev *rdev)
118120
{
119121
struct max8660 *max8660 = rdev_get_drvdata(rdev);
120122
u8 bit = (rdev_get_id(rdev) == MAX8660_V3) ? 1 : 4;
123+
121124
return max8660_write(max8660, MAX8660_OVER1, 0xff, bit);
122125
}
123126

124127
static int max8660_dcdc_disable(struct regulator_dev *rdev)
125128
{
126129
struct max8660 *max8660 = rdev_get_drvdata(rdev);
127130
u8 mask = (rdev_get_id(rdev) == MAX8660_V3) ? ~1 : ~4;
131+
128132
return max8660_write(max8660, MAX8660_OVER1, mask, 0);
129133
}
130134

131135
static int max8660_dcdc_get_voltage_sel(struct regulator_dev *rdev)
132136
{
133137
struct max8660 *max8660 = rdev_get_drvdata(rdev);
134-
135138
u8 reg = (rdev_get_id(rdev) == MAX8660_V3) ? MAX8660_ADTV2 : MAX8660_SDTV2;
136139
u8 selector = max8660->shadow_regs[reg];
140+
137141
return selector;
138142
}
139143

@@ -206,29 +210,32 @@ static int max8660_ldo67_is_enabled(struct regulator_dev *rdev)
206210
struct max8660 *max8660 = rdev_get_drvdata(rdev);
207211
u8 val = max8660->shadow_regs[MAX8660_OVER2];
208212
u8 mask = (rdev_get_id(rdev) == MAX8660_V6) ? 2 : 4;
213+
209214
return !!(val & mask);
210215
}
211216

212217
static int max8660_ldo67_enable(struct regulator_dev *rdev)
213218
{
214219
struct max8660 *max8660 = rdev_get_drvdata(rdev);
215220
u8 bit = (rdev_get_id(rdev) == MAX8660_V6) ? 2 : 4;
221+
216222
return max8660_write(max8660, MAX8660_OVER2, 0xff, bit);
217223
}
218224

219225
static int max8660_ldo67_disable(struct regulator_dev *rdev)
220226
{
221227
struct max8660 *max8660 = rdev_get_drvdata(rdev);
222228
u8 mask = (rdev_get_id(rdev) == MAX8660_V6) ? ~2 : ~4;
229+
223230
return max8660_write(max8660, MAX8660_OVER2, mask, 0);
224231
}
225232

226233
static int max8660_ldo67_get_voltage_sel(struct regulator_dev *rdev)
227234
{
228235
struct max8660 *max8660 = rdev_get_drvdata(rdev);
229-
230236
u8 shift = (rdev_get_id(rdev) == MAX8660_V6) ? 0 : 4;
231237
u8 selector = (max8660->shadow_regs[MAX8660_L12VCR] >> shift) & 0xf;
238+
232239
return selector;
233240
}
234241

0 commit comments

Comments
 (0)