]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
soc: renesas: Use bitfield helpers
authorGeert Uytterhoeven <geert+renesas@glider.be>
Thu, 6 Nov 2025 13:34:14 +0000 (14:34 +0100)
committerYury Norov (NVIDIA) <yury.norov@gmail.com>
Mon, 24 Nov 2025 19:15:47 +0000 (14:15 -0500)
Use the field_get() helper, instead of open-coding the same operation.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Yury Norov (NVIDIA) <yury.norov@gmail.com>
drivers/soc/renesas/renesas-soc.c

index 1eb52356b996bdd710c480a4052fe6985b7080b6..ee4f17bb4db45db7b96c782b770e5bb4eb139e09 100644 (file)
@@ -5,6 +5,7 @@
  * Copyright (C) 2014-2016 Glider bvba
  */
 
+#include <linux/bitfield.h>
 #include <linux/io.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
@@ -524,8 +525,7 @@ static int __init renesas_soc_init(void)
                                                           eshi, eslo);
                }
 
-               if (soc->id &&
-                   ((product & id->mask) >> __ffs(id->mask)) != soc->id) {
+               if (soc->id && field_get(id->mask, product) != soc->id) {
                        pr_warn("SoC mismatch (product = 0x%x)\n", product);
                        ret = -ENODEV;
                        goto free_soc_dev_attr;