summaryrefslogtreecommitdiff
path: root/drivers/mtd/chips/chipreg.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/chips/chipreg.c')
-rw-r--r--drivers/mtd/chips/chipreg.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/mtd/chips/chipreg.c b/drivers/mtd/chips/chipreg.c
index 0bbc61ba9524..a05e103682a4 100644
--- a/drivers/mtd/chips/chipreg.c
+++ b/drivers/mtd/chips/chipreg.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-only
/*
* Registration for chip drivers
*
@@ -30,14 +31,11 @@ void unregister_mtd_chip_driver(struct mtd_chip_driver *drv)
static struct mtd_chip_driver *get_mtd_chip_driver (const char *name)
{
- struct list_head *pos;
struct mtd_chip_driver *ret = NULL, *this;
spin_lock(&chip_drvs_lock);
- list_for_each(pos, &chip_drvs_list) {
- this = list_entry(pos, typeof(*this), list);
-
+ list_for_each_entry(this, &chip_drvs_list, list) {
if (!strcmp(this->name, name)) {
ret = this;
break;