File tree Expand file tree Collapse file tree 3 files changed +12
-8
lines changed Expand file tree Collapse file tree 3 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -1553,7 +1553,7 @@ static void _opp_kref_release(struct kref *kref)
15531553 * frequency/voltage list.
15541554 */
15551555 blocking_notifier_call_chain (& opp_table -> head , OPP_EVENT_REMOVE , opp );
1556- _of_opp_free_required_opps (opp_table , opp );
1556+ _of_clear_opp (opp_table , opp );
15571557 opp_debug_remove_one (opp );
15581558 kfree (opp );
15591559}
Original file line number Diff line number Diff line change @@ -254,8 +254,8 @@ void _of_clear_opp_table(struct opp_table *opp_table)
254254 * Release all resources previously acquired with a call to
255255 * _of_opp_alloc_required_opps().
256256 */
257- void _of_opp_free_required_opps (struct opp_table * opp_table ,
258- struct dev_pm_opp * opp )
257+ static void _of_opp_free_required_opps (struct opp_table * opp_table ,
258+ struct dev_pm_opp * opp )
259259{
260260 struct dev_pm_opp * * required_opps = opp -> required_opps ;
261261 int i ;
@@ -275,6 +275,12 @@ void _of_opp_free_required_opps(struct opp_table *opp_table,
275275 kfree (required_opps );
276276}
277277
278+ void _of_clear_opp (struct opp_table * opp_table , struct dev_pm_opp * opp )
279+ {
280+ _of_opp_free_required_opps (opp_table , opp );
281+ of_node_put (opp -> np );
282+ }
283+
278284/* Populate all required OPPs which are part of "required-opps" list */
279285static int _of_opp_alloc_required_opps (struct opp_table * opp_table ,
280286 struct dev_pm_opp * opp )
@@ -938,7 +944,7 @@ static struct dev_pm_opp *_opp_add_static_v2(struct opp_table *opp_table,
938944
939945 new_opp -> turbo = of_property_read_bool (np , "turbo-mode" );
940946
941- new_opp -> np = np ;
947+ new_opp -> np = of_node_get ( np ) ;
942948 new_opp -> dynamic = false;
943949 new_opp -> available = true;
944950
Original file line number Diff line number Diff line change @@ -267,14 +267,12 @@ static inline bool lazy_linking_pending(struct opp_table *opp_table)
267267void _of_init_opp_table (struct opp_table * opp_table , struct device * dev , int index );
268268void _of_clear_opp_table (struct opp_table * opp_table );
269269struct opp_table * _managed_opp (struct device * dev , int index );
270- void _of_opp_free_required_opps (struct opp_table * opp_table ,
271- struct dev_pm_opp * opp );
270+ void _of_clear_opp (struct opp_table * opp_table , struct dev_pm_opp * opp );
272271#else
273272static inline void _of_init_opp_table (struct opp_table * opp_table , struct device * dev , int index ) {}
274273static inline void _of_clear_opp_table (struct opp_table * opp_table ) {}
275274static inline struct opp_table * _managed_opp (struct device * dev , int index ) { return NULL ; }
276- static inline void _of_opp_free_required_opps (struct opp_table * opp_table ,
277- struct dev_pm_opp * opp ) {}
275+ static inline void _of_clear_opp (struct opp_table * opp_table , struct dev_pm_opp * opp ) {}
278276#endif
279277
280278#ifdef CONFIG_DEBUG_FS
You can’t perform that action at this time.
0 commit comments