hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/ata/pata_atp867x.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * pata_atp867x.c - ARTOP 867X 64bit 4-channel UDMA133 ATA controller driver
34 *
....@@ -6,21 +7,6 @@
67 * Per Atp867 data sheet rev 1.2, Acard.
78 * Based in part on early ide code from
89 * 2003-2004 by Eric Uhrhane, Google, Inc.
9
- *
10
- * This program is free software; you can redistribute it and/or modify
11
- * it under the terms of the GNU General Public License as published by
12
- * the Free Software Foundation; either version 2 of the License, or
13
- * (at your option) any later version.
14
- *
15
- * This program is distributed in the hope that it will be useful,
16
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
- * GNU 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
22
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23
- *
2410 *
2511 * TODO:
2612 * 1. RAID features [comparison, XOR, striping, mirroring, etc.]
....@@ -171,7 +157,7 @@
171157 default:
172158 printk(KERN_WARNING "ATP867X: active %dclk is invalid. "
173159 "Using 12clk.\n", clk);
174
- /* fall through */
160
+ fallthrough;
175161 case 9 ... 12:
176162 clocks = 7; /* 12 clk */
177163 break;
....@@ -204,7 +190,7 @@
204190 default:
205191 printk(KERN_WARNING "ATP867X: recover %dclk is invalid. "
206192 "Using default 12clk.\n", clk);
207
- /* fall through */
193
+ fallthrough;
208194 case 12: /* default 12 clk */
209195 clocks = 0;
210196 break;
....@@ -436,7 +422,7 @@
436422 #ifdef ATP867X_DEBUG
437423 atp867x_check_res(pdev);
438424
439
- for (i = 0; i < PCI_ROM_RESOURCE; i++)
425
+ for (i = 0; i < PCI_STD_NUM_BARS; i++)
440426 printk(KERN_DEBUG "ATP867X: iomap[%d]=0x%llx\n", i,
441427 (unsigned long long)(host->iomap[i]));
442428 #endif
....@@ -477,12 +463,7 @@
477463
478464 atp867x_fixup(host);
479465
480
- rc = dma_set_mask(&pdev->dev, ATA_DMA_MASK);
481
- if (rc)
482
- return rc;
483
-
484
- rc = dma_set_coherent_mask(&pdev->dev, ATA_DMA_MASK);
485
- return rc;
466
+ return dma_set_mask_and_coherent(&pdev->dev, ATA_DMA_MASK);
486467 }
487468
488469 static int atp867x_init_one(struct pci_dev *pdev,