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: novatek-nvt-ts - use guard notation when acquiring mutex

Guard notation simplifies code.

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

+4 -4
+4 -4
drivers/input/touchscreen/novatek-nvt-ts.c
··· 170 170 { 171 171 struct nvt_ts_data *data = i2c_get_clientdata(to_i2c_client(dev)); 172 172 173 - mutex_lock(&data->input->mutex); 173 + guard(mutex)(&data->input->mutex); 174 + 174 175 if (input_device_enabled(data->input)) 175 176 nvt_ts_stop(data->input); 176 - mutex_unlock(&data->input->mutex); 177 177 178 178 return 0; 179 179 } ··· 182 182 { 183 183 struct nvt_ts_data *data = i2c_get_clientdata(to_i2c_client(dev)); 184 184 185 - mutex_lock(&data->input->mutex); 185 + guard(mutex)(&data->input->mutex); 186 + 186 187 if (input_device_enabled(data->input)) 187 188 nvt_ts_start(data->input); 188 - mutex_unlock(&data->input->mutex); 189 189 190 190 return 0; 191 191 }