@@ -363,13 +363,13 @@ int twl_i2c_write(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes)
363
363
pr_err ("%s: invalid module number %d\n" , DRIVER_NAME , mod_no );
364
364
return - EPERM ;
365
365
}
366
- sid = twl_map [mod_no ].sid ;
367
- twl = & twl_modules [sid ];
368
-
369
366
if (unlikely (!inuse )) {
370
- pr_err ("%s: client %d is not initialized\n" , DRIVER_NAME , sid );
367
+ pr_err ("%s: not initialized\n" , DRIVER_NAME );
371
368
return - EPERM ;
372
369
}
370
+ sid = twl_map [mod_no ].sid ;
371
+ twl = & twl_modules [sid ];
372
+
373
373
mutex_lock (& twl -> xfer_lock );
374
374
/*
375
375
* [MSG1]: fill the register address data
@@ -420,13 +420,13 @@ int twl_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes)
420
420
pr_err ("%s: invalid module number %d\n" , DRIVER_NAME , mod_no );
421
421
return - EPERM ;
422
422
}
423
- sid = twl_map [mod_no ].sid ;
424
- twl = & twl_modules [sid ];
425
-
426
423
if (unlikely (!inuse )) {
427
- pr_err ("%s: client %d is not initialized\n" , DRIVER_NAME , sid );
424
+ pr_err ("%s: not initialized\n" , DRIVER_NAME );
428
425
return - EPERM ;
429
426
}
427
+ sid = twl_map [mod_no ].sid ;
428
+ twl = & twl_modules [sid ];
429
+
430
430
mutex_lock (& twl -> xfer_lock );
431
431
/* [MSG1] fill the register address data */
432
432
msg = & twl -> xfer_msg [0 ];
0 commit comments