File tree Expand file tree Collapse file tree 8 files changed +53
-60
lines changed
drivers/hwtracing/coresight Expand file tree Collapse file tree 8 files changed +53
-60
lines changed Original file line number Diff line number Diff line change @@ -731,18 +731,16 @@ static int debug_runtime_suspend(struct device *dev)
731731{
732732 struct debug_drvdata * drvdata = dev_get_drvdata (dev );
733733
734- if (drvdata && ! IS_ERR_OR_NULL ( drvdata -> pclk ))
735- clk_disable_unprepare ( drvdata -> pclk );
734+ clk_disable_unprepare (drvdata -> pclk );
735+
736736 return 0 ;
737737}
738738
739739static int debug_runtime_resume (struct device * dev )
740740{
741741 struct debug_drvdata * drvdata = dev_get_drvdata (dev );
742742
743- if (drvdata && !IS_ERR_OR_NULL (drvdata -> pclk ))
744- clk_prepare_enable (drvdata -> pclk );
745- return 0 ;
743+ return clk_prepare_enable (drvdata -> pclk );
746744}
747745#endif
748746
Original file line number Diff line number Diff line change @@ -278,8 +278,7 @@ static int ctcu_runtime_suspend(struct device *dev)
278278{
279279 struct ctcu_drvdata * drvdata = dev_get_drvdata (dev );
280280
281- if (drvdata && !IS_ERR_OR_NULL (drvdata -> apb_clk ))
282- clk_disable_unprepare (drvdata -> apb_clk );
281+ clk_disable_unprepare (drvdata -> apb_clk );
283282
284283 return 0 ;
285284}
@@ -288,10 +287,7 @@ static int ctcu_runtime_resume(struct device *dev)
288287{
289288 struct ctcu_drvdata * drvdata = dev_get_drvdata (dev );
290289
291- if (drvdata && !IS_ERR_OR_NULL (drvdata -> apb_clk ))
292- clk_prepare_enable (drvdata -> apb_clk );
293-
294- return 0 ;
290+ return clk_prepare_enable (drvdata -> apb_clk );
295291}
296292#endif
297293
Original file line number Diff line number Diff line change @@ -809,8 +809,7 @@ static int etb_runtime_suspend(struct device *dev)
809809{
810810 struct etb_drvdata * drvdata = dev_get_drvdata (dev );
811811
812- if (drvdata && !IS_ERR (drvdata -> atclk ))
813- clk_disable_unprepare (drvdata -> atclk );
812+ clk_disable_unprepare (drvdata -> atclk );
814813
815814 return 0 ;
816815}
@@ -819,10 +818,7 @@ static int etb_runtime_resume(struct device *dev)
819818{
820819 struct etb_drvdata * drvdata = dev_get_drvdata (dev );
821820
822- if (drvdata && !IS_ERR (drvdata -> atclk ))
823- clk_prepare_enable (drvdata -> atclk );
824-
825- return 0 ;
821+ return clk_prepare_enable (drvdata -> atclk );
826822}
827823#endif
828824
Original file line number Diff line number Diff line change @@ -925,8 +925,7 @@ static int etm_runtime_suspend(struct device *dev)
925925{
926926 struct etm_drvdata * drvdata = dev_get_drvdata (dev );
927927
928- if (drvdata && !IS_ERR (drvdata -> atclk ))
929- clk_disable_unprepare (drvdata -> atclk );
928+ clk_disable_unprepare (drvdata -> atclk );
930929
931930 return 0 ;
932931}
@@ -935,10 +934,7 @@ static int etm_runtime_resume(struct device *dev)
935934{
936935 struct etm_drvdata * drvdata = dev_get_drvdata (dev );
937936
938- if (drvdata && !IS_ERR (drvdata -> atclk ))
939- clk_prepare_enable (drvdata -> atclk );
940-
941- return 0 ;
937+ return clk_prepare_enable (drvdata -> atclk );
942938}
943939#endif
944940
Original file line number Diff line number Diff line change @@ -284,25 +284,26 @@ static int funnel_runtime_suspend(struct device *dev)
284284{
285285 struct funnel_drvdata * drvdata = dev_get_drvdata (dev );
286286
287- if (drvdata && !IS_ERR (drvdata -> atclk ))
288- clk_disable_unprepare (drvdata -> atclk );
289-
290- if (drvdata && !IS_ERR_OR_NULL (drvdata -> pclk ))
291- clk_disable_unprepare (drvdata -> pclk );
287+ clk_disable_unprepare (drvdata -> atclk );
288+ clk_disable_unprepare (drvdata -> pclk );
292289
293290 return 0 ;
294291}
295292
296293static int funnel_runtime_resume (struct device * dev )
297294{
298295 struct funnel_drvdata * drvdata = dev_get_drvdata (dev );
296+ int ret ;
297+
298+ ret = clk_prepare_enable (drvdata -> pclk );
299+ if (ret )
300+ return ret ;
299301
300- if (drvdata && !IS_ERR_OR_NULL (drvdata -> pclk ))
301- clk_prepare_enable (drvdata -> pclk );
302+ ret = clk_prepare_enable (drvdata -> atclk );
303+ if (ret )
304+ clk_disable_unprepare (drvdata -> pclk );
302305
303- if (drvdata && !IS_ERR (drvdata -> atclk ))
304- clk_prepare_enable (drvdata -> atclk );
305- return 0 ;
306+ return ret ;
306307}
307308#endif
308309
Original file line number Diff line number Diff line change @@ -323,24 +323,26 @@ static int replicator_runtime_suspend(struct device *dev)
323323{
324324 struct replicator_drvdata * drvdata = dev_get_drvdata (dev );
325325
326- if (drvdata && ! IS_ERR ( drvdata -> atclk ))
327- clk_disable_unprepare (drvdata -> atclk );
326+ clk_disable_unprepare (drvdata -> atclk );
327+ clk_disable_unprepare (drvdata -> pclk );
328328
329- if (drvdata && !IS_ERR_OR_NULL (drvdata -> pclk ))
330- clk_disable_unprepare (drvdata -> pclk );
331329 return 0 ;
332330}
333331
334332static int replicator_runtime_resume (struct device * dev )
335333{
336334 struct replicator_drvdata * drvdata = dev_get_drvdata (dev );
335+ int ret ;
337336
338- if (drvdata && !IS_ERR_OR_NULL (drvdata -> pclk ))
339- clk_prepare_enable (drvdata -> pclk );
337+ ret = clk_prepare_enable (drvdata -> pclk );
338+ if (ret )
339+ return ret ;
340340
341- if (drvdata && !IS_ERR (drvdata -> atclk ))
342- clk_prepare_enable (drvdata -> atclk );
343- return 0 ;
341+ ret = clk_prepare_enable (drvdata -> atclk );
342+ if (ret )
343+ clk_disable_unprepare (drvdata -> pclk );
344+
345+ return ret ;
344346}
345347#endif
346348
Original file line number Diff line number Diff line change @@ -957,24 +957,26 @@ static int stm_runtime_suspend(struct device *dev)
957957{
958958 struct stm_drvdata * drvdata = dev_get_drvdata (dev );
959959
960- if (drvdata && ! IS_ERR ( drvdata -> atclk ))
961- clk_disable_unprepare (drvdata -> atclk );
960+ clk_disable_unprepare (drvdata -> atclk );
961+ clk_disable_unprepare (drvdata -> pclk );
962962
963- if (drvdata && !IS_ERR_OR_NULL (drvdata -> pclk ))
964- clk_disable_unprepare (drvdata -> pclk );
965963 return 0 ;
966964}
967965
968966static int stm_runtime_resume (struct device * dev )
969967{
970968 struct stm_drvdata * drvdata = dev_get_drvdata (dev );
969+ int ret ;
971970
972- if (drvdata && !IS_ERR_OR_NULL (drvdata -> pclk ))
973- clk_prepare_enable (drvdata -> pclk );
971+ ret = clk_prepare_enable (drvdata -> pclk );
972+ if (ret )
973+ return ret ;
974974
975- if (drvdata && !IS_ERR (drvdata -> atclk ))
976- clk_prepare_enable (drvdata -> atclk );
977- return 0 ;
975+ ret = clk_prepare_enable (drvdata -> atclk );
976+ if (ret )
977+ clk_disable_unprepare (drvdata -> pclk );
978+
979+ return ret ;
978980}
979981#endif
980982
Original file line number Diff line number Diff line change @@ -206,24 +206,26 @@ static int tpiu_runtime_suspend(struct device *dev)
206206{
207207 struct tpiu_drvdata * drvdata = dev_get_drvdata (dev );
208208
209- if (drvdata && ! IS_ERR ( drvdata -> atclk ))
210- clk_disable_unprepare (drvdata -> atclk );
209+ clk_disable_unprepare (drvdata -> atclk );
210+ clk_disable_unprepare (drvdata -> pclk );
211211
212- if (drvdata && !IS_ERR_OR_NULL (drvdata -> pclk ))
213- clk_disable_unprepare (drvdata -> pclk );
214212 return 0 ;
215213}
216214
217215static int tpiu_runtime_resume (struct device * dev )
218216{
219217 struct tpiu_drvdata * drvdata = dev_get_drvdata (dev );
218+ int ret ;
220219
221- if (drvdata && !IS_ERR_OR_NULL (drvdata -> pclk ))
222- clk_prepare_enable (drvdata -> pclk );
220+ ret = clk_prepare_enable (drvdata -> pclk );
221+ if (ret )
222+ return ret ;
223223
224- if (drvdata && !IS_ERR (drvdata -> atclk ))
225- clk_prepare_enable (drvdata -> atclk );
226- return 0 ;
224+ ret = clk_prepare_enable (drvdata -> atclk );
225+ if (ret )
226+ clk_disable_unprepare (drvdata -> pclk );
227+
228+ return ret ;
227229}
228230#endif
229231
You can’t perform that action at this time.
0 commit comments