From patchwork Tue Oct 11 18:09:31 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartlomiej Zolnierkiewicz X-Patchwork-Id: 119050 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 30D4DB6F71 for ; Wed, 12 Oct 2011 05:27:31 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755213Ab1JKS1H (ORCPT ); Tue, 11 Oct 2011 14:27:07 -0400 Received: from mail-ey0-f174.google.com ([209.85.215.174]:37696 "EHLO mail-ey0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755356Ab1JKSZn (ORCPT ); Tue, 11 Oct 2011 14:25:43 -0400 Received: by eye27 with SMTP id 27so2857801eye.19 for ; Tue, 11 Oct 2011 11:25:42 -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:content-type :content-transfer-encoding:message-id; bh=emz5cH72rVQ462EwVOf4R6iGVp2drEuoMmDoYOQKSOo=; b=PrsLMGDEfusI+1NFxrb50RivtQT8vyz5TFMncwE/IQFAB21m/Q+xeGo/xVw0zLnW0I dbaEMZ9XAIfQYVd2IwUKe5Q53uScbUAkTjGKhQR4rbe3fQgbxp5I6tVMGRM+4+mJGm7i r0abHIXzGxzD1uEiyNq+0ywrQavH73KKbUmpI= Received: by 10.223.75.27 with SMTP id w27mr27820505faj.11.1318357542074; Tue, 11 Oct 2011 11:25:42 -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.39 (version=SSLv3 cipher=OTHER); Tue, 11 Oct 2011 11:25:40 -0700 (PDT) From: Bartlomiej Zolnierkiewicz To: Jeff Garzik Subject: [PATCH 1/3] pata_serverworks: use standard cable detection methods Date: Tue, 11 Oct 2011 20:09:31 +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: <201110112009.32126.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_serverworks: use standard cable detection methods Signed-off-by: Bartlomiej Zolnierkiewicz --- earlier references: https://lkml.org/lkml/2009/11/25/375 drivers/ata/pata_serverworks.c | 45 ++++++++++------------------------------- 1 file changed, 12 insertions(+), 33 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_serverworks.c =================================================================== --- a/drivers/ata/pata_serverworks.c +++ b/drivers/ata/pata_serverworks.c @@ -64,7 +64,8 @@ static const char *csb_bad_ata100[] = { * bits of the subsystem ID. */ -static int dell_cable(struct ata_port *ap) { +static int dell_cable(struct ata_port *ap) +{ struct pci_dev *pdev = to_pci_dev(ap->host->dev); if (pdev->subsystem_device & (1 << (ap->port_no + 14))) @@ -81,7 +82,8 @@ static int dell_cable(struct ata_port *a * need to extend the Dell one in future */ -static int sun_cable(struct ata_port *ap) { +static int sun_cable(struct ata_port *ap) +{ struct pci_dev *pdev = to_pci_dev(ap->host->dev); if (pdev->subsystem_device & (1 << (ap->port_no + 14))) @@ -89,29 +91,6 @@ static int sun_cable(struct ata_port *ap return ATA_CBL_PATA40; } -/** - * osb4_cable - OSB4 cable detect - * @ap: ATA port to check - * - * The OSB4 isn't UDMA66 capable so this is easy - */ - -static int osb4_cable(struct ata_port *ap) { - return ATA_CBL_PATA40; -} - -/** - * csb_cable - CSB5/6 cable detect - * @ap: ATA port to check - * - * Serverworks default arrangement is to use the drive side detection - * only. - */ - -static int csb_cable(struct ata_port *ap) { - return ATA_CBL_PATA_UNK; -} - struct sv_cable_table { int device; int subvendor; @@ -124,14 +103,14 @@ struct sv_cable_table { */ static struct sv_cable_table cable_detect[] = { - { PCI_DEVICE_ID_SERVERWORKS_CSB5IDE, PCI_VENDOR_ID_DELL, dell_cable }, - { PCI_DEVICE_ID_SERVERWORKS_CSB6IDE, PCI_VENDOR_ID_DELL, dell_cable }, - { PCI_DEVICE_ID_SERVERWORKS_CSB5IDE, PCI_VENDOR_ID_SUN, sun_cable }, - { PCI_DEVICE_ID_SERVERWORKS_OSB4IDE, PCI_ANY_ID, osb4_cable }, - { PCI_DEVICE_ID_SERVERWORKS_CSB5IDE, PCI_ANY_ID, csb_cable }, - { PCI_DEVICE_ID_SERVERWORKS_CSB6IDE, PCI_ANY_ID, csb_cable }, - { PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2, PCI_ANY_ID, csb_cable }, - { PCI_DEVICE_ID_SERVERWORKS_HT1000IDE, PCI_ANY_ID, csb_cable }, + { PCI_DEVICE_ID_SERVERWORKS_CSB5IDE, PCI_VENDOR_ID_DELL, dell_cable }, + { PCI_DEVICE_ID_SERVERWORKS_CSB6IDE, PCI_VENDOR_ID_DELL, dell_cable }, + { PCI_DEVICE_ID_SERVERWORKS_CSB5IDE, PCI_VENDOR_ID_SUN, sun_cable }, + { PCI_DEVICE_ID_SERVERWORKS_OSB4IDE, PCI_ANY_ID, ata_cable_40wire }, + { PCI_DEVICE_ID_SERVERWORKS_CSB5IDE, PCI_ANY_ID, ata_cable_unknown }, + { PCI_DEVICE_ID_SERVERWORKS_CSB6IDE, PCI_ANY_ID, ata_cable_unknown }, + { PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2, PCI_ANY_ID, ata_cable_unknown }, + { PCI_DEVICE_ID_SERVERWORKS_HT1000IDE, PCI_ANY_ID, ata_cable_unknown }, { } };