From patchwork Thu Nov 19 18:12:24 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartlomiej Zolnierkiewicz X-Patchwork-Id: 38863 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 6DB3FB7B63 for ; Fri, 20 Nov 2009 05:14:25 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753909AbZKSSNf (ORCPT ); Thu, 19 Nov 2009 13:13:35 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754003AbZKSSNd (ORCPT ); Thu, 19 Nov 2009 13:13:33 -0500 Received: from mail-yw0-f202.google.com ([209.85.211.202]:65055 "EHLO mail-yw0-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753532AbZKSSNc (ORCPT ); Thu, 19 Nov 2009 13:13:32 -0500 Received: by ywh40 with SMTP id 40so1526581ywh.33 for ; Thu, 19 Nov 2009 10:13:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:date :user-agent:cc:mime-version:content-type:content-transfer-encoding :message-id; bh=Bh8Q1+ZAsOfYNoYsT92WYnoTOIJtaoLNbb5q1nhQZ1s=; b=CLiAYLspw0j6lartGf7W6XWIOBjTqDm8Qos9fAj6bLuwsVfxdExrtf2XFUYcGd2Iut kClUe/OBZPndPgLOV0Vh3Cnj4o7T0AO43rRMubnhPDOP/Qeh31RAuTeHixRPakXONGiT 0i4MtXkIvwItaHisEJff8QHZV5ekNGwzyenlI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:cc:mime-version:content-type :content-transfer-encoding:message-id; b=xDDfWpWsWt0mNn7WuVBnXXMTe7azhfEOflzmEgNNMxN9yekJGdQrL+kZivA9QDuCGo mT5qPG+gPuzSWV0pubr3Q/QXr/CY7V7IGkYLjU9bfNxJIKqntngS7ETGaa5F4TL5Zh0I AjLt+3FwaLExIZeVwUQ/U47eMI/b1sIxzFxLY= Received: by 10.213.1.27 with SMTP id 27mr1773959ebd.7.1258654417443; Thu, 19 Nov 2009 10:13:37 -0800 (PST) Received: from szaki.localnet (chello089079027028.chello.pl [89.79.27.28]) by mx.google.com with ESMTPS id 10sm196979eyz.7.2009.11.19.10.13.36 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 19 Nov 2009 10:13:37 -0800 (PST) From: Bartlomiej Zolnierkiewicz To: Jeff Garzik Subject: [PATCH 2/2] pata_hpt37x: unify ->pre_reset methods Date: Thu, 19 Nov 2009 19:12:24 +0100 User-Agent: KMail/1.12.2 (Linux/2.6.31.5-96.fc12.x86_64; KDE/4.3.2; x86_64; ; ) Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Message-Id: <200911191912.24663.bzolnier@gmail.com> Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org We can use the same ->pre_reset method for all HPT37x chipsets now. Signed-off-by: Bartlomiej Zolnierkiewicz Acked-by: Alan Cox --- drivers/ata/pata_hpt37x.c | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: b/drivers/ata/pata_hpt37x.c =================================================================== --- a/drivers/ata/pata_hpt37x.c +++ b/drivers/ata/pata_hpt37x.c @@ -360,7 +360,7 @@ static int hpt374_fn1_cable_detect(struc * @link: ATA link to reset * @deadline: deadline jiffies for the operation * - * Perform the initial reset handling for the 370/372 and 374 func 0 + * Perform the initial reset handling for the HPT37x. */ static int hpt37x_pre_reset(struct ata_link *link, unsigned long deadline) @@ -381,25 +381,6 @@ static int hpt37x_pre_reset(struct ata_l return ata_sff_prereset(link, deadline); } -static int hpt374_fn1_pre_reset(struct ata_link *link, unsigned long deadline) -{ - static const struct pci_bits hpt37x_enable_bits[] = { - { 0x50, 1, 0x04, 0x04 }, - { 0x54, 1, 0x04, 0x04 } - }; - struct ata_port *ap = link->ap; - struct pci_dev *pdev = to_pci_dev(ap->host->dev); - - if (!pci_test_config_bits(pdev, &hpt37x_enable_bits[ap->port_no])) - return -ENOENT; - - /* Reset the state machine */ - pci_write_config_byte(pdev, 0x50 + 4 * ap->port_no, 0x37); - udelay(100); - - return ata_sff_prereset(link, deadline); -} - /** * hpt370_set_piomode - PIO setup * @ap: ATA interface @@ -646,7 +627,7 @@ static struct ata_port_operations hpt372 static struct ata_port_operations hpt374_fn1_port_ops = { .inherits = &hpt372_port_ops, .cable_detect = hpt374_fn1_cable_detect, - .prereset = hpt374_fn1_pre_reset, + .prereset = hpt37x_pre_reset, }; /**