Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9573840ybi; Wed, 24 Jul 2019 06:28:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqypI0jLXOn2WTfUV7CR5X8zbHg4pTH1yWa1j99o9yRedQxF+FXb9p3v2lHhWOojdPWpBSAt X-Received: by 2002:a17:90b:d8b:: with SMTP id bg11mr87737528pjb.30.1563974920707; Wed, 24 Jul 2019 06:28:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563974920; cv=none; d=google.com; s=arc-20160816; b=jG8MVVj0hmBN7zwMbrhnsqqTO/sF7yvqF5GtJj7G37sbcdlh4yeOHrUTC5AaxuFi0x VJOBApuGk9TvdmMuJnbpBCPGipzPux2xQNiAf1/mx3XPfS6ziRU/ivAknyflOizAFqmD caZlr8FJAM91DEaNroCH0bmA6evZKQUtxPoUZ5qIiiG0h8JmuHRbpb41Yb2eqkePS6dY q2t3dnpLIp6lG/IlR7avf6fzNcGVSG7row2U7s0Z+jjhCzcQaEkHL6q8pIXaUli9n+/n +2VwC8rx4iypqv6Er8nNZ9ZBFsZmC8IDY5p4HnfStbyZit9PYf7Pm2y3dWy/SLX8xvKX uZrg== 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=owiTM8Q6umaAS/3ug5KbVl7PG47t5xBZGA8pOFJhaV8=; b=D+7idatvPt7gQEeuebRE8gemt1sUiy9hz9g5rGlxVRxbUx0OHndjxn9gZmOpVndRH7 bcl1meB5mLI8Mwc6hkt+kRI3B1KS08QB0OHtVDe0TwE26SYqc/KOXAvsVpDSr+Y6L7Nw MT27HnEnRs0crDpjoPqzaaBiBvkMEtRrbXE30+ksRqqYT2w6QVthpOyYudbK7YpgPJ8d 2e21/u41Ul7Cc9x8F7YmgBmWFBJWQZOWwLQQgIlxmeJfjEEoTEfBDwSo30YYW2WbnSiI mSr69Bl/cNgfiwAk1tjlyK6ZuZqm7JvyIrdvdP4OFz+HejrtSjgt7E3zBEF/ik4iLHsP jNdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=W7Gz6c35; 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 g7si13020562plb.29.2019.07.24.06.28.26; Wed, 24 Jul 2019 06:28:40 -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=W7Gz6c35; 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 S1728254AbfGXMWy (ORCPT + 99 others); Wed, 24 Jul 2019 08:22:54 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:34573 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728245AbfGXMWy (ORCPT ); Wed, 24 Jul 2019 08:22:54 -0400 Received: by mail-pg1-f196.google.com with SMTP id n9so14935116pgc.1 for ; Wed, 24 Jul 2019 05:22:54 -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=owiTM8Q6umaAS/3ug5KbVl7PG47t5xBZGA8pOFJhaV8=; b=W7Gz6c35Guc8aOL1iTlo1fcB4geIOT8cdwOS3IeIVUszly5B24LnjbaMVbEMD/Wjnl d3mAWEWmWoGPt5am6+eQ0PtGRMCwcDkKQnrrQeXIqvAKJREKLZIbRKQIjkeET10LxO57 ++e6wpTj1c/CdcFhCoK1rTJTbQr827Zch+ivKGYPPM6Ue1296ECm8py5hDU+JZGcEILl //sl9HHAEGv+gir23ovAEre5YbCoQcUgcQhUrgQjH3nqYjhmQFEim4oa6Xrth1QaIIEo qxe5GIfxJ7G2fbUW2XT/Nrr/QBZn8TehPyaicnJjYRmiBowe1C6TJybSVNX/iDxjHEzO JDaA== 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=owiTM8Q6umaAS/3ug5KbVl7PG47t5xBZGA8pOFJhaV8=; b=qdtB4LQP3syUtJ7A90iCjJvZjuSajKGP2K96p7CwbQ2j+eaSM8Z6eNC28qeXp3PKcO f5uqGLb/Nog3EGqUFU56s8k8TrQhRdY3F5W1PKyDAd4MDF5hXTon9W9PzXZqDfT0JazE /WgfDKxgRQ49Z9AQXYYOH1ryAFXrH9Zy75w66Ps1CaKB+V5mWDzQrB+482NKcHEJzPJI bJvHMvhEQLnw4IWmqh7wZT2PXZEmMPuw6aFEHsVKtwHecAAnhA6cvNBarUoUR8nhr1Sf DdkFYaRENeONDuIFt1tR2ZsRAAqfrtuloGAslqcuSWEiwcBI+SavHQRGacXBbiXf1CN9 XWWA== X-Gm-Message-State: APjAAAWge3oW+dQ2Kbc40IrbJSjKSL/15ge/5aC9lrgtVLBsukIabPVI m6SbgDlMlZmFh8qMuwsKL+SoMk43BFA= X-Received: by 2002:a65:6406:: with SMTP id a6mr44499499pgv.393.1563970973792; Wed, 24 Jul 2019 05:22:53 -0700 (PDT) Received: from suzukaze.ipads-lab.se.sjtu.edu.cn ([89.31.126.54]) by smtp.gmail.com with ESMTPSA id b16sm74206976pfo.54.2019.07.24.05.22.52 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 24 Jul 2019 05:22:53 -0700 (PDT) From: Chuhong Yuan Cc: Sudip Mukherjee , linux-kernel@vger.kernel.org, Chuhong Yuan Subject: [PATCH] parport: parport_serial: Use dev_get_drvdata Date: Wed, 24 Jul 2019 20:22:49 +0800 Message-Id: <20190724122249.21693-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/parport/parport_serial.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/parport/parport_serial.c b/drivers/parport/parport_serial.c index 461fd8a24278..b11f5d238eda 100644 --- a/drivers/parport/parport_serial.c +++ b/drivers/parport/parport_serial.c @@ -660,8 +660,7 @@ static void parport_serial_pci_remove(struct pci_dev *dev) static int __maybe_unused parport_serial_pci_suspend(struct device *dev) { - struct pci_dev *pdev = to_pci_dev(dev); - struct parport_serial_private *priv = pci_get_drvdata(pdev); + struct parport_serial_private *priv = dev_get_drvdata(dev); if (priv->serial) pciserial_suspend_ports(priv->serial); @@ -672,8 +671,7 @@ static int __maybe_unused parport_serial_pci_suspend(struct device *dev) static int __maybe_unused parport_serial_pci_resume(struct device *dev) { - struct pci_dev *pdev = to_pci_dev(dev); - struct parport_serial_private *priv = pci_get_drvdata(pdev); + struct parport_serial_private *priv = dev_get_drvdata(dev); if (priv->serial) pciserial_resume_ports(priv->serial); -- 2.20.1