Skip to content

Commit a3a87d6

Browse files
andy-shevgregkh
authored andcommitted
driver core: Replace open-coded list_last_entry()
There is a place in the code where open-coded version of list entry accessors list_last_entry() is used. Replace that with the standard macro. Signed-off-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 927f828 commit a3a87d6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/base/dd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1199,7 +1199,7 @@ void driver_detach(struct device_driver *drv)
11991199
spin_unlock(&drv->p->klist_devices.k_lock);
12001200
break;
12011201
}
1202-
dev_prv = list_entry(drv->p->klist_devices.k_list.prev,
1202+
dev_prv = list_last_entry(&drv->p->klist_devices.k_list,
12031203
struct device_private,
12041204
knode_driver.n_node);
12051205
dev = dev_prv->device;

0 commit comments

Comments
 (0)