summaryrefslogtreecommitdiff
path: root/drivers/rtc/rtc-moxart.c
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2021-10-18 22:40:28 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-11-26 11:58:45 +0100
commitad4775bdacf90902b80ea56f2aa5117f9750db74 (patch)
treed68480af9fb61107a3cb70715789ea02c76b9f8e /drivers/rtc/rtc-moxart.c
parent3439d462e091bd86bff1aa06480702162030fa58 (diff)
usb: max-3421: Use driver data instead of maintaining a list of bound devices
commit fc153aba3ef371d0d76eb88230ed4e0dee5b38f2 upstream. Instead of maintaining a single-linked list of devices that must be searched linearly in .remove() just use spi_set_drvdata() to remember the link between the spi device and the driver struct. Then the global list and the next member can be dropped. This simplifies the driver, reduces the memory footprint and the time to search the list. Also it makes obvious that there is always a corresponding driver struct for a given device in .remove(), so the error path for !max3421_hcd can be dropped, too. As a side effect this fixes a data inconsistency when .probe() races with itself for a second max3421 device in manipulating max3421_hcd_list. A similar race is fixed in .remove(), too. Fixes: 2d53139f3162 ("Add support for using a MAX3421E chip as a host driver.") Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20211018204028.2914597-1-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/rtc/rtc-moxart.c')
0 files changed, 0 insertions, 0 deletions