hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/block/rsxx/core.c
....@@ -1,25 +1,11 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Filename: core.c
3
-*
44 *
55 * Authors: Joshua Morris <josh.h.morris@us.ibm.com>
66 * Philip Kelleher <pjk1939@linux.vnet.ibm.com>
77 *
88 * (C) Copyright 2013 IBM Corporation
9
-*
10
-* This program is free software; you can redistribute it and/or
11
-* modify it under the terms of the GNU General Public License as
12
-* published by the Free Software Foundation; either version 2 of the
13
-* License, or (at your option) any later version.
14
-*
15
-* This program is distributed in the hope that it will be useful, but
16
-* WITHOUT ANY WARRANTY; without even the implied warranty of
17
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18
-* General Public License for more details.
19
-*
20
-* You should have received a copy of the GNU General Public License
21
-* along with this program; if not, write to the Free Software Foundation,
22
-* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
239 */
2410
2511 #include <linux/kernel.h>
....@@ -441,6 +427,7 @@
441427 * Fall through so the DMA devices can be attached and
442428 * the user can attempt to pull off their data.
443429 */
430
+ fallthrough;
444431 case CARD_STATE_GOOD:
445432 st = rsxx_get_card_size8(card, &card->size8);
446433 if (st)
....@@ -454,7 +441,7 @@
454441 case CARD_STATE_FAULT:
455442 dev_crit(CARD_TO_DEV(card),
456443 "Hardware Fault reported!\n");
457
- /* Fall through. */
444
+ fallthrough;
458445
459446 /* Everything else, detach DMA interface if it's attached. */
460447 case CARD_STATE_SHUTDOWN:
....@@ -577,13 +564,15 @@
577564
578565 for (i = 0; i < card->n_targets; i++) {
579566 if (card->ctrl[i].status.buf)
580
- pci_free_consistent(card->dev, STATUS_BUFFER_SIZE8,
581
- card->ctrl[i].status.buf,
582
- card->ctrl[i].status.dma_addr);
567
+ dma_free_coherent(&card->dev->dev,
568
+ STATUS_BUFFER_SIZE8,
569
+ card->ctrl[i].status.buf,
570
+ card->ctrl[i].status.dma_addr);
583571 if (card->ctrl[i].cmd.buf)
584
- pci_free_consistent(card->dev, COMMAND_BUFFER_SIZE8,
585
- card->ctrl[i].cmd.buf,
586
- card->ctrl[i].cmd.dma_addr);
572
+ dma_free_coherent(&card->dev->dev,
573
+ COMMAND_BUFFER_SIZE8,
574
+ card->ctrl[i].cmd.buf,
575
+ card->ctrl[i].cmd.dma_addr);
587576 }
588577
589578 return 0;
....@@ -640,7 +629,7 @@
640629 }
641630
642631 static pci_ers_result_t rsxx_error_detected(struct pci_dev *dev,
643
- enum pci_channel_state error)
632
+ pci_channel_state_t error)
644633 {
645634 int st;
646635
....@@ -726,15 +715,15 @@
726715 failed_hw_buffers_init:
727716 for (i = 0; i < card->n_targets; i++) {
728717 if (card->ctrl[i].status.buf)
729
- pci_free_consistent(card->dev,
730
- STATUS_BUFFER_SIZE8,
731
- card->ctrl[i].status.buf,
732
- card->ctrl[i].status.dma_addr);
718
+ dma_free_coherent(&card->dev->dev,
719
+ STATUS_BUFFER_SIZE8,
720
+ card->ctrl[i].status.buf,
721
+ card->ctrl[i].status.dma_addr);
733722 if (card->ctrl[i].cmd.buf)
734
- pci_free_consistent(card->dev,
735
- COMMAND_BUFFER_SIZE8,
736
- card->ctrl[i].cmd.buf,
737
- card->ctrl[i].cmd.dma_addr);
723
+ dma_free_coherent(&card->dev->dev,
724
+ COMMAND_BUFFER_SIZE8,
725
+ card->ctrl[i].cmd.buf,
726
+ card->ctrl[i].cmd.dma_addr);
738727 }
739728 failed_hw_setup:
740729 rsxx_eeh_failure(dev);
....@@ -782,9 +771,8 @@
782771 goto failed_enable;
783772
784773 pci_set_master(dev);
785
- pci_set_dma_max_seg_size(dev, RSXX_HW_BLK_SIZE);
786774
787
- st = pci_set_dma_mask(dev, DMA_BIT_MASK(64));
775
+ st = dma_set_mask(&dev->dev, DMA_BIT_MASK(64));
788776 if (st) {
789777 dev_err(CARD_TO_DEV(card),
790778 "No usable DMA configuration,aborting\n");