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: chipone_icn8318 - 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/chipone_icn8318.c
··· 152 152 { 153 153 struct icn8318_data *data = i2c_get_clientdata(to_i2c_client(dev)); 154 154 155 - mutex_lock(&data->input->mutex); 155 + guard(mutex)(&data->input->mutex); 156 + 156 157 if (input_device_enabled(data->input)) 157 158 icn8318_stop(data->input); 158 - mutex_unlock(&data->input->mutex); 159 159 160 160 return 0; 161 161 } ··· 164 164 { 165 165 struct icn8318_data *data = i2c_get_clientdata(to_i2c_client(dev)); 166 166 167 - mutex_lock(&data->input->mutex); 167 + guard(mutex)(&data->input->mutex); 168 + 168 169 if (input_device_enabled(data->input)) 169 170 icn8318_start(data->input); 170 - mutex_unlock(&data->input->mutex); 171 171 172 172 return 0; 173 173 }