Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp8420580ybi; Tue, 23 Jul 2019 08:15:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqyrnnBmxgoouLDz+u4MLcAYYugDLHTDa2+jdJen6VOPmqi7kKcH0DWL0+ah/wvHIkH1haBC X-Received: by 2002:aa7:8b10:: with SMTP id f16mr6371183pfd.44.1563894911139; Tue, 23 Jul 2019 08:15:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563894911; cv=none; d=google.com; s=arc-20160816; b=0GHMCQWq0ybYgdQ1nyfeGI9BSNd8DdTqKOAEZygaEPzrg1GF0t9P4qY4+ie8aVpb3w sQ/RZRcGqIY8QKDp17cVftM7+M7VAQP/5FamwZfEiHDXUf7UJkZBg3Z9+DooXJZnzSsx En2lBIbA2zBqJC5iZFx9xQoqaj2tF/uHDAyD0MwuiX3Wl+sup3prolo/O3pxLnMnx9xl 6jWts5PpMO7YMdBUqg7hgDqV7mbkX6Gk3SClnabbDJSSGjIHE0ahH/EhHDezkwEhmSlN dh0vxHkjftrjAQPG/3M5q6InImi9B/wWNGMlA80kyVUano1kLUU5pODHR2JUZKKwJQ8+ /v7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from:dkim-signature; bh=SmcqePyLoJfafXJo9wRS1ucEWseSMTg+J4NGkrBeJ2Q=; b=ixZtv5jfsKBvVFlpWIuizfKeLBDKlCvitOQMRTWYJdJI4LncNRiwEQjE43zqhlYqMk cuHa1cnogKM6Du49DzvqWAKvhHJRe6vwOOYkc1u3HR5IiqmVSbdfDfIYhTwX6kCZMAjh TARuTEH8YMDTpZW9cIR0v+VJf1TtSNH3XLRFpo1n5VRqxjLfMF8L0qho9rS9ASqJLfAK gC7tBpJC6cd5oFOpk26g7xDVA7NNpgeRByqqyws5iVPDJsOu9c8/nP1AM0Lh8iTeU9/T ODuj7s72ibXYfmKVPSDXdeSB3zHvwUcj8EotnZPb6wZyVcP0ExU7VPbiTzwK10D55l2D BDOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=D6Enh0j7; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id be11si11906715plb.218.2019.07.23.08.14.54; Tue, 23 Jul 2019 08:15:11 -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=fail header.i=@gmail.com header.s=20161025 header.b=D6Enh0j7; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728780AbfGWIHX (ORCPT + 99 others); Tue, 23 Jul 2019 04:07:23 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:45019 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727375AbfGWIHX (ORCPT ); Tue, 23 Jul 2019 04:07:23 -0400 Received: by mail-pl1-f193.google.com with SMTP id t14so20272902plr.11; Tue, 23 Jul 2019 01:07:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=SmcqePyLoJfafXJo9wRS1ucEWseSMTg+J4NGkrBeJ2Q=; b=D6Enh0j7M4s2hLVUEvLzBLpx/VNPQG8njwiAL9gv0mP/6QIdVjkkOLVkYs/4u2GHDA Wst6nQeGEUZv1KorUW/tlAYTmEmd742o44p8TqsbH5g81NfeF3viBZqhkJfGRchxDtcI oqWT2iJZlCXzfwlZprDJIxW6QAwsv5xAtfCVFnC1RV5fDCVSknHKTzFA0gqEI9bsP9ko Z5oH5bpYZVTEGMVzYW5lLZam0i7EVNSf2cTV3fYGb3zNIpkldP/CAvLaCsWOINEn8Gwx SBA7cwOCTxc/83F+ym4tfbQmC6lKDxqUXGTasVrldu+HzrHwt4SDWTkTz5rGFriep2ok /jgQ== 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:mime-version :content-transfer-encoding; bh=SmcqePyLoJfafXJo9wRS1ucEWseSMTg+J4NGkrBeJ2Q=; b=OOdpGnZoXDEI3ZVIsPRyWVznu82whpJfBbmh2DE6gxZh0WkNTtQ79IIplNqQIpwa2l +SSLoknT22ZjdhTJ4jaAWufhLE86mrUy7JWxHz1Cw8f8xEUvMTsucCRpEmLKFQj4Wufh cZuhWi/XRdasuSK4LVRVFFu4b8z3o5zoFwJLZMzm4zk7ppDBFq1Gx+nnL0K7A7R4cFew f0WlV0JD1XrLCxtaGLICntd8sIEwYbFVy+A2ka/PuhtC/xxZDugXaaeRjKIYg2XuE59T O5xznw1IuEIx8fNhTBao12P/aVN6ooCeropNKi9zGrehfiOeWIz4iz9gRNIKX3Hqh/3H 60Uw== X-Gm-Message-State: APjAAAVKORc6bzIDVRrqb5XD4VcYY9EWJ/4PHYZKL9l37xbGz8TE24Jd Yzl9Wt7UygvM8iuv0JiR9oQ= X-Received: by 2002:a17:902:4283:: with SMTP id h3mr77244197pld.15.1563869242286; Tue, 23 Jul 2019 01:07:22 -0700 (PDT) Received: from suzukaze.ipads-lab.se.sjtu.edu.cn ([89.31.126.54]) by smtp.gmail.com with ESMTPSA id z24sm71542800pfr.51.2019.07.23.01.07.19 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 23 Jul 2019 01:07:21 -0700 (PDT) From: Chuhong Yuan Cc: Jens Axboe , linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, Chuhong Yuan Subject: [PATCH] drivers: ata: Use dev_get_drvdata where possible Date: Tue, 23 Jul 2019 16:06:40 +0800 Message-Id: <20190723080639.18266-1-hslester96@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Instead of using to_pci_dev + pci_get_drvdata, use dev_get_drvdata to make code simpler. Signed-off-by: Chuhong Yuan --- drivers/ata/ahci.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index f7652baa6337..58a981cdc83f 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -836,8 +836,7 @@ static void ahci_pci_disable_interrupts(struct ata_host *host) static int ahci_pci_device_runtime_suspend(struct device *dev) { - struct pci_dev *pdev = to_pci_dev(dev); - struct ata_host *host = pci_get_drvdata(pdev); + struct ata_host *host = dev_get_drvdata(dev); ahci_pci_disable_interrupts(host); return 0; @@ -845,8 +844,7 @@ static int ahci_pci_device_runtime_suspend(struct device *dev) static int ahci_pci_device_runtime_resume(struct device *dev) { - struct pci_dev *pdev = to_pci_dev(dev); - struct ata_host *host = pci_get_drvdata(pdev); + struct ata_host *host = dev_get_drvdata(dev); int rc; rc = ahci_pci_reset_controller(host); @@ -859,12 +857,11 @@ static int ahci_pci_device_runtime_resume(struct device *dev) #ifdef CONFIG_PM_SLEEP static int ahci_pci_device_suspend(struct device *dev) { - struct pci_dev *pdev = to_pci_dev(dev); - struct ata_host *host = pci_get_drvdata(pdev); + struct ata_host *host = dev_get_drvdata(dev); struct ahci_host_priv *hpriv = host->private_data; if (hpriv->flags & AHCI_HFLAG_NO_SUSPEND) { - dev_err(&pdev->dev, + dev_err(dev, "BIOS update required for suspend/resume\n"); return -EIO; } -- 2.20.1