Commit 903c449
driver core: Make parameter check consistent for API cluster device_(for_each|find)_child()
The following API cluster takes the same type parameter list, but do not
have consistent parameter check as shown below.
device_for_each_child(struct device *parent, ...) // check (!parent->p)
device_for_each_child_reverse(struct device *parent, ...) // same as above
device_find_child(struct device *parent, ...) // check (!parent)
Fixed by using consistent check (!parent || !parent->p) which covers
both existing checks for the cluster.
Signed-off-by: Zijun Hu <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>1 parent 8ab0f46 commit 903c449
1 file changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3998 | 3998 | | |
3999 | 3999 | | |
4000 | 4000 | | |
4001 | | - | |
| 4001 | + | |
4002 | 4002 | | |
4003 | 4003 | | |
4004 | 4004 | | |
| |||
4028 | 4028 | | |
4029 | 4029 | | |
4030 | 4030 | | |
4031 | | - | |
| 4031 | + | |
4032 | 4032 | | |
4033 | 4033 | | |
4034 | 4034 | | |
| |||
4062 | 4062 | | |
4063 | 4063 | | |
4064 | 4064 | | |
4065 | | - | |
| 4065 | + | |
4066 | 4066 | | |
4067 | 4067 | | |
4068 | 4068 | | |
| |||
0 commit comments