hc
2024-10-12 a5969cabbb4660eab42b6ef0412cbbd1200cf14d
kernel/drivers/net/ethernet/microchip/encx24j600-regmap.c
....@@ -1,13 +1,10 @@
1
-/**
1
+// SPDX-License-Identifier: GPL-2.0-only
2
+/*
23 * Register map access API - ENCX24J600 support
34 *
45 * Copyright 2015 Gridpoint
56 *
67 * 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.
118 */
129
1310 #include <linux/delay.h>
....@@ -19,11 +16,6 @@
1916 #include <linux/spi/spi.h>
2017
2118 #include "encx24j600_hw.h"
22
-
23
-static inline bool is_bits_set(int value, int mask)
24
-{
25
- return (value & mask) == mask;
26
-}
2719
2820 static int encx24j600_switch_bank(struct encx24j600_context *ctx,
2921 int bank)
....@@ -367,7 +359,7 @@
367359 goto err_out;
368360
369361 usleep_range(26, 100);
370
- while ((ret = regmap_read(ctx->regmap, MISTAT, &mistat) != 0) &&
362
+ while (((ret = regmap_read(ctx->regmap, MISTAT, &mistat)) == 0) &&
371363 (mistat & BUSY))
372364 cpu_relax();
373365
....@@ -405,7 +397,7 @@
405397 goto err_out;
406398
407399 usleep_range(26, 100);
408
- while ((ret = regmap_read(ctx->regmap, MISTAT, &mistat) != 0) &&
400
+ while (((ret = regmap_read(ctx->regmap, MISTAT, &mistat)) == 0) &&
409401 (mistat & BUSY))
410402 cpu_relax();
411403