55#include <linux/bits.h>
66#include <linux/err.h>
77#include <linux/errno.h>
8+ #include <linux/of.h>
89#include <linux/types.h>
910
1011struct device ;
1112struct device_node ;
13+ struct fwnode_handle ;
1214struct reset_control ;
1315
1416/**
@@ -84,7 +86,7 @@ int reset_control_bulk_deassert(int num_rstcs, struct reset_control_bulk_data *r
8486int reset_control_bulk_acquire (int num_rstcs , struct reset_control_bulk_data * rstcs );
8587void reset_control_bulk_release (int num_rstcs , struct reset_control_bulk_data * rstcs );
8688
87- struct reset_control * __of_reset_control_get (struct device_node * node ,
89+ struct reset_control * __fwnode_reset_control_get (struct fwnode_handle * fwnode ,
8890 const char * id , int index , enum reset_control_flags flags );
8991struct reset_control * __reset_control_get (struct device * dev , const char * id ,
9092 int index , enum reset_control_flags flags );
@@ -103,7 +105,8 @@ int __devm_reset_control_bulk_get(struct device *dev, int num_rstcs,
103105
104106struct reset_control * devm_reset_control_array_get (struct device * dev ,
105107 enum reset_control_flags flags );
106- struct reset_control * of_reset_control_array_get (struct device_node * np , enum reset_control_flags );
108+ struct reset_control * fwnode_reset_control_array_get (struct fwnode_handle * fwnode ,
109+ enum reset_control_flags );
107110
108111int reset_control_get_count (struct device * dev );
109112
@@ -152,8 +155,8 @@ static inline int __device_reset(struct device *dev, bool optional)
152155 return optional ? 0 : - ENOTSUPP ;
153156}
154157
155- static inline struct reset_control * __of_reset_control_get (
156- struct device_node * node ,
158+ static inline struct reset_control * __fwnode_reset_control_get (
159+ struct fwnode_handle * fwnode ,
157160 const char * id , int index , enum reset_control_flags flags )
158161{
159162 bool optional = flags & RESET_CONTROL_FLAGS_BIT_OPTIONAL ;
@@ -242,7 +245,7 @@ devm_reset_control_array_get(struct device *dev, enum reset_control_flags flags)
242245}
243246
244247static inline struct reset_control *
245- of_reset_control_array_get (struct device_node * np , enum reset_control_flags flags )
248+ fwnode_reset_control_array_get (struct fwnode_handle * fwnode , enum reset_control_flags flags )
246249{
247250 bool optional = flags & RESET_CONTROL_FLAGS_BIT_OPTIONAL ;
248251
@@ -500,7 +503,8 @@ reset_control_bulk_get_optional_shared(struct device *dev, int num_rstcs,
500503static inline struct reset_control * of_reset_control_get_exclusive (
501504 struct device_node * node , const char * id )
502505{
503- return __of_reset_control_get (node , id , 0 , RESET_CONTROL_EXCLUSIVE );
506+ return __fwnode_reset_control_get (of_fwnode_handle (node ), id , 0 ,
507+ RESET_CONTROL_EXCLUSIVE );
504508}
505509
506510/**
@@ -520,7 +524,8 @@ static inline struct reset_control *of_reset_control_get_exclusive(
520524static inline struct reset_control * of_reset_control_get_optional_exclusive (
521525 struct device_node * node , const char * id )
522526{
523- return __of_reset_control_get (node , id , 0 , RESET_CONTROL_OPTIONAL_EXCLUSIVE );
527+ return __fwnode_reset_control_get (of_fwnode_handle (node ), id , 0 ,
528+ RESET_CONTROL_OPTIONAL_EXCLUSIVE );
524529}
525530
526531/**
@@ -545,7 +550,8 @@ static inline struct reset_control *of_reset_control_get_optional_exclusive(
545550static inline struct reset_control * of_reset_control_get_shared (
546551 struct device_node * node , const char * id )
547552{
548- return __of_reset_control_get (node , id , 0 , RESET_CONTROL_SHARED );
553+ return __fwnode_reset_control_get (of_fwnode_handle (node ), id , 0 ,
554+ RESET_CONTROL_SHARED );
549555}
550556
551557/**
@@ -562,7 +568,8 @@ static inline struct reset_control *of_reset_control_get_shared(
562568static inline struct reset_control * of_reset_control_get_exclusive_by_index (
563569 struct device_node * node , int index )
564570{
565- return __of_reset_control_get (node , NULL , index , RESET_CONTROL_EXCLUSIVE );
571+ return __fwnode_reset_control_get (of_fwnode_handle (node ), NULL , index ,
572+ RESET_CONTROL_EXCLUSIVE );
566573}
567574
568575/**
@@ -590,7 +597,8 @@ static inline struct reset_control *of_reset_control_get_exclusive_by_index(
590597static inline struct reset_control * of_reset_control_get_shared_by_index (
591598 struct device_node * node , int index )
592599{
593- return __of_reset_control_get (node , NULL , index , RESET_CONTROL_SHARED );
600+ return __fwnode_reset_control_get (of_fwnode_handle (node ), NULL , index ,
601+ RESET_CONTROL_SHARED );
594602}
595603
596604/**
@@ -1032,30 +1040,35 @@ devm_reset_control_array_get_optional_shared(struct device *dev)
10321040static inline struct reset_control *
10331041of_reset_control_array_get_exclusive (struct device_node * node )
10341042{
1035- return of_reset_control_array_get (node , RESET_CONTROL_EXCLUSIVE );
1043+ return fwnode_reset_control_array_get (of_fwnode_handle (node ),
1044+ RESET_CONTROL_EXCLUSIVE );
10361045}
10371046
10381047static inline struct reset_control *
10391048of_reset_control_array_get_exclusive_released (struct device_node * node )
10401049{
1041- return of_reset_control_array_get (node , RESET_CONTROL_EXCLUSIVE_RELEASED );
1050+ return fwnode_reset_control_array_get (of_fwnode_handle (node ),
1051+ RESET_CONTROL_EXCLUSIVE_RELEASED );
10421052}
10431053
10441054static inline struct reset_control *
10451055of_reset_control_array_get_shared (struct device_node * node )
10461056{
1047- return of_reset_control_array_get (node , RESET_CONTROL_SHARED );
1057+ return fwnode_reset_control_array_get (of_fwnode_handle (node ),
1058+ RESET_CONTROL_SHARED );
10481059}
10491060
10501061static inline struct reset_control *
10511062of_reset_control_array_get_optional_exclusive (struct device_node * node )
10521063{
1053- return of_reset_control_array_get (node , RESET_CONTROL_OPTIONAL_EXCLUSIVE );
1064+ return fwnode_reset_control_array_get (of_fwnode_handle (node ),
1065+ RESET_CONTROL_OPTIONAL_EXCLUSIVE );
10541066}
10551067
10561068static inline struct reset_control *
10571069of_reset_control_array_get_optional_shared (struct device_node * node )
10581070{
1059- return of_reset_control_array_get (node , RESET_CONTROL_OPTIONAL_SHARED );
1071+ return fwnode_reset_control_array_get (of_fwnode_handle (node ),
1072+ RESET_CONTROL_OPTIONAL_SHARED );
10601073}
10611074#endif
0 commit comments