hc
2024-05-11 04dd17822334871b23ea2862f7798fb0e0007777
kernel/drivers/ata/pata_legacy.c
....@@ -1,20 +1,7 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * pata-legacy.c - Legacy port PATA/SATA controller driver.
34 * Copyright 2005/2006 Red Hat, all rights reserved.
4
- *
5
- * This program is free software; you can redistribute it and/or modify
6
- * it under the terms of the GNU General Public License as published by
7
- * the Free Software Foundation; either version 2, or (at your option)
8
- * any later version.
9
- *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU General Public License for more details.
14
- *
15
- * You should have received a copy of the GNU General Public License
16
- * along with this program; see the file COPYING. If not, write to
17
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
185 *
196 * An ATA driver for the legacy ATA ports.
207 *
....@@ -55,7 +42,6 @@
5542 *
5643 * For now use autospeed and pio_mask as above with the W83759A. This may
5744 * change.
58
- *
5945 */
6046
6147 #include <linux/async.h>
....@@ -292,9 +278,10 @@
292278 outb(inb(0x1F4) & 0x07, 0x1F4);
293279
294280 rt = inb(0x1F3);
295
- rt &= 0x07 << (3 * adev->devno);
281
+ rt &= ~(0x07 << (3 * !adev->devno));
296282 if (pio)
297
- rt |= (1 + 3 * pio) << (3 * adev->devno);
283
+ rt |= (1 + 3 * pio) << (3 * !adev->devno);
284
+ outb(rt, 0x1F3);
298285
299286 udelay(100);
300287 outb(inb(0x1F2) | 0x01, 0x1F2);