hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/net/sb1000.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /* sb1000.c: A General Instruments SB1000 driver for linux. */
23 /*
34 Written 1998 by Franco Venturi.
....@@ -11,11 +12,6 @@
1112
1213 The author may be reached as fventuri@mediaone.net
1314
14
- This program is free software; you can redistribute it
15
- and/or modify it under the terms of the GNU General
16
- Public License as published by the Free Software
17
- Foundation; either version 2 of the License, or (at
18
- your option) any later version.
1915
2016 Changes:
2117
....@@ -316,7 +312,7 @@
316312 card_send_command(const int ioaddr[], const char* name,
317313 const unsigned char out[], unsigned char in[])
318314 {
319
- int status, x;
315
+ int status;
320316
321317 if ((status = card_wait_for_busy_clear(ioaddr, name)))
322318 return status;
....@@ -345,9 +341,7 @@
345341 out[0], out[1], out[2], out[3], out[4], out[5]);
346342 }
347343
348
- if (out[1] == 0x1b) {
349
- x = (out[2] == 0x02);
350
- } else {
344
+ if (out[1] != 0x1b) {
351345 if (out[0] >= 0x80 && in[0] != (out[1] | 0x80))
352346 return -EIO;
353347 }
....@@ -490,14 +484,13 @@
490484 static const unsigned char Command0[6] = {0x80, 0x1f, 0x00, 0x00, 0x00, 0x00};
491485
492486 unsigned char st[7];
493
- int crc, status;
487
+ int status;
494488
495489 /* check CRC */
496490 if ((status = card_send_command(ioaddr, name, Command0, st)))
497491 return status;
498492 if (st[1] != st[3] || st[2] != st[4])
499493 return -EIO;
500
- crc = st[1] << 8 | st[2];
501494 return 0;
502495 }
503496
....@@ -535,17 +528,20 @@
535528 int status;
536529
537530 ssleep(1);
538
- if ((status = card_send_command(ioaddr, name, Command0, st)))
531
+ status = card_send_command(ioaddr, name, Command0, st);
532
+ if (status)
539533 return status;
540
- if ((status = card_send_command(ioaddr, name, Command1, st)))
534
+ status = card_send_command(ioaddr, name, Command1, st);
535
+ if (status)
541536 return status;
542537 if (st[3] != 0xf1) {
543
- if ((status = sb1000_start_get_set_command(ioaddr, name)))
538
+ status = sb1000_start_get_set_command(ioaddr, name);
539
+ if (status)
544540 return status;
545541 return -EIO;
546542 }
547543 udelay(1000);
548
- return sb1000_start_get_set_command(ioaddr, name);
544
+ return sb1000_start_get_set_command(ioaddr, name);
549545 }
550546
551547 /* get SB1000 firmware version */