Skip to content

Commit 6014ce8

Browse files
committed
Merge tag 'reset-fixes-for-4.11' of git://git.pengutronix.de/git/pza/linux into fixes
Reset controller fixes for v4.11 Fix optional reset_control_get_stubs to return NULL and remove warnings from reset_control_* stubs. This fixes commit bb47523 ("reset: make optional functions really optional"), which was merged in reset-for-4.11, and would cause consumer drivers depending on the new behaviour of optional resets to fail probing if RESET_CONTROLLER Kconfig option is disabled. * tag 'reset-fixes-for-4.11' of git://git.pengutronix.de/git/pza/linux: reset: fix optional reset_control_get stubs to return NULL Signed-off-by: Olof Johansson <olof@lixom.net>
2 parents 2b25930 + 0ca10b6 commit 6014ce8

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

include/linux/reset.h

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,31 +31,26 @@ static inline int device_reset_optional(struct device *dev)
3131

3232
static inline int reset_control_reset(struct reset_control *rstc)
3333
{
34-
WARN_ON(1);
3534
return 0;
3635
}
3736

3837
static inline int reset_control_assert(struct reset_control *rstc)
3938
{
40-
WARN_ON(1);
4139
return 0;
4240
}
4341

4442
static inline int reset_control_deassert(struct reset_control *rstc)
4543
{
46-
WARN_ON(1);
4744
return 0;
4845
}
4946

5047
static inline int reset_control_status(struct reset_control *rstc)
5148
{
52-
WARN_ON(1);
5349
return 0;
5450
}
5551

5652
static inline void reset_control_put(struct reset_control *rstc)
5753
{
58-
WARN_ON(1);
5954
}
6055

6156
static inline int __must_check device_reset(struct device *dev)
@@ -74,14 +69,14 @@ static inline struct reset_control *__of_reset_control_get(
7469
const char *id, int index, bool shared,
7570
bool optional)
7671
{
77-
return ERR_PTR(-ENOTSUPP);
72+
return optional ? NULL : ERR_PTR(-ENOTSUPP);
7873
}
7974

8075
static inline struct reset_control *__devm_reset_control_get(
8176
struct device *dev, const char *id,
8277
int index, bool shared, bool optional)
8378
{
84-
return ERR_PTR(-ENOTSUPP);
79+
return optional ? NULL : ERR_PTR(-ENOTSUPP);
8580
}
8681

8782
#endif /* CONFIG_RESET_CONTROLLER */

0 commit comments

Comments
 (0)