From a3a87d66d3f64c74acbc25799d38effb63695ea0 Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Tue, 24 Mar 2020 14:20:23 +0200 Subject: 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 Link: https://lore.kernel.org/r/20200324122023.9649-3-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman --- drivers/base/dd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/base') diff --git a/drivers/base/dd.c b/drivers/base/dd.c index 3f5b8bdd94f0..06ec0e851fa1 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c @@ -1199,7 +1199,7 @@ void driver_detach(struct device_driver *drv) spin_unlock(&drv->p->klist_devices.k_lock); break; } - dev_prv = list_entry(drv->p->klist_devices.k_list.prev, + dev_prv = list_last_entry(&drv->p->klist_devices.k_list, struct device_private, knode_driver.n_node); dev = dev_prv->device; -- cgit v1.2.3