.. | .. |
---|
1 | | -/** |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
| 2 | +/* |
---|
2 | 3 | * Register map access API - ENCX24J600 support |
---|
3 | 4 | * |
---|
4 | 5 | * Copyright 2015 Gridpoint |
---|
5 | 6 | * |
---|
6 | 7 | * Author: Jon Ringle <jringle@gridpoint.com> |
---|
7 | | - * |
---|
8 | | - * This program is free software; you can redistribute it and/or modify |
---|
9 | | - * it under the terms of the GNU General Public License version 2 as |
---|
10 | | - * published by the Free Software Foundation. |
---|
11 | 8 | */ |
---|
12 | 9 | |
---|
13 | 10 | #include <linux/delay.h> |
---|
.. | .. |
---|
19 | 16 | #include <linux/spi/spi.h> |
---|
20 | 17 | |
---|
21 | 18 | #include "encx24j600_hw.h" |
---|
22 | | - |
---|
23 | | -static inline bool is_bits_set(int value, int mask) |
---|
24 | | -{ |
---|
25 | | - return (value & mask) == mask; |
---|
26 | | -} |
---|
27 | 19 | |
---|
28 | 20 | static int encx24j600_switch_bank(struct encx24j600_context *ctx, |
---|
29 | 21 | int bank) |
---|
.. | .. |
---|
367 | 359 | goto err_out; |
---|
368 | 360 | |
---|
369 | 361 | usleep_range(26, 100); |
---|
370 | | - while ((ret = regmap_read(ctx->regmap, MISTAT, &mistat) != 0) && |
---|
| 362 | + while (((ret = regmap_read(ctx->regmap, MISTAT, &mistat)) == 0) && |
---|
371 | 363 | (mistat & BUSY)) |
---|
372 | 364 | cpu_relax(); |
---|
373 | 365 | |
---|
.. | .. |
---|
405 | 397 | goto err_out; |
---|
406 | 398 | |
---|
407 | 399 | usleep_range(26, 100); |
---|
408 | | - while ((ret = regmap_read(ctx->regmap, MISTAT, &mistat) != 0) && |
---|
| 400 | + while (((ret = regmap_read(ctx->regmap, MISTAT, &mistat)) == 0) && |
---|
409 | 401 | (mistat & BUSY)) |
---|
410 | 402 | cpu_relax(); |
---|
411 | 403 | |
---|