diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2023-06-30 21:48:16 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2023-06-30 21:48:16 +0300 |
commit | 1546cd4bfda49fd6faad47eb30f4e744e2d79a8f (patch) | |
tree | c20714d63d40c094a6f45538947753163dc71ae8 /drivers/ata/pata_parport/bpck6.c | |
parent | b30d7a77c53ec04a6d94683d7680ec406b7f3ac8 (diff) | |
parent | fd3ac6e8049799ca7dbd2738de8e149536e92a5e (diff) | |
download | linux-1546cd4bfda49fd6faad47eb30f4e744e2d79a8f.tar.xz |
Merge tag 'ata-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata
Pull ata updates from Damien Le Moal:
- Add support for the .remove_new callback to the ata_platform code to
simplify device removal interface (Uwe)
- Code simplification in ata_dev_revalidate() (Yahu)
- Fix code indentation and coding style in the pata_parport protocol
modules to avoid warnings from static code analyzers (me)
- Clarify ata_eh_qc_retry() behavior with better comments (Niklas)
- Simplify and improve ata_change_queue_depth() behavior to have a
consistent behavior between libsas managed devices and libata managed
devices (e.g. AHCI connected devices) (me)
- Cleanup libata-scsi and libata-eh code to use the ata_ncq_enabled()
and ata_ncq_supported() helpers instead of open coding flags tests
(me)
- Cleanup ahci_reset_controller() code (me)
- Change the pata_octeon_cf and sata_svw drivers to use
of_property_read_reg() to simplify the code (Rob, me)
- Remove unnecessary include files from ahci_octeon driver (me)
- Modify the DesignWare ahci dt bindings to add support for the
Rockchip RK3588 AHCI (Sebastian)
* tag 'ata-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata: (29 commits)
dt-bindings: phy: rockchip: rk3588 has two reset lines
dt-bindings: ata: dwc-ahci: add Rockchip RK3588
dt-bindings: ata: dwc-ahci: add PHY clocks
ata: ahci_octeon: Remove unnecessary include
ata: pata_octeon_cf: Add missing header include
ata: ahci: Cleanup ahci_reset_controller()
ata: Use of_property_read_reg() to parse "reg"
ata: libata-scsi: Use ata_ncq_supported in ata_scsi_dev_config()
ata: libata-eh: Use ata_ncq_enabled() in ata_eh_speed_down()
ata: libata-sata: Improve ata_change_queue_depth()
ata: libata-sata: Simplify ata_change_queue_depth()
ata: libata-eh: Clarify ata_eh_qc_retry() behavior at call site
ata: pata_parport: Fix on26 module code indentation and style
ata: pata_parport: Fix on20 module code indentation and style
ata: pata_parport: Fix ktti module code indentation and style
ata: pata_parport: Fix kbic module code indentation and style
ata: pata_parport: Fix friq module code indentation and style
ata: pata_parport: Fix fit3 module code indentation and style
ata: pata_parport: Fix fit2 module code indentation and style
ata: pata_parport: Fix epia module code indentation and style
...
Diffstat (limited to 'drivers/ata/pata_parport/bpck6.c')
-rw-r--r-- | drivers/ata/pata_parport/bpck6.c | 67 |
1 files changed, 35 insertions, 32 deletions
diff --git a/drivers/ata/pata_parport/bpck6.c b/drivers/ata/pata_parport/bpck6.c index 76febd07a9bb..c6dbd14120d1 100644 --- a/drivers/ata/pata_parport/bpck6.c +++ b/drivers/ata/pata_parport/bpck6.c @@ -1,15 +1,13 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* - backpack.c (c) 2001 Micro Solutions Inc. - Released under the terms of the GNU General Public license - - backpack.c is a low-level protocol driver for the Micro Solutions - "BACKPACK" parallel port IDE adapter - (Works on Series 6 drives) - - Written by: Ken Hahn (linux-dev@micro-solutions.com) - Clive Turvey (linux-dev@micro-solutions.com) - -*/ + * (c) 2001 Micro Solutions Inc. + * + * backpack.c is a low-level protocol driver for the Micro Solutions + * "BACKPACK" parallel port IDE adapter (works on Series 6 drives). + * + * Written by: Ken Hahn (linux-dev@micro-solutions.com) + * Clive Turvey (linux-dev@micro-solutions.com) + */ #include <linux/module.h> #include <linux/init.h> @@ -326,11 +324,14 @@ static int bpck6_open(struct pi_adapter *pi) if (j != k) goto fail; - if (i & 4) // EPP + if (i & 4) { + /* EPP */ parport_frob_control(pi->pardev->port, PARPORT_CONTROL_SELECT | PARPORT_CONTROL_INIT, 0); - else // PPC/ECP + } else { + /* PPC/ECP */ parport_frob_control(pi->pardev->port, PARPORT_CONTROL_SELECT, 0); + } pi->private = 0; @@ -347,17 +348,20 @@ fail: parport_write_control(pi->pardev->port, pi->saved_r2); parport_write_data(pi->pardev->port, pi->saved_r0); - return 0; // FAIL + return 0; } static void bpck6_deselect(struct pi_adapter *pi) { - if (mode_map[pi->mode] & 4) // EPP + if (mode_map[pi->mode] & 4) { + /* EPP */ parport_frob_control(pi->pardev->port, PARPORT_CONTROL_INIT, - PARPORT_CONTROL_INIT); - else // PPC/ECP + PARPORT_CONTROL_INIT); + } else { + /* PPC/ECP */ parport_frob_control(pi->pardev->port, PARPORT_CONTROL_SELECT, - PARPORT_CONTROL_SELECT); + PARPORT_CONTROL_SELECT); + } parport_write_data(pi->pardev->port, pi->saved_r0); parport_write_control(pi->pardev->port, @@ -386,7 +390,8 @@ static void bpck6_disconnect(struct pi_adapter *pi) bpck6_deselect(pi); } -static int bpck6_test_port(struct pi_adapter *pi) /* check for 8-bit port */ +/* check for 8-bit port */ +static int bpck6_test_port(struct pi_adapter *pi) { dev_dbg(&pi->dev, "PARPORT indicates modes=%x for lp=0x%lx\n", pi->pardev->port->modes, pi->pardev->port->base); @@ -413,28 +418,26 @@ static int bpck6_probe_unit(struct pi_adapter *pi) dev_dbg(&pi->dev, "ppc_open returned %2x\n", out); - if(out) - { + if (out) { bpck6_deselect(pi); dev_dbg(&pi->dev, "leaving probe\n"); pi->mode = saved_mode; - return(1); + return 1; } - else - { - dev_dbg(&pi->dev, "Failed open\n"); - pi->mode = saved_mode; - return(0); - } + + dev_dbg(&pi->dev, "Failed open\n"); + pi->mode = saved_mode; + + return 0; } static void bpck6_log_adapter(struct pi_adapter *pi) { - char *mode_string[5]= - {"4-bit","8-bit","EPP-8","EPP-16","EPP-32"}; + char *mode_string[5] = { "4-bit", "8-bit", "EPP-8", "EPP-16", "EPP-32" }; - dev_info(&pi->dev, "Micro Solutions BACKPACK Drive unit %d at 0x%x, mode:%d (%s), delay %d\n", - pi->unit, pi->port, pi->mode, mode_string[pi->mode], pi->delay); + dev_info(&pi->dev, + "Micro Solutions BACKPACK Drive unit %d at 0x%x, mode:%d (%s), delay %d\n", + pi->unit, pi->port, pi->mode, mode_string[pi->mode], pi->delay); } static struct pi_protocol bpck6 = { |