File tree Expand file tree Collapse file tree 2 files changed +11
-15
lines changed Expand file tree Collapse file tree 2 files changed +11
-15
lines changed Original file line number Diff line number Diff line change @@ -144,14 +144,14 @@ EXPORT_SYMBOL_GPL(ufshcd_mcq_queue_cfg_addr);
144
144
*/
145
145
int ufshcd_mcq_decide_queue_depth (struct ufs_hba * hba )
146
146
{
147
- int mac ;
147
+ int mac = - EOPNOTSUPP ;
148
148
149
- /* Mandatory to implement get_hba_mac() */
150
- mac = ufshcd_mcq_vops_get_hba_mac ( hba ) ;
151
- if ( mac < 0 ) {
152
- dev_err ( hba -> dev , "Failed to get mac, err=%d\n" , mac );
153
- return mac ;
154
- }
149
+ if (! hba -> vops || ! hba -> vops -> get_hba_mac )
150
+ goto err ;
151
+
152
+ mac = hba -> vops -> get_hba_mac ( hba );
153
+ if ( mac < 0 )
154
+ goto err ;
155
155
156
156
WARN_ON_ONCE (!hba -> dev_info .bqueuedepth );
157
157
/*
@@ -160,6 +160,10 @@ int ufshcd_mcq_decide_queue_depth(struct ufs_hba *hba)
160
160
* shared queuing architecture is enabled.
161
161
*/
162
162
return min_t (int , mac , hba -> dev_info .bqueuedepth );
163
+
164
+ err :
165
+ dev_err (hba -> dev , "Failed to get mac, err=%d\n" , mac );
166
+ return mac ;
163
167
}
164
168
165
169
static int ufshcd_mcq_config_nr_queues (struct ufs_hba * hba )
Original file line number Diff line number Diff line change @@ -249,14 +249,6 @@ static inline int ufshcd_vops_mcq_config_resource(struct ufs_hba *hba)
249
249
return - EOPNOTSUPP ;
250
250
}
251
251
252
- static inline int ufshcd_mcq_vops_get_hba_mac (struct ufs_hba * hba )
253
- {
254
- if (hba -> vops && hba -> vops -> get_hba_mac )
255
- return hba -> vops -> get_hba_mac (hba );
256
-
257
- return - EOPNOTSUPP ;
258
- }
259
-
260
252
static inline int ufshcd_mcq_vops_op_runtime_config (struct ufs_hba * hba )
261
253
{
262
254
if (hba -> vops && hba -> vops -> op_runtime_config )
You can’t perform that action at this time.
0 commit comments