From patchwork Tue Mar 7 22:46:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ondrej Zary X-Patchwork-Id: 65935 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp7979wrd; Tue, 7 Mar 2023 14:59:25 -0800 (PST) X-Google-Smtp-Source: AK7set8Jpq6cbZ2HWGcUOvz0Vm5KurIuBWx4XSyOa2r9ZeR0LgaxkRKUhEtgrPJk/tSgOiyLa0eN X-Received: by 2002:aa7:dccb:0:b0:4ae:eae1:946a with SMTP id w11-20020aa7dccb000000b004aeeae1946amr18892256edu.13.1678229965449; Tue, 07 Mar 2023 14:59:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678229965; cv=none; d=google.com; s=arc-20160816; b=eRnlwuVnFh8Sy/vZLav2dYUpHrII5iapwYmVBWan7JmUgd5deW7zVP/G0x9ugzq2oj b/BctBWvJh0clOXQ6Sl1F34VNhth1BIAlgD2PwaknF57DXSBr55eYnctamz73T8chiyU kCDabhDCY4ODYpsynSl1Uy6i7xlPJ62/22kp5LtMrKP+bsADBNZnm+Y3Xb2mHRSArRY/ ddYqkYZuRtZ3b6ruNVmoaOEnO7P9Hviq7Aq/USzIhtt9RK5GaiVg3edWn42Jyf+NgO6b P9kgZna+UjE9R+qOivALn3Be+zr1gZt5L/RubSIlw5B/xb5agKC86MRzxgLrWp1H4Kku RLXg== 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=CufxdAmji2FvwTRaxMJreJo0AJO3O0rE5PnhWd3/o7Q=; b=dqrTp3vXUmrC/mgd6JhgiUU073QC5uu7Hzexr45F+dECGS3WSLZoqsderlN4iIOfj6 3F/F0COWnNzTvnd1Y/p6RcmpfDWIx/hDjGcFg9TwkMfes0M974/wncGecW+gcNRSIx2H p7s8p1aX9/Btz02OIwc2jvnzArTj2bJ34rRxe2VTA/IQIG5t/rA1oM7AoxtmSmfDdUuR LTLKMSnmJc0SyIcmqLYaEQzAmg0kSf+5hUnC1FtYS+i22VE8EQkZQL28o7Ev4/Dwmulv m3yPuuHEiA3Mj3me7BBjs5SN+VsCCQ7kCItLyWG6/38oHIwjD1cFNkqjLA7wqGo1P6Vs Jn7w== 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 c17-20020a056402121100b004aab6380df0si4163353edw.548.2023.03.07.14.59.01; Tue, 07 Mar 2023 14:59: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 S231163AbjCGWsO (ORCPT + 99 others); Tue, 7 Mar 2023 17:48:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231232AbjCGWrN (ORCPT ); Tue, 7 Mar 2023 17:47:13 -0500 Received: from hosting.gsystem.sk (hosting.gsystem.sk [212.5.213.30]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 827CA1EBC3; Tue, 7 Mar 2023 14:47:06 -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 D24B77A073E; Tue, 7 Mar 2023 23:46:49 +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 18/32] pata_parport-bpck6: merge ppc6_rd_port16_blk into bpck6_read_block Date: Tue, 7 Mar 2023 23:46:13 +0100 Message-Id: <20230307224627.28011-19-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?1759751664278605918?= X-GMAIL-MSGID: =?utf-8?q?1759751664278605918?= ppc6_rd_port16_blk is only called by bpck6_read_block. Merge ppc6_rd_port16_blk into bpck6_read_block. Signed-off-by: Ondrej Zary --- drivers/ata/pata_parport/bpck6.c | 10 +++++++++- drivers/ata/pata_parport/ppc6lnx.c | 21 --------------------- 2 files changed, 9 insertions(+), 22 deletions(-) diff --git a/drivers/ata/pata_parport/bpck6.c b/drivers/ata/pata_parport/bpck6.c index 8e0094e3b02b..aaf6737891a5 100644 --- a/drivers/ata/pata_parport/bpck6.c +++ b/drivers/ata/pata_parport/bpck6.c @@ -42,7 +42,15 @@ static void bpck6_write_block(struct pi_adapter *pi, char *buf, int len) static void bpck6_read_block(struct pi_adapter *pi, char *buf, int len) { - ppc6_rd_port16_blk(pi, ATA_REG_DATA, buf, (u32)len>>1); + ppc6_send_cmd(pi, REG_BLKSIZE | ACCESS_REG | ACCESS_WRITE); + ppc6_wr_data_byte(pi, (u8)len); + ppc6_wr_data_byte(pi, (u8)(len >> 8)); + ppc6_wr_data_byte(pi, 0); + + ppc6_send_cmd(pi, CMD_PREFIX_SET | PREFIX_IO16 | PREFIX_BLK); + ppc6_send_cmd(pi, ATA_REG_DATA | ACCESS_PORT | ACCESS_READ); + ppc6_rd_data_blk(pi, buf, len); + ppc6_send_cmd(pi, CMD_PREFIX_RESET | PREFIX_IO16 | PREFIX_BLK); } static void bpck6_connect(struct pi_adapter *pi) diff --git a/drivers/ata/pata_parport/ppc6lnx.c b/drivers/ata/pata_parport/ppc6lnx.c index 35427742e4d3..ac336ce1695b 100644 --- a/drivers/ata/pata_parport/ppc6lnx.c +++ b/drivers/ata/pata_parport/ppc6lnx.c @@ -75,7 +75,6 @@ static u8 ppc6_rd_data_byte(struct pi_adapter *pi); static void ppc6_rd_data_blk(struct pi_adapter *pi, u8 *data, long count); static void ppc6_wait_for_fifo(struct pi_adapter *pi); static void ppc6_wr_data_blk(struct pi_adapter *pi, u8 *data, long count); -static void ppc6_rd_port16_blk(struct pi_adapter *pi, u8 port, u8 *data, long length); static void ppc6_wr_port16_blk(struct pi_adapter *pi, u8 port, u8 *data, long length); static void ppc6_wr_extout(struct pi_adapter *pi, u8 regdata); static int ppc6_open(struct pi_adapter *pi); @@ -479,26 +478,6 @@ static void ppc6_wr_data_blk(struct pi_adapter *pi, u8 *data, long count) //*************************************************************************** -static void ppc6_rd_port16_blk(struct pi_adapter *pi, u8 port, u8 *data, long length) -{ - length = length << 1; - - ppc6_send_cmd(pi, REG_BLKSIZE | ACCESS_REG | ACCESS_WRITE); - ppc6_wr_data_byte(pi, (u8)length); - ppc6_wr_data_byte(pi, (u8)(length >> 8)); - ppc6_wr_data_byte(pi, 0); - - ppc6_send_cmd(pi, CMD_PREFIX_SET | PREFIX_IO16 | PREFIX_BLK); - - ppc6_send_cmd(pi, port | ACCESS_PORT | ACCESS_READ); - - ppc6_rd_data_blk(pi, data, length); - - ppc6_send_cmd(pi, CMD_PREFIX_RESET | PREFIX_IO16 | PREFIX_BLK); -} - -//*************************************************************************** - static void ppc6_wr_port16_blk(struct pi_adapter *pi, u8 port, u8 *data, long length) { length = length << 1;