@@ -87,18 +87,17 @@ const char *action_names[] = {
8787};
8888#endif
8989
90- int of_reconfig_notify (unsigned long action , void * p )
90+ int of_reconfig_notify (unsigned long action , struct of_reconfig_data * p )
9191{
9292 int rc ;
9393#ifdef DEBUG
94- struct device_node * dn = p ;
95- struct of_prop_reconfig * pr = p ;
94+ struct of_reconfig_data * pr = p ;
9695
9796 switch (action ) {
9897 case OF_RECONFIG_ATTACH_NODE :
9998 case OF_RECONFIG_DETACH_NODE :
10099 pr_debug ("of/notify %-15s %s\n" , action_names [action ],
101- dn -> full_name );
100+ pr -> dn -> full_name );
102101 break ;
103102 case OF_RECONFIG_ADD_PROPERTY :
104103 case OF_RECONFIG_REMOVE_PROPERTY :
@@ -122,31 +121,22 @@ int of_reconfig_notify(unsigned long action, void *p)
122121 * Returns 0 on device going from enabled to disabled, 1 on device
123122 * going from disabled to enabled and -1 on no change.
124123 */
125- int of_reconfig_get_state_change (unsigned long action , void * arg )
124+ int of_reconfig_get_state_change (unsigned long action , struct of_reconfig_data * pr )
126125{
127- struct device_node * dn ;
128- struct property * prop , * old_prop ;
129- struct of_prop_reconfig * pr ;
126+ struct property * prop , * old_prop = NULL ;
130127 int is_status , status_state , old_status_state , prev_state , new_state ;
131128
132129 /* figure out if a device should be created or destroyed */
133- dn = NULL ;
134- prop = old_prop = NULL ;
135130 switch (action ) {
136131 case OF_RECONFIG_ATTACH_NODE :
137132 case OF_RECONFIG_DETACH_NODE :
138- dn = arg ;
139- prop = of_find_property (dn , "status" , NULL );
133+ prop = of_find_property (pr -> dn , "status" , NULL );
140134 break ;
141135 case OF_RECONFIG_ADD_PROPERTY :
142136 case OF_RECONFIG_REMOVE_PROPERTY :
143- pr = arg ;
144- dn = pr -> dn ;
145137 prop = pr -> prop ;
146138 break ;
147139 case OF_RECONFIG_UPDATE_PROPERTY :
148- pr = arg ;
149- dn = pr -> dn ;
150140 prop = pr -> prop ;
151141 old_prop = pr -> old_prop ;
152142 break ;
@@ -212,7 +202,7 @@ EXPORT_SYMBOL_GPL(of_reconfig_get_state_change);
212202int of_property_notify (int action , struct device_node * np ,
213203 struct property * prop , struct property * oldprop )
214204{
215- struct of_prop_reconfig pr ;
205+ struct of_reconfig_data pr ;
216206
217207 /* only call notifiers if the node is attached */
218208 if (!of_node_is_attached (np ))
@@ -250,8 +240,12 @@ void __of_attach_node(struct device_node *np)
250240 */
251241int of_attach_node (struct device_node * np )
252242{
243+ struct of_reconfig_data rd ;
253244 unsigned long flags ;
254245
246+ memset (& rd , 0 , sizeof (rd ));
247+ rd .dn = np ;
248+
255249 mutex_lock (& of_mutex );
256250 raw_spin_lock_irqsave (& devtree_lock , flags );
257251 __of_attach_node (np );
@@ -260,7 +254,7 @@ int of_attach_node(struct device_node *np)
260254 __of_attach_node_sysfs (np );
261255 mutex_unlock (& of_mutex );
262256
263- of_reconfig_notify (OF_RECONFIG_ATTACH_NODE , np );
257+ of_reconfig_notify (OF_RECONFIG_ATTACH_NODE , & rd );
264258
265259 return 0 ;
266260}
@@ -298,9 +292,13 @@ void __of_detach_node(struct device_node *np)
298292 */
299293int of_detach_node (struct device_node * np )
300294{
295+ struct of_reconfig_data rd ;
301296 unsigned long flags ;
302297 int rc = 0 ;
303298
299+ memset (& rd , 0 , sizeof (rd ));
300+ rd .dn = np ;
301+
304302 mutex_lock (& of_mutex );
305303 raw_spin_lock_irqsave (& devtree_lock , flags );
306304 __of_detach_node (np );
@@ -309,7 +307,7 @@ int of_detach_node(struct device_node *np)
309307 __of_detach_node_sysfs (np );
310308 mutex_unlock (& of_mutex );
311309
312- of_reconfig_notify (OF_RECONFIG_DETACH_NODE , np );
310+ of_reconfig_notify (OF_RECONFIG_DETACH_NODE , & rd );
313311
314312 return rc ;
315313}
@@ -505,6 +503,7 @@ static void __of_changeset_entry_invert(struct of_changeset_entry *ce,
505503
506504static void __of_changeset_entry_notify (struct of_changeset_entry * ce , bool revert )
507505{
506+ struct of_reconfig_data rd ;
508507 struct of_changeset_entry ce_inverted ;
509508 int ret ;
510509
@@ -516,7 +515,9 @@ static void __of_changeset_entry_notify(struct of_changeset_entry *ce, bool reve
516515 switch (ce -> action ) {
517516 case OF_RECONFIG_ATTACH_NODE :
518517 case OF_RECONFIG_DETACH_NODE :
519- ret = of_reconfig_notify (ce -> action , ce -> np );
518+ memset (& rd , 0 , sizeof (rd ));
519+ rd .dn = ce -> np ;
520+ ret = of_reconfig_notify (ce -> action , & rd );
520521 break ;
521522 case OF_RECONFIG_ADD_PROPERTY :
522523 case OF_RECONFIG_REMOVE_PROPERTY :
0 commit comments