From patchwork Tue Mar 7 22:46:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ondrej Zary X-Patchwork-Id: 65932 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp7673wrd; Tue, 7 Mar 2023 14:58:26 -0800 (PST) X-Google-Smtp-Source: AK7set+hlfp3FNlm7eYEG5dbFzTD3rUwEYIyezhqWz6X/MM8CemcM5OOaWVQNVvsyu+QgNDdFdVK X-Received: by 2002:a17:906:a1cc:b0:878:7189:a457 with SMTP id bx12-20020a170906a1cc00b008787189a457mr16946144ejb.51.1678229905925; Tue, 07 Mar 2023 14:58:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678229905; cv=none; d=google.com; s=arc-20160816; b=GJUtfLPYHa5fCde8DjO9X3JNOJSImOei7g2w8KUrDQtFLwu0GKgOYazrDrETVR7Mh1 oDiZJF+jymzrKjeJ80EUUSf5eTg+kRdIZOieiun8ttNfUCpIwNdFIOqUK9w6ruN66DF6 jOie1WPAvVtFmBxsEYkZd7ze0nk+l/3q9lkrKfWjVoMfUuBDsl4Sr8l+EnI1BmIQxuYx mULSqqY1f9ajx0WiOd3hvu/pmJyAxpwGCnBoUpj6NihRTsVFYZE8h88Ml2HC1Sm64Xk0 GJqQWvMnC5aeHUKjuB6kTjAzx2AHqWNL968Us3t4Nm4r3M1rnWBOsNp23K3z1C77Qk7W 8HYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=gC7xjsd5fN0jiMdOh6X9kiQYEP5RlETMCXB/GHzOpjQ=; b=EFDJQ/OJ9yXayEYXX1XIuB8wQygYIy49o+g/oXRMiI1ZPHgrEM0AsuISEsp3XjeIrg OdMwNg2CqG/7S55bLHc6WuxsSh9pIBlmZm3eEB6W8od22CASWt7Qe0mbcxpHl56k0jes 5PuboKyiDZqwFa4rD1mZhAVkUnUlpL7xugIvJpgMwv44gR2KnEHdhewaRk7SwgJZQxph OprtrWAuiGJBSoqnnk6HumTz9B/r6c0ibl6GYqOW9PPaBaW4KNpwczv8U1AabEN3rD6a UqJGv8aEQKt409kL3erpOmvkR+CU5yfkFHMDSXphF6lfNCFoVGu7ibalIAF0eFxxGBt8 2DAQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a20-20020a170906275400b008e176a55b12si13316022ejd.983.2023.03.07.14.58.01; Tue, 07 Mar 2023 14:58:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231755AbjCGWrl (ORCPT + 99 others); Tue, 7 Mar 2023 17:47:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230323AbjCGWrH (ORCPT ); Tue, 7 Mar 2023 17:47:07 -0500 Received: from hosting.gsystem.sk (hosting.gsystem.sk [212.5.213.30]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4BC0A40D2; Tue, 7 Mar 2023 14:47:01 -0800 (PST) Received: from gsql.ggedos.sk (off-20.infotel.telecom.sk [212.5.213.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by hosting.gsystem.sk (Postfix) with ESMTPSA id E14E37A06F8; Tue, 7 Mar 2023 23:46:48 +0100 (CET) From: Ondrej Zary To: Damien Le Moal , Sudip Mukherjee Cc: Christoph Hellwig , Sergey Shtylyov , Jens Axboe , Tim Waugh , linux-block@vger.kernel.org, linux-parport@lists.infradead.org, linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 10/32] pata_parport-bpck6: remove parallel port bit defines Date: Tue, 7 Mar 2023 23:46:05 +0100 Message-Id: <20230307224627.28011-11-linux@zary.sk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230307224627.28011-1-linux@zary.sk> References: <20230307224627.28011-1-linux@zary.sk> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759751601467481041?= X-GMAIL-MSGID: =?utf-8?q?1759751601467481041?= Remove port_stb, port_afd, cmd_stb, port_init, data_stb and port_sel defines and use standard PARPORT_CONTROL_* instead. Signed-off-by: Ondrej Zary --- drivers/ata/pata_parport/ppc6lnx.c | 59 ++++++++++++++---------------- 1 file changed, 27 insertions(+), 32 deletions(-) diff --git a/drivers/ata/pata_parport/ppc6lnx.c b/drivers/ata/pata_parport/ppc6lnx.c index ee8cee6bae7c..09480a7fcaee 100644 --- a/drivers/ata/pata_parport/ppc6lnx.c +++ b/drivers/ata/pata_parport/ppc6lnx.c @@ -16,12 +16,6 @@ //*************************************************************************** -#define port_stb 1 -#define port_afd 2 -#define cmd_stb port_afd -#define port_init 4 -#define data_stb port_init -#define port_sel 8 #define port_int 16 #define port_dir 0x20 @@ -123,7 +117,7 @@ static int ppc6_select(struct pi_adapter *pi) CUR_CTRL = pi->saved_r2; - CUR_CTRL |= port_sel; + CUR_CTRL |= PARPORT_CONTROL_SELECT; outb(CUR_CTRL, pi->port + 2); @@ -135,11 +129,11 @@ static int ppc6_select(struct pi_adapter *pi) outb(pi->unit, pi->port); outb(~pi->unit, pi->port); - CUR_CTRL &= ~port_sel; + CUR_CTRL &= ~PARPORT_CONTROL_SELECT; outb(CUR_CTRL, pi->port + 2); - CUR_CTRL = (CUR_CTRL & port_int) | port_init; + CUR_CTRL = (CUR_CTRL & port_int) | PARPORT_CONTROL_INIT; outb(CUR_CTRL, pi->port + 2); @@ -150,13 +144,13 @@ static int ppc6_select(struct pi_adapter *pi) outb(i, pi->port); - CUR_CTRL |= port_sel; + CUR_CTRL |= PARPORT_CONTROL_SELECT; outb(CUR_CTRL, pi->port + 2); // DELAY - CUR_CTRL |= port_afd; + CUR_CTRL |= PARPORT_CONTROL_AUTOFD; outb(CUR_CTRL, pi->port + 2); @@ -166,7 +160,7 @@ static int ppc6_select(struct pi_adapter *pi) if (j == k) { - CUR_CTRL &= ~port_afd; + CUR_CTRL &= ~PARPORT_CONTROL_AUTOFD; outb(CUR_CTRL, pi->port + 2); @@ -175,9 +169,9 @@ static int ppc6_select(struct pi_adapter *pi) if (j == k) { if (i & 4) // EPP - CUR_CTRL &= ~(port_sel | port_init); + CUR_CTRL &= ~(PARPORT_CONTROL_SELECT | PARPORT_CONTROL_INIT); else // PPC/ECP - CUR_CTRL &= ~port_sel; + CUR_CTRL &= ~PARPORT_CONTROL_SELECT; outb(CUR_CTRL, pi->port + 2); @@ -197,15 +191,15 @@ static int ppc6_select(struct pi_adapter *pi) static void ppc6_deselect(struct pi_adapter *pi) { if (mode_map[pi->mode] & 4) // EPP - CUR_CTRL |= port_init; + CUR_CTRL |= PARPORT_CONTROL_INIT; else // PPC/ECP - CUR_CTRL |= port_sel; + CUR_CTRL |= PARPORT_CONTROL_SELECT; outb(CUR_CTRL, pi->port + 2); outb(pi->saved_r0, pi->port); - outb((pi->saved_r2 | port_sel), pi->port + 2); + outb((pi->saved_r2 | PARPORT_CONTROL_SELECT), pi->port + 2); outb(pi->saved_r2, pi->port + 2); } @@ -223,7 +217,7 @@ static void ppc6_send_cmd(struct pi_adapter *pi, u8 cmd) { outb(cmd, pi->port); - CUR_CTRL ^= cmd_stb; + CUR_CTRL ^= PARPORT_CONTROL_AUTOFD; outb(CUR_CTRL, pi->port + 2); @@ -254,7 +248,7 @@ static void ppc6_wr_data_byte(struct pi_adapter *pi, u8 data) { outb(data, pi->port); - CUR_CTRL ^= data_stb; + CUR_CTRL ^= PARPORT_CONTROL_INIT; outb(CUR_CTRL, pi->port + 2); @@ -283,7 +277,7 @@ static u8 ppc6_rd_data_byte(struct pi_adapter *pi) case PPCMODE_UNI_SW : case PPCMODE_UNI_FW : { - CUR_CTRL = (CUR_CTRL & ~port_stb) ^ data_stb; + CUR_CTRL = (CUR_CTRL & ~PARPORT_CONTROL_STROBE) ^ PARPORT_CONTROL_INIT; outb(CUR_CTRL, pi->port + 2); @@ -293,7 +287,7 @@ static u8 ppc6_rd_data_byte(struct pi_adapter *pi) data = ((data & 0x80) >> 1) | ((data & 0x38) >> 3); - CUR_CTRL |= port_stb; + CUR_CTRL |= PARPORT_CONTROL_STROBE; outb(CUR_CTRL, pi->port + 2); @@ -311,13 +305,13 @@ static u8 ppc6_rd_data_byte(struct pi_adapter *pi) outb(CUR_CTRL, pi->port + 2); - CUR_CTRL = (CUR_CTRL | port_stb) ^ data_stb; + CUR_CTRL = (CUR_CTRL | PARPORT_CONTROL_STROBE) ^ PARPORT_CONTROL_INIT; outb(CUR_CTRL, pi->port + 2); data = inb(pi->port); - CUR_CTRL &= ~port_stb; + CUR_CTRL &= ~PARPORT_CONTROL_STROBE; outb(CUR_CTRL, pi->port + 2); @@ -376,7 +370,8 @@ static void ppc6_rd_data_blk(struct pi_adapter *pi, u8 *data, long count) { u8 d; - CUR_CTRL = (CUR_CTRL & ~port_stb) ^ data_stb; + CUR_CTRL = (CUR_CTRL & ~PARPORT_CONTROL_STROBE) + ^ PARPORT_CONTROL_INIT; outb(CUR_CTRL, pi->port + 2); @@ -386,7 +381,7 @@ static void ppc6_rd_data_blk(struct pi_adapter *pi, u8 *data, long count) d = ((d & 0x80) >> 1) | ((d & 0x38) >> 3); - CUR_CTRL |= port_stb; + CUR_CTRL |= PARPORT_CONTROL_STROBE; outb(CUR_CTRL, pi->port + 2); @@ -408,11 +403,11 @@ static void ppc6_rd_data_blk(struct pi_adapter *pi, u8 *data, long count) outb(CUR_CTRL, pi->port + 2); - CUR_CTRL |= port_stb; + CUR_CTRL |= PARPORT_CONTROL_STROBE; while(count) { - CUR_CTRL ^= data_stb; + CUR_CTRL ^= PARPORT_CONTROL_INIT; outb(CUR_CTRL, pi->port + 2); @@ -420,7 +415,7 @@ static void ppc6_rd_data_blk(struct pi_adapter *pi, u8 *data, long count) count--; } - CUR_CTRL &= ~port_stb; + CUR_CTRL &= ~PARPORT_CONTROL_STROBE; outb(CUR_CTRL, pi->port + 2); @@ -525,7 +520,7 @@ static void ppc6_wr_data_blk(struct pi_adapter *pi, u8 *data, long count) { outb(*data++, pi->port); - CUR_CTRL ^= data_stb; + CUR_CTRL ^= PARPORT_CONTROL_INIT; outb(CUR_CTRL, pi->port + 2); } @@ -540,7 +535,7 @@ static void ppc6_wr_data_blk(struct pi_adapter *pi, u8 *data, long count) ppc6_send_cmd(pi, CMD_PREFIX_SET | PREFIX_FASTWR); - CUR_CTRL |= port_stb; + CUR_CTRL |= PARPORT_CONTROL_STROBE; outb(CUR_CTRL, pi->port + 2); @@ -555,7 +550,7 @@ static void ppc6_wr_data_blk(struct pi_adapter *pi, u8 *data, long count) if (this == last) { - CUR_CTRL ^= data_stb; + CUR_CTRL ^= PARPORT_CONTROL_INIT; outb(CUR_CTRL, pi->port + 2); } @@ -567,7 +562,7 @@ static void ppc6_wr_data_blk(struct pi_adapter *pi, u8 *data, long count) } } - CUR_CTRL &= ~port_stb; + CUR_CTRL &= ~PARPORT_CONTROL_STROBE; outb(CUR_CTRL, pi->port + 2);