Skip to content

Commit 6c1ca56

Browse files
hvaibhavgregkh
authored andcommitted
greybus: arche-platform: Rename spinlock variable lock => wake_detect_lock
With addition of exported function, required for TIMESYNC operation, we need more locking mechanism for driver state, so to avoid confusion rename existing spinlock variable to its appropriate name. Testing Done: Tested on DB3.5 platform. Signed-off-by: Vaibhav Hiremath <[email protected]> Signed-off-by: Bryan O'Donoghue <[email protected]> Reviewed-by: Alex Elder <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 521d0d5 commit 6c1ca56

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

drivers/staging/greybus/arche-platform.c

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ struct arche_platform_drvdata {
5555

5656
enum svc_wakedetect_state wake_detect_state;
5757
int wake_detect_irq;
58-
spinlock_t lock;
58+
spinlock_t wake_lock; /* Protect wake_detect_state */
5959
unsigned long wake_detect_start;
6060
struct notifier_block pm_notifier;
6161

@@ -117,15 +117,15 @@ static irqreturn_t arche_platform_wd_irq_thread(int irq, void *devid)
117117
struct arche_platform_drvdata *arche_pdata = devid;
118118
unsigned long flags;
119119

120-
spin_lock_irqsave(&arche_pdata->lock, flags);
120+
spin_lock_irqsave(&arche_pdata->wake_lock, flags);
121121
if (arche_pdata->wake_detect_state != WD_STATE_COLDBOOT_TRIG) {
122122
/* Something is wrong */
123-
spin_unlock_irqrestore(&arche_pdata->lock, flags);
123+
spin_unlock_irqrestore(&arche_pdata->wake_lock, flags);
124124
return IRQ_HANDLED;
125125
}
126126

127127
arche_pdata->wake_detect_state = WD_STATE_COLDBOOT_START;
128-
spin_unlock_irqrestore(&arche_pdata->lock, flags);
128+
spin_unlock_irqrestore(&arche_pdata->wake_lock, flags);
129129

130130
/* It should complete power cycle, so first make sure it is poweroff */
131131
device_for_each_child(arche_pdata->dev, NULL, apb_poweroff);
@@ -137,9 +137,9 @@ static irqreturn_t arche_platform_wd_irq_thread(int irq, void *devid)
137137
if (usb3613_hub_mode_ctrl(true))
138138
dev_warn(arche_pdata->dev, "failed to control hub device\n");
139139

140-
spin_lock_irqsave(&arche_pdata->lock, flags);
140+
spin_lock_irqsave(&arche_pdata->wake_lock, flags);
141141
arche_pdata->wake_detect_state = WD_STATE_IDLE;
142-
spin_unlock_irqrestore(&arche_pdata->lock, flags);
142+
spin_unlock_irqrestore(&arche_pdata->wake_lock, flags);
143143

144144
return IRQ_HANDLED;
145145
}
@@ -149,7 +149,7 @@ static irqreturn_t arche_platform_wd_irq(int irq, void *devid)
149149
struct arche_platform_drvdata *arche_pdata = devid;
150150
unsigned long flags;
151151

152-
spin_lock_irqsave(&arche_pdata->lock, flags);
152+
spin_lock_irqsave(&arche_pdata->wake_lock, flags);
153153

154154
if (gpio_get_value(arche_pdata->wake_detect_gpio)) {
155155
/* wake/detect rising */
@@ -170,7 +170,9 @@ static irqreturn_t arche_platform_wd_irq(int irq, void *devid)
170170
WD_STATE_COLDBOOT_START) {
171171
arche_pdata->wake_detect_state =
172172
WD_STATE_COLDBOOT_TRIG;
173-
spin_unlock_irqrestore(&arche_pdata->lock, flags);
173+
spin_unlock_irqrestore(
174+
&arche_pdata->wake_lock,
175+
flags);
174176
return IRQ_WAKE_THREAD;
175177
}
176178
}
@@ -188,7 +190,7 @@ static irqreturn_t arche_platform_wd_irq(int irq, void *devid)
188190
}
189191
}
190192

191-
spin_unlock_irqrestore(&arche_pdata->lock, flags);
193+
spin_unlock_irqrestore(&arche_pdata->wake_lock, flags);
192194

193195
return IRQ_HANDLED;
194196
}
@@ -257,9 +259,9 @@ static void arche_platform_poweroff_seq(struct arche_platform_drvdata *arche_pda
257259
/* Send disconnect/detach event to SVC */
258260
gpio_direction_output(arche_pdata->wake_detect_gpio, 0);
259261
usleep_range(100, 200);
260-
spin_lock_irqsave(&arche_pdata->lock, flags);
262+
spin_lock_irqsave(&arche_pdata->wake_lock, flags);
261263
arche_pdata->wake_detect_state = WD_STATE_IDLE;
262-
spin_unlock_irqrestore(&arche_pdata->lock, flags);
264+
spin_unlock_irqrestore(&arche_pdata->wake_lock, flags);
263265

264266
clk_disable_unprepare(arche_pdata->svc_ref_clk);
265267
}
@@ -465,7 +467,7 @@ static int arche_platform_probe(struct platform_device *pdev)
465467

466468
arche_pdata->dev = &pdev->dev;
467469

468-
spin_lock_init(&arche_pdata->lock);
470+
spin_lock_init(&arche_pdata->wake_lock);
469471
arche_pdata->wake_detect_irq =
470472
gpio_to_irq(arche_pdata->wake_detect_gpio);
471473

0 commit comments

Comments
 (0)