int sid;
struct twl_client *twl;
- if (unlikely(mod_no >= twl_get_last_module())) {
- pr_err("%s: invalid module number %d\n", DRIVER_NAME, mod_no);
+ if (unlikely(!twl_priv || !twl_priv->ready)) {
+ pr_err("%s: not initialized\n", DRIVER_NAME);
return -EPERM;
}
- if (unlikely(!twl_priv->ready)) {
- pr_err("%s: not initialized\n", DRIVER_NAME);
+ if (unlikely(mod_no >= twl_get_last_module())) {
+ pr_err("%s: invalid module number %d\n", DRIVER_NAME, mod_no);
return -EPERM;
}
int sid;
struct twl_client *twl;
- if (unlikely(mod_no >= twl_get_last_module())) {
- pr_err("%s: invalid module number %d\n", DRIVER_NAME, mod_no);
+ if (unlikely(!twl_priv || !twl_priv->ready)) {
+ pr_err("%s: not initialized\n", DRIVER_NAME);
return -EPERM;
}
- if (unlikely(!twl_priv->ready)) {
- pr_err("%s: not initialized\n", DRIVER_NAME);
+ if (unlikely(mod_no >= twl_get_last_module())) {
+ pr_err("%s: invalid module number %d\n", DRIVER_NAME, mod_no);
return -EPERM;
}