@@ -58,14 +58,14 @@ static int cros_ucsi_read(struct ucsi *ucsi, unsigned int offset, void *val,
58
58
int ret ;
59
59
60
60
if (val_len > MAX_EC_DATA_SIZE ) {
61
- dev_err (udata -> dev , "Can't read %zu bytes. Too big." , val_len );
61
+ dev_err (udata -> dev , "Can't read %zu bytes. Too big.\n " , val_len );
62
62
return - EINVAL ;
63
63
}
64
64
65
65
ret = cros_ec_cmd (udata -> ec , 0 , EC_CMD_UCSI_PPM_GET ,
66
66
& req , sizeof (req ), val , val_len );
67
67
if (ret < 0 ) {
68
- dev_warn (udata -> dev , "Failed to send EC message UCSI_PPM_GET: error=%d" , ret );
68
+ dev_warn (udata -> dev , "Failed to send EC message UCSI_PPM_GET: error=%d\n " , ret );
69
69
return ret ;
70
70
}
71
71
return 0 ;
@@ -99,7 +99,7 @@ static int cros_ucsi_async_control(struct ucsi *ucsi, u64 cmd)
99
99
ret = cros_ec_cmd (udata -> ec , 0 , EC_CMD_UCSI_PPM_SET ,
100
100
req , sizeof (ec_buf ), NULL , 0 );
101
101
if (ret < 0 ) {
102
- dev_warn (udata -> dev , "Failed to send EC message UCSI_PPM_SET: error=%d" , ret );
102
+ dev_warn (udata -> dev , "Failed to send EC message UCSI_PPM_SET: error=%d\n " , ret );
103
103
return ret ;
104
104
}
105
105
return 0 ;
@@ -161,7 +161,7 @@ static void cros_ucsi_write_timeout(struct work_struct *work)
161
161
162
162
if (cros_ucsi_read (udata -> ucsi , UCSI_CCI , & cci , sizeof (cci ))) {
163
163
dev_err (udata -> dev ,
164
- "Reading CCI failed; no write timeout recovery possible." );
164
+ "Reading CCI failed; no write timeout recovery possible.\n " );
165
165
return ;
166
166
}
167
167
@@ -173,7 +173,7 @@ static void cros_ucsi_write_timeout(struct work_struct *work)
173
173
msecs_to_jiffies (WRITE_TMO_MS ));
174
174
else
175
175
dev_err (udata -> dev ,
176
- "PPM unresponsive - too many write timeouts." );
176
+ "PPM unresponsive - too many write timeouts.\n " );
177
177
178
178
return ;
179
179
}
@@ -208,7 +208,7 @@ static int cros_ucsi_event(struct notifier_block *nb,
208
208
if (!(host_event & PD_EVENT_PPM ))
209
209
return NOTIFY_OK ;
210
210
211
- dev_dbg (udata -> dev , "UCSI notification received" );
211
+ dev_dbg (udata -> dev , "UCSI notification received\n " );
212
212
flush_work (& udata -> work );
213
213
schedule_work (& udata -> work );
214
214
@@ -237,10 +237,8 @@ static int cros_ucsi_probe(struct platform_device *pdev)
237
237
udata -> dev = dev ;
238
238
239
239
udata -> ec = ec_data -> ec_dev ;
240
- if (!udata -> ec ) {
241
- dev_err (dev , "couldn't find parent EC device" );
242
- return - ENODEV ;
243
- }
240
+ if (!udata -> ec )
241
+ return dev_err_probe (dev , - ENODEV , "couldn't find parent EC device\n" );
244
242
245
243
platform_set_drvdata (pdev , udata );
246
244
@@ -249,24 +247,22 @@ static int cros_ucsi_probe(struct platform_device *pdev)
249
247
init_completion (& udata -> complete );
250
248
251
249
udata -> ucsi = ucsi_create (dev , & cros_ucsi_ops );
252
- if (IS_ERR (udata -> ucsi )) {
253
- dev_err (dev , "failed to allocate UCSI instance" );
254
- return PTR_ERR (udata -> ucsi );
255
- }
250
+ if (IS_ERR (udata -> ucsi ))
251
+ return dev_err_probe (dev , PTR_ERR (udata -> ucsi ), "failed to allocate UCSI instance\n" );
256
252
257
253
ucsi_set_drvdata (udata -> ucsi , udata );
258
254
259
255
udata -> nb .notifier_call = cros_ucsi_event ;
260
256
ret = cros_usbpd_register_notify (& udata -> nb );
261
257
if (ret ) {
262
- dev_err (dev , "failed to register notifier: error=%d" , ret );
258
+ dev_err_probe (dev , ret , "failed to register notifier\n" );
263
259
ucsi_destroy (udata -> ucsi );
264
260
return ret ;
265
261
}
266
262
267
263
ret = ucsi_register (udata -> ucsi );
268
264
if (ret ) {
269
- dev_err (dev , "failed to register UCSI: error=%d" , ret );
265
+ dev_err_probe (dev , ret , "failed to register UCSI\n" );
270
266
cros_ucsi_destroy (udata );
271
267
return ret ;
272
268
}
0 commit comments