From patchwork Tue Oct 11 18:11:44 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartlomiej Zolnierkiewicz X-Patchwork-Id: 119049 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 D67E3B6F65 for ; Wed, 12 Oct 2011 05:27:06 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755505Ab1JKSZq (ORCPT ); Tue, 11 Oct 2011 14:25:46 -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 S1755442Ab1JKSZp (ORCPT ); Tue, 11 Oct 2011 14:25:45 -0400 Received: by mail-bw0-f46.google.com with SMTP id zt4so10123455bkb.19 for ; Tue, 11 Oct 2011 11:25:44 -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=shaV6SVKRhroo+fgGZQhZKmH6uhdV47rfJPJpsZAPGk=; b=OxseE+r1MHShH+YG84YYzND1QqroNCg542O1PBxekd+B2GKKcQgmYTnqRkazWxNQnP jjgB69bthjQpQTwJIBqXLn13fqtR5VTEhyeo2SioZWdIdKHzkbdJSqIYBeeriW24D/89 CoSz++p0bzGOeD0rRPXQxK/yikYBOdzqLT7jw= Received: by 10.204.133.5 with SMTP id d5mr10678225bkt.44.1318357544362; Tue, 11 Oct 2011 11:25:44 -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.42 (version=SSLv3 cipher=OTHER); Tue, 11 Oct 2011 11:25:42 -0700 (PDT) From: Bartlomiej Zolnierkiewicz To: Jeff Garzik Subject: [PATCH 2/3] pata_serverworks: cleanup cable detection Date: Tue, 11 Oct 2011 20:11:44 +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: <201110112011.44748.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: cleanup cable detection Signed-off-by: Bartlomiej Zolnierkiewicz --- earlier references: https://lkml.org/lkml/2010/1/18/324 drivers/ata/pata_serverworks.c | 37 +++++++------------------------------ 1 file changed, 7 insertions(+), 30 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 @@ -57,32 +57,14 @@ static const char *csb_bad_ata100[] = { }; /** - * dell_cable - Dell serverworks cable detection + * oem_cable - Dell/Sun serverworks cable detection * @ap: ATA port to do cable detect * - * Dell hide the 40/80 pin select for their interfaces in the top two - * bits of the subsystem ID. + * Dell PowerEdge and Sun Cobalt 'Alpine' hide the 40/80 pin select + * for their interfaces in the top two bits of the subsystem ID. */ -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))) - return ATA_CBL_PATA80; - return ATA_CBL_PATA40; -} - -/** - * sun_cable - Sun Cobalt 'Alpine' cable detection - * @ap: ATA port to do cable select - * - * Cobalt CSB5 IDE hides the 40/80pin in the top two bits of the - * subsystem ID the same as dell. We could use one function but we may - * need to extend the Dell one in future - */ - -static int sun_cable(struct ata_port *ap) +static int oem_cable(struct ata_port *ap) { struct pci_dev *pdev = to_pci_dev(ap->host->dev); @@ -97,15 +79,10 @@ struct sv_cable_table { int (*cable_detect)(struct ata_port *ap); }; -/* - * Note that we don't copy the old serverworks code because the old - * code contains obvious mistakes - */ - 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_CSB5IDE, PCI_VENDOR_ID_DELL, oem_cable }, + { PCI_DEVICE_ID_SERVERWORKS_CSB6IDE, PCI_VENDOR_ID_DELL, oem_cable }, + { PCI_DEVICE_ID_SERVERWORKS_CSB5IDE, PCI_VENDOR_ID_SUN, oem_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 },