Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1636330ybi; Wed, 17 Jul 2019 19:11:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqwxb34jjAvTc47aDwuKV3msWEeSgpfKQlgdx4fnp2AEAG19YaU+tZynlQqBgw9+nAb9+vhy X-Received: by 2002:a17:90a:2008:: with SMTP id n8mr47366844pjc.4.1563415919514; Wed, 17 Jul 2019 19:11:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563415919; cv=none; d=google.com; s=arc-20160816; b=l+3vVvRb4kIsrMGhbWqSxzjeHIy4bqnDAusrmpmgh8CYoYHkYotPh7tin/4l9/97kQ SPOKuEx9ywpAWPpWaZ7MGSEjnfLX5e1+170NkJ3OgVKb+qUbE68kIuDiCEU27/2Tbar+ Xpasu1UF2zgVr4MLQCK32u/DvxtBYHsxd9gJMGx8IS0G4V+NNCw6b6UJx6Dol3fBlDLr tITvVh2w+Qva60+FhQPIK8WGbdKr67pDCD12XpJejkVWTbFDvNnicuZN7hWn6ZJP+iz+ LDnQPnYHfV9iCbpbLvSUWzcmrrQJHyaqO69AzUjgP1a9HvsHTirYur4vfOBDqQfRuC57 hwrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=s3FqD/9ywMtWUkGKcxfI+KWW3y3k4HPd03zVQggO5Ss=; b=mKSf7YmBhyGNZqiWUaL/NJc7mi0KhLyb84dzBj7JFYYGUl2g5XiMxKm/ENpG4M2k2i a4wN4X/3JVc9KiVOciSkmVLaZI09LImDlpIPfdIXaBmsTPsLzCoEy91PlWgzlG/tp1oP 2Y63e8J+qKFIxXLp/sdPNXM1NXffDY1U1aewHuPknKRu8GrYGpyCgj6m9LjAxmByXuVX nhX1x0dCXFCHFmAXcqti96wNogLY0FX0jU3eV+Ke0ffd41osiuKvaeD2v0g2mQwizYOt tTBeF77oVFYYlhVwdIPiJSftcB7sEwY78gH3KgsPKkdapOtrH9fSWONMZwQcTx9ZRz8U rPxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fredlawl-com.20150623.gappssmtp.com header.s=20150623 header.b=IufrID5S; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r26si1142512pgv.189.2019.07.17.19.11.43; Wed, 17 Jul 2019 19:11:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@fredlawl-com.20150623.gappssmtp.com header.s=20150623 header.b=IufrID5S; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389193AbfGRCJ2 (ORCPT + 99 others); Wed, 17 Jul 2019 22:09:28 -0400 Received: from mail-oi1-f195.google.com ([209.85.167.195]:33826 "EHLO mail-oi1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389172AbfGRCJ1 (ORCPT ); Wed, 17 Jul 2019 22:09:27 -0400 Received: by mail-oi1-f195.google.com with SMTP id l12so20243961oil.1 for ; Wed, 17 Jul 2019 19:09:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fredlawl-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=s3FqD/9ywMtWUkGKcxfI+KWW3y3k4HPd03zVQggO5Ss=; b=IufrID5Sr3HYLTvrB1JEBLM4Y244W5hlYc8yTqb10u/IZOq2MPm3BEF5jsUcrgBobz fpSjrbbPexHaQFjTG12zIRt/cqwYqyZiq3f0/l021qEYrJHrqEUgNsFAYe2tfhSi5Smi /aRxxdNcOForx4r8Rx3LCtx+Q+UPSG1g8Fz+d3Y88agVLBtC1nbRtBpAo4cyCigpY2Ph A20KMPQ5nWJnSMZehuxb7VGGrK5raiYn4UweHo+FYtjDCfSxzMqZlSWC2/EOnzKYHHqg mal54dB80t2anMd7E9WZ2EPM4IVN6lKbvVsGZTPMO9w8txm1qWuD9+EqiNvgVR11B1Jo Uv1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=s3FqD/9ywMtWUkGKcxfI+KWW3y3k4HPd03zVQggO5Ss=; b=GwXkzb7PN+Du+ueVo0NSONkMLLgSVT/lmp+0Boy5Cthn+nkYd9bXL0aXZB99SjYKFV SIeun0EhERiQXA4UVh40lI0Ed739TyBDObfrag0oiqaz3WAj4oP/9RWadz0NTmoXBCfK L0JoxI8Xrk8bSCVJaZqfSDuxQvoiOL1CewLVn6iNWBr6skmmveP4TO1F1ODN3BliTMI2 ogd4DBHcOCwUR7va3cUuWe+kH40vhlRiEcObbQ3bk7foxa3zWsspw2IVxYRleMLbRk6r VhzZpDWRL2xPcCyTF+MB4F49EVQboPLrNYsvO8LuU4qQJlvWDepagJux2b25+Ih6X7uS 8YZQ== X-Gm-Message-State: APjAAAW+KKJyke9CpplJVgJ6dyg8MwqK3JJ31ztzWpz2me8llFGpj76s cCcu5+nV/L97wBQXCNgbmVc= X-Received: by 2002:a54:4f95:: with SMTP id g21mr21522031oiy.23.1563415766758; Wed, 17 Jul 2019 19:09:26 -0700 (PDT) Received: from linux.fredlawl.com ([2600:1700:18a0:11d0:18af:e893:6cb0:139a]) by smtp.gmail.com with ESMTPSA id m21sm9392567otn.12.2019.07.17.19.09.25 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 17 Jul 2019 19:09:26 -0700 (PDT) From: Frederick Lawler To: axboe@kernel.dk Cc: Frederick Lawler , bvanassche@acm.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, bhelgaas@google.com Subject: [PATCH] skd: Prefer pcie_capability_read_word() Date: Wed, 17 Jul 2019 21:07:45 -0500 Message-Id: <20190718020745.8867-10-fred@fredlawl.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190718020745.8867-1-fred@fredlawl.com> References: <20190718020745.8867-1-fred@fredlawl.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit 8c0d3a02c130 ("PCI: Add accessors for PCI Express Capability") added accessors for the PCI Express Capability so that drivers didn't need to be aware of differences between v1 and v2 of the PCI Express Capability. Replace pci_read_config_word() and pci_write_config_word() calls with pcie_capability_read_word() and pcie_capability_write_word(). Signed-off-by: Frederick Lawler --- drivers/block/skd_main.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/block/skd_main.c b/drivers/block/skd_main.c index 7d3ad6c22ee5..996c38d03fc4 100644 --- a/drivers/block/skd_main.c +++ b/drivers/block/skd_main.c @@ -3137,18 +3137,14 @@ MODULE_DEVICE_TABLE(pci, skd_pci_tbl); static char *skd_pci_info(struct skd_device *skdev, char *str) { - int pcie_reg; - strcpy(str, "PCIe ("); - pcie_reg = pci_find_capability(skdev->pdev, PCI_CAP_ID_EXP); - if (pcie_reg) { + if (pci_is_pcie(skdev->pdev)) { char lwstr[6]; uint16_t pcie_lstat, lspeed, lwidth; - pcie_reg += 0x12; - pci_read_config_word(skdev->pdev, pcie_reg, &pcie_lstat); + pcie_capability_read_word(skdev->pdev, 0x12, &pcie_lstat); lspeed = pcie_lstat & (0xF); lwidth = (pcie_lstat & 0x3F0) >> 4; -- 2.17.1