Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9599801ybi; Wed, 24 Jul 2019 06:53:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqwhRYv4ZEEZeVSSfiwSKsiMb0WeI1frmo1pL8+AAXiFsPzNjCTNnDc1pe+MeSBSosYGLraR X-Received: by 2002:a62:8494:: with SMTP id k142mr11361400pfd.75.1563976437619; Wed, 24 Jul 2019 06:53:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563976437; cv=none; d=google.com; s=arc-20160816; b=Y6cu5ETnRoptI9PO1V8FO7kEqdfekqpUMfyBpAnB253b9pxeWJCup8W8dHrlk78V/q GMSGebv64LfcCBx+V1yPXJPyA0a/p2SE1wkZcOWYCx9J1vnLIx+WGDhWVyyjvZAPxFEo A9UIKCn6rCabx1llvkElVYQDdzpmkuE/O8t1puJh4mh3DAt59AhA+e3O2Pq2FreC5W5v JBHvrG/Q2lqkXaIWqcgqtficK9Wz31o084EFeGUKWOIwMPTcb1j3dDRQeftH21NehbqO KiU5/cnt7OgZyqSu7mfG60FLiByD3HtMFdml2oaLRctFMBH1YDePrll8K1u4cauaIufC HAFA== 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=IGVoS35C4loNzLjDedtQfBKQUut8ZAbe4JqEpeR9UYE=; b=VHYUXXjRXPsMZtCCu7smmOjCkKm08xDgNXRZ+pjyt5TpaugeLWJAZA5A5eDq+RbJv3 97QrUtF/IxrM1FWmAGDF/sZuMYAnejpNHA+FkHDS5aKDo3SOif/Qtx9Bz8NM5jiIsDSv JNh1p7Hkek+2pZQhlhJsIG0NQw2ITQz4rogkqsySp8CDhvwQHN3QW6Hg5Qf+IKsT+ZhZ bpF1+LyRnTIdhGlvXkRy7ELUr0mKz3NbR/5ddwgGkv7ljiD892EkwRz+ox2CvUU9E62b xawSc8iks64lIblGmkqUiT0alvdmqtyeXeEd4kr9Bwzv107s8hvzL39qHHW5F5SusNHA iGqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=Gw+tu5F7; 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 v9si12437139plp.4.2019.07.24.06.53.42; Wed, 24 Jul 2019 06:53:57 -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=Gw+tu5F7; 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 S1728534AbfGXNSE (ORCPT + 99 others); Wed, 24 Jul 2019 09:18:04 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:40824 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726514AbfGXNSE (ORCPT ); Wed, 24 Jul 2019 09:18:04 -0400 Received: by mail-pf1-f193.google.com with SMTP id p184so20945328pfp.7; Wed, 24 Jul 2019 06:18:03 -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=IGVoS35C4loNzLjDedtQfBKQUut8ZAbe4JqEpeR9UYE=; b=Gw+tu5F79d77Dwe5b0k7vepXMUNwjz60OAA4HK2OI7Um2S4WTauQ3iALzPuxXwMS6g rqIuyi0YvF4/nHdeRq/lUdpQVup8lfrira/SLWZYFuwSDiIaLi5zTx40vlqSCdXyqehM fbdEVy1nn2dT+/e3WLvU2G9aDmp60vcvv0t5OYWJznlbrLIre3IUBwQiPGQPYTMJ4kMh z1oq84ygowM1sbIi3Dfb4p9OZQCWvmztzEmAG9HF13u+LNnkdMgyIo9yamraIxnls6yy Q0z1142QyUT/1pXukEJ578Rnb/PYDps5cVFkNmKlR2ZnMrNxNEodrXM4ioAA5CeFrXax GWvg== 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=IGVoS35C4loNzLjDedtQfBKQUut8ZAbe4JqEpeR9UYE=; b=V3h4xIwcbOrATSEQkHja0OuhobWtN2GRt4bF00O5Gq0jV0zo+92gx/EZiYpyXtfgLY 1X1qo0QM5YQdmwj/24fvizwdTZKAPvjyb8uIXcOMeSsezEao8Dxuw8ORzg+ruVzHxFyV y/+/bXE1AAJvgEbMtWy/OfA7xgFecIKmwAxXrcxU/gFKUuT0iaAvr2JC6xmt97m8k6eK VLFjPvEnb2Xb0oL4ZsvUmi7rYc/EIFrqdW+vXGDjnyoNF4hIEthjR/LxgoETtsiZKMYU cnLF3GEjrFsdGS8ORAT8tYh2RNMMsmGwSqA8IsNDyX/sQXyf9CeHquQXjwFp9Y0osvVr dCRA== X-Gm-Message-State: APjAAAVRgq/wQAyvZOw2zhiKm/2cnBC53FImHGKxCSQzX5cuveKFEHGI rewyaerL/1T2bxR0D7qqw6RdA4GyJyk= X-Received: by 2002:aa7:90d4:: with SMTP id k20mr2243254pfk.78.1563974283397; Wed, 24 Jul 2019 06:18:03 -0700 (PDT) Received: from suzukaze.ipads-lab.se.sjtu.edu.cn ([89.31.126.54]) by smtp.gmail.com with ESMTPSA id p187sm71011976pfg.89.2019.07.24.06.18.01 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 24 Jul 2019 06:18:02 -0700 (PDT) From: Chuhong Yuan Cc: Greg Kroah-Hartman , Jiri Slaby , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Chuhong Yuan Subject: [PATCH] serial: 8250: Use dev_get_drvdata where possible Date: Wed, 24 Jul 2019 21:17:58 +0800 Message-Id: <20190724131758.1764-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/tty/serial/8250/8250_exar.c | 3 +-- drivers/tty/serial/8250/8250_pci.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/8250/8250_exar.c b/drivers/tty/serial/8250/8250_exar.c index edd6dfe055bf..03b347afd46c 100644 --- a/drivers/tty/serial/8250/8250_exar.c +++ b/drivers/tty/serial/8250/8250_exar.c @@ -561,8 +561,7 @@ static int __maybe_unused exar_suspend(struct device *dev) static int __maybe_unused exar_resume(struct device *dev) { - struct pci_dev *pcidev = to_pci_dev(dev); - struct exar8250 *priv = pci_get_drvdata(pcidev); + struct exar8250 *priv = dev_get_drvdata(dev); unsigned int i; for (i = 0; i < priv->nr; i++) diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c index 7f740b37700b..b714d8d0e161 100644 --- a/drivers/tty/serial/8250/8250_pci.c +++ b/drivers/tty/serial/8250/8250_pci.c @@ -3859,8 +3859,7 @@ static void pciserial_remove_one(struct pci_dev *dev) #ifdef CONFIG_PM_SLEEP static int pciserial_suspend_one(struct device *dev) { - struct pci_dev *pdev = to_pci_dev(dev); - struct serial_private *priv = pci_get_drvdata(pdev); + struct serial_private *priv = dev_get_drvdata(dev); if (priv) pciserial_suspend_ports(priv); -- 2.20.1