Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Input: lpc32xx_ts - use guard notation when acquiring mutex

Guard notation simplifies code.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

+2 -6
+2 -6
drivers/input/touchscreen/lpc32xx_ts.c
··· 279 279 * avoid calling the TSC stop and start functions as the TSC 280 280 * isn't yet clocked. 281 281 */ 282 - mutex_lock(&input->mutex); 282 + guard(mutex)(&input->mutex); 283 283 284 284 if (input_device_enabled(input)) { 285 285 if (device_may_wakeup(dev)) ··· 287 287 else 288 288 lpc32xx_stop_tsc(tsc); 289 289 } 290 - 291 - mutex_unlock(&input->mutex); 292 290 293 291 return 0; 294 292 } ··· 296 298 struct lpc32xx_tsc *tsc = dev_get_drvdata(dev); 297 299 struct input_dev *input = tsc->dev; 298 300 299 - mutex_lock(&input->mutex); 301 + guard(mutex)(&input->mutex); 300 302 301 303 if (input_device_enabled(input)) { 302 304 if (device_may_wakeup(dev)) ··· 304 306 else 305 307 lpc32xx_setup_tsc(tsc); 306 308 } 307 - 308 - mutex_unlock(&input->mutex); 309 309 310 310 return 0; 311 311 }