File tree Expand file tree Collapse file tree
drivers/input/touchscreen Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -703,30 +703,29 @@ static int zinitix_suspend(struct device *dev)
703703 struct i2c_client * client = to_i2c_client (dev );
704704 struct bt541_ts_data * bt541 = i2c_get_clientdata (client );
705705
706- mutex_lock (& bt541 -> input_dev -> mutex );
706+ guard ( mutex ) (& bt541 -> input_dev -> mutex );
707707
708708 if (input_device_enabled (bt541 -> input_dev ))
709709 zinitix_stop (bt541 );
710710
711- mutex_unlock (& bt541 -> input_dev -> mutex );
712-
713711 return 0 ;
714712}
715713
716714static int zinitix_resume (struct device * dev )
717715{
718716 struct i2c_client * client = to_i2c_client (dev );
719717 struct bt541_ts_data * bt541 = i2c_get_clientdata (client );
720- int ret = 0 ;
721-
722- mutex_lock (& bt541 -> input_dev -> mutex );
718+ int error ;
723719
724- if (input_device_enabled (bt541 -> input_dev ))
725- ret = zinitix_start (bt541 );
720+ guard (mutex )(& bt541 -> input_dev -> mutex );
726721
727- mutex_unlock (& bt541 -> input_dev -> mutex );
722+ if (input_device_enabled (bt541 -> input_dev )) {
723+ error = zinitix_start (bt541 );
724+ if (error )
725+ return error ;
726+ }
728727
729- return ret ;
728+ return 0 ;
730729}
731730
732731static DEFINE_SIMPLE_DEV_PM_OPS (zinitix_pm_ops , zinitix_suspend , zinitix_resume ) ;
You can’t perform that action at this time.
0 commit comments