Skip to content

Commit c604cb5

Browse files
geertuYuryNorov
authored andcommitted
soc: renesas: Use bitfield helpers
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>
1 parent 3937b05 commit c604cb5

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/soc/renesas/renesas-soc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* Copyright (C) 2014-2016 Glider bvba
66
*/
77

8+
#include <linux/bitfield.h>
89
#include <linux/io.h>
910
#include <linux/of.h>
1011
#include <linux/of_address.h>
@@ -524,8 +525,7 @@ static int __init renesas_soc_init(void)
524525
eshi, eslo);
525526
}
526527

527-
if (soc->id &&
528-
((product & id->mask) >> __ffs(id->mask)) != soc->id) {
528+
if (soc->id && field_get(id->mask, product) != soc->id) {
529529
pr_warn("SoC mismatch (product = 0x%x)\n", product);
530530
ret = -ENODEV;
531531
goto free_soc_dev_attr;

0 commit comments

Comments
 (0)