You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
[PATCH] driver core: add helper device_is_registered()
add the helper and use it instead of open coding the klist_node_attached() check (which is a layering violation IMHO) idea by Alan Stern. Signed-off-by: Daniel Ritz <daniel.ritz@gmx.ch> Cc: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
committed by
Linus Torvalds
parent
4c898c7f2f
commit
d305ef5d2a
@@ -437,7 +437,7 @@ __ccwgroup_get_gdev_by_cdev(struct ccw_device *cdev)
|
||||
if (cdev->dev.driver_data) {
|
||||
gdev = (struct ccwgroup_device *)cdev->dev.driver_data;
|
||||
if (get_device(&gdev->dev)) {
|
||||
if (klist_node_attached(&gdev->dev.knode_bus))
|
||||
if (device_is_registered(&gdev->dev))
|
||||
return gdev;
|
||||
put_device(&gdev->dev);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user