Skip to content

Commit 80a306d

Browse files
committed
Merge tag 'regmap-fix-v4.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap
Pull regmap fixes from Mark Brown: "A couple of small build fixes here, nothing major. The missing include is triggered in some configurations and the renaming of ret is defensive for the benefit of some drivers people are in the process of mainlining" * tag 'regmap-fix-v4.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap: regmap: Rename ret variable in regmap_read_poll_timeout regmap: include <linux/delay.h> from include/linux/regmap.h
2 parents 6eb3c60 + 74e3368 commit 80a306d

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

include/linux/regmap.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
#include <linux/list.h>
1717
#include <linux/rbtree.h>
18+
#include <linux/delay.h>
1819
#include <linux/err.h>
1920
#include <linux/bug.h>
2021
#include <linux/lockdep.h>
@@ -116,22 +117,22 @@ struct reg_sequence {
116117
#define regmap_read_poll_timeout(map, addr, val, cond, sleep_us, timeout_us) \
117118
({ \
118119
ktime_t timeout = ktime_add_us(ktime_get(), timeout_us); \
119-
int ret; \
120+
int pollret; \
120121
might_sleep_if(sleep_us); \
121122
for (;;) { \
122-
ret = regmap_read((map), (addr), &(val)); \
123-
if (ret) \
123+
pollret = regmap_read((map), (addr), &(val)); \
124+
if (pollret) \
124125
break; \
125126
if (cond) \
126127
break; \
127128
if (timeout_us && ktime_compare(ktime_get(), timeout) > 0) { \
128-
ret = regmap_read((map), (addr), &(val)); \
129+
pollret = regmap_read((map), (addr), &(val)); \
129130
break; \
130131
} \
131132
if (sleep_us) \
132133
usleep_range((sleep_us >> 2) + 1, sleep_us); \
133134
} \
134-
ret ?: ((cond) ? 0 : -ETIMEDOUT); \
135+
pollret ?: ((cond) ? 0 : -ETIMEDOUT); \
135136
})
136137

137138
#ifdef CONFIG_REGMAP

0 commit comments

Comments
 (0)