@@ -218,7 +218,7 @@ bool fwnode_property_present(struct fwnode_handle *fwnode, const char *propname)
218
218
bool ret ;
219
219
220
220
ret = __fwnode_property_present (fwnode , propname );
221
- if (ret == false && fwnode && fwnode -> secondary )
221
+ if (ret == false && fwnode && ! IS_ERR_OR_NULL ( fwnode -> secondary ) )
222
222
ret = __fwnode_property_present (fwnode -> secondary , propname );
223
223
return ret ;
224
224
}
@@ -423,7 +423,7 @@ EXPORT_SYMBOL_GPL(device_property_match_string);
423
423
int _ret_; \
424
424
_ret_ = FWNODE_PROP_READ(_fwnode_, _propname_, _type_, _proptype_, \
425
425
_val_, _nval_); \
426
- if (_ret_ == -EINVAL && _fwnode_ && _fwnode_->secondary) \
426
+ if (_ret_ == -EINVAL && _fwnode_ && !IS_ERR_OR_NULL( _fwnode_->secondary)) \
427
427
_ret_ = FWNODE_PROP_READ(_fwnode_->secondary, _propname_, _type_, \
428
428
_proptype_, _val_, _nval_); \
429
429
_ret_; \
@@ -593,7 +593,7 @@ int fwnode_property_read_string_array(struct fwnode_handle *fwnode,
593
593
int ret ;
594
594
595
595
ret = __fwnode_property_read_string_array (fwnode , propname , val , nval );
596
- if (ret == - EINVAL && fwnode && fwnode -> secondary )
596
+ if (ret == - EINVAL && fwnode && ! IS_ERR_OR_NULL ( fwnode -> secondary ) )
597
597
ret = __fwnode_property_read_string_array (fwnode -> secondary ,
598
598
propname , val , nval );
599
599
return ret ;
@@ -621,7 +621,7 @@ int fwnode_property_read_string(struct fwnode_handle *fwnode,
621
621
int ret ;
622
622
623
623
ret = __fwnode_property_read_string (fwnode , propname , val );
624
- if (ret == - EINVAL && fwnode && fwnode -> secondary )
624
+ if (ret == - EINVAL && fwnode && ! IS_ERR_OR_NULL ( fwnode -> secondary ) )
625
625
ret = __fwnode_property_read_string (fwnode -> secondary ,
626
626
propname , val );
627
627
return ret ;
0 commit comments