From patchwork Tue Oct 11 17:45:52 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartlomiej Zolnierkiewicz X-Patchwork-Id: 119058 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.180.67]) by ozlabs.org (Postfix) with ESMTP id 74A8AB6EE8 for ; Wed, 12 Oct 2011 05:29:10 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755184Ab1JKSZV (ORCPT ); Tue, 11 Oct 2011 14:25:21 -0400 Received: from mail-bw0-f46.google.com ([209.85.214.46]:46351 "EHLO mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755356Ab1JKSZT (ORCPT ); Tue, 11 Oct 2011 14:25:19 -0400 Received: by mail-bw0-f46.google.com with SMTP id zt4so10123455bkb.19 for ; Tue, 11 Oct 2011 11:25:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:cc:mime-version:message-id :content-type:content-transfer-encoding; bh=VCHB8W5uhRlrSravp7fwMGN9JZxB4jCL19iK0S2iPPE=; b=OoGVxKrX0KzBrDI4apdUGl5ZzZWq9bum2Umli5aEr5fFakhZrXczvWP85BTM1V3AsM JzNq3ifU4NvK+MQXvPckNsc2rHPSMHJsVqtWk86qtr3xEU916c7a+uk7emCxtItdDuSz 8DR0mZGlNybbTeaMJRBZpI7UMN8T82DBHDGTQ= Received: by 10.204.145.3 with SMTP id b3mr10467933bkv.10.1318357518610; Tue, 11 Oct 2011 11:25:18 -0700 (PDT) Received: from linux-mhg7.site (89-74-122-41.dynamic.chello.pl. [89.74.122.41]) by mx.google.com with ESMTPS id t13sm14351364fae.0.2011.10.11.11.25.15 (version=SSLv3 cipher=OTHER); Tue, 11 Oct 2011 11:25:16 -0700 (PDT) From: Bartlomiej Zolnierkiewicz To: Jeff Garzik Subject: [PATCH] pata_artop: unify ->prereset methods Date: Tue, 11 Oct 2011 19:45:52 +0200 User-Agent: KMail/1.13.6 (Linux/2.6.37.6-0.7-desktop-dirty; KDE/4.6.0; x86_64; ; ) Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Message-Id: <201110111945.52701.bzolnier@gmail.com> Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org From: Bartlomiej Zolnierkiewicz Subject: [PATCH] pata_artop: unify ->prereset methods * Unify ->prereset methods for ATP850 and ATP86x[R] chipsets. * Fix ->prereset documentation while at it. Signed-off-by: Bartlomiej Zolnierkiewicz --- earlier references: https://lkml.org/lkml/2009/11/25/315 drivers/ata/pata_artop.c | 26 +++++--------------------- 1 file changed, 5 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_artop.c =================================================================== --- a/drivers/ata/pata_artop.c +++ b/drivers/ata/pata_artop.c @@ -39,31 +39,15 @@ static int clock = 0; -static int artop6210_pre_reset(struct ata_link *link, unsigned long deadline) -{ - struct ata_port *ap = link->ap; - struct pci_dev *pdev = to_pci_dev(ap->host->dev); - const struct pci_bits artop_enable_bits[] = { - { 0x4AU, 1U, 0x02UL, 0x02UL }, /* port 0 */ - { 0x4AU, 1U, 0x04UL, 0x04UL }, /* port 1 */ - }; - - if (!pci_test_config_bits(pdev, &artop_enable_bits[ap->port_no])) - return -ENOENT; - - return ata_sff_prereset(link, deadline); -} - /** - * artop6260_pre_reset - check for 40/80 pin + * artop62x0_pre_reset - probe begin * @link: link * @deadline: deadline jiffies for the operation * - * The ARTOP hardware reports the cable detect bits in register 0x49. * Nothing complicated needed here. */ -static int artop6260_pre_reset(struct ata_link *link, unsigned long deadline) +static int artop62x0_pre_reset(struct ata_link *link, unsigned long deadline) { static const struct pci_bits artop_enable_bits[] = { { 0x4AU, 1U, 0x02UL, 0x02UL }, /* port 0 */ @@ -73,7 +57,7 @@ static int artop6260_pre_reset(struct at struct ata_port *ap = link->ap; struct pci_dev *pdev = to_pci_dev(ap->host->dev); - /* Odd numbered device ids are the units with enable bits (the -R cards) */ + /* Odd numbered device ids are the units with enable bits. */ if ((pdev->device & 1) && !pci_test_config_bits(pdev, &artop_enable_bits[ap->port_no])) return -ENOENT; @@ -317,7 +301,7 @@ static struct ata_port_operations artop6 .cable_detect = ata_cable_40wire, .set_piomode = artop6210_set_piomode, .set_dmamode = artop6210_set_dmamode, - .prereset = artop6210_pre_reset, + .prereset = artop62x0_pre_reset, .qc_defer = artop6210_qc_defer, }; @@ -326,7 +310,7 @@ static struct ata_port_operations artop6 .cable_detect = artop6260_cable_detect, .set_piomode = artop6260_set_piomode, .set_dmamode = artop6260_set_dmamode, - .prereset = artop6260_pre_reset, + .prereset = artop62x0_pre_reset, };