Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp8829331ybi; Tue, 23 Jul 2019 16:12:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqyvjxJFo+UN3G6/gQOS/52U1/DlGhLNIHQ8Y3HZY0F5Ku/DQ/VyvIx8lUDVUYEnLdfTcsE5 X-Received: by 2002:a63:ee0c:: with SMTP id e12mr79670442pgi.184.1563923536989; Tue, 23 Jul 2019 16:12:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563923536; cv=none; d=google.com; s=arc-20160816; b=yO2u+0eSWYQIjevK3Qv/sg+zK1gZpXRpnCHEWmiO9BxcSrUpp72qHFY3n36D0Y+QmT yG7Ks3dGCyX5y0e3XQdBb0R3VNh2Q9x+QmgThwTluRsQTX/F9IZnldHhraQa/F7Qp80A fKqmr1wvCsghRLmIzr+6l+xgoHfLZA+4SNvXINhTmTae0jA+bEHk9NVAS5VcKrg98yAs XtMjXgWMsQU4CnjgHLhFj60OPPB4hKCiNdEyzqIXOx/tYwBf4jN7FpL/mlgU5QK7DVU5 NH5l5S7BqgIjtoKUz9iKj4Ek2jGQ8UyeTevxnG1deWhta1sA9JtUVqj0AiJBxi7/vkCk qERw== 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=3W2vUCM0wvNgzTeL3WR1yMUrLTtodWyEHuD05I9UfiE=; b=AVaoZAQBpeDdNBVGfLgzp+2cODrxpUC5s2iqRgjbuG1m9mPgqTg4jruOgjpjIeMv0J p9Pyd0rHgPQAgod+QI4hiNoSZtm7Bf6KWwJ0xJIVXC5IE2BzaQT33c7Z+zpTn9j0GcA5 jaRZ/k4+ovHXxW5pENMfRBaZsiwohQtrcaeqg2kzU8O+EQe1k2Lcrosm5ODt2cYngAs+ OYCyOdfe5cywmjcFYJHt7kkH0CIp+IR9TY4FmHyiVksoMSpoSNEvYRRd6UU4g2FDIiH1 kEpVi4OX2gzDeJ7BzKkEY9Jk/TKOcGI4J4DJA/ysupRmD78gPobGd97u8O1x1HjyFHMB IZYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=bblXs8Ir; 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 f5si12506265pgk.184.2019.07.23.16.12.01; Tue, 23 Jul 2019 16:12:16 -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=bblXs8Ir; 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 S2389765AbfGWMqz (ORCPT + 99 others); Tue, 23 Jul 2019 08:46:55 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:37589 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727724AbfGWMqy (ORCPT ); Tue, 23 Jul 2019 08:46:54 -0400 Received: by mail-pf1-f194.google.com with SMTP id 19so19099822pfa.4 for ; Tue, 23 Jul 2019 05:46: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=3W2vUCM0wvNgzTeL3WR1yMUrLTtodWyEHuD05I9UfiE=; b=bblXs8Iryxe4c9QnYmHEWzU0wgtJEPjhtXzTIT05gFLVDkuqYn06uMXR2zZDNmHm51 ziiq8BqH4W39jL+XXl/3e1IXB2Hnq/DV7/IAmZ22UouIDHQuV7YmM5g7ArwLxo174Ap6 R5U9THVfkBrBycrrpc9hlyotyPe+HI7kcUEbd21WVmgM4ZwIW2tJp27WTJX7/o8uuB8t 9NOgOShWkv31HN1DjAGEGTIQ8WNUUSg7pUxo4gv0ngcH6oTqCZhBZzklv732CFrMjn7H 7tRDDwd9QgQmBiLJ4GCHIVM7dfMJmK9fOUk563eKrFipd0IGgQiOXo7swuuzNFIfFcJf 8eoQ== 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=3W2vUCM0wvNgzTeL3WR1yMUrLTtodWyEHuD05I9UfiE=; b=lkiOVK2E/hBSAWh5fTh8RRL+MsqE4bBcbEL9smQISm/SnVQg7aiH8jP6UgIhox2YiA hddJb82FQbkO0Cj7WDxK54IK24pm4TgCTPCV4it6pSFj/mHj51+v8kIBwolMXGDi9Mz0 VEfmnkvtkEjbNZ93qPtXLHsrfRQPz0hHwHX/6Pnw+0PeYX0+7o8bnxBVb5QjSsWvBGzP KY8xvTyjglvATv6cYf+9k00SbJ0LQdkLGd7glBXbmmPfDD47OhqblLvKA8Fqkkz5NwEd PuNNGDE7jGxlsyz7EfzPbK0bPwkTy6MVuOJTrqkMyyTO/v8jNEjay8uoTM9NcIpPDCS6 denA== X-Gm-Message-State: APjAAAW4BDHg0TV8WU+9hmIjBAZwR/j3chFC+Js/EoapQjC7EWdiAFdT g0ZhvI3w3RPesHaDZFjvObtTVAp7hok= X-Received: by 2002:aa7:8641:: with SMTP id a1mr5631326pfo.177.1563886014151; Tue, 23 Jul 2019 05:46:54 -0700 (PDT) Received: from suzukaze.ipads-lab.se.sjtu.edu.cn ([89.31.126.54]) by smtp.gmail.com with ESMTPSA id o11sm72746953pfh.114.2019.07.23.05.46.52 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 23 Jul 2019 05:46:53 -0700 (PDT) From: Chuhong Yuan Cc: Arnd Bergmann , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Chuhong Yuan Subject: [PATCH v2] misc: alcor_pci: Use dev_get_drvdata Date: Tue, 23 Jul 2019 20:46:49 +0800 Message-Id: <20190723124649.24728-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 --- Changes in v2: - Split v1 into different subsystems drivers/misc/cardreader/alcor_pci.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/misc/cardreader/alcor_pci.c b/drivers/misc/cardreader/alcor_pci.c index bcb10fa4bc3a..259fe1dfec03 100644 --- a/drivers/misc/cardreader/alcor_pci.c +++ b/drivers/misc/cardreader/alcor_pci.c @@ -334,8 +334,7 @@ static void alcor_pci_remove(struct pci_dev *pdev) #ifdef CONFIG_PM_SLEEP static int alcor_suspend(struct device *dev) { - struct pci_dev *pdev = to_pci_dev(dev); - struct alcor_pci_priv *priv = pci_get_drvdata(pdev); + struct alcor_pci_priv *priv = dev_get_drvdata(dev); alcor_pci_aspm_ctrl(priv, 1); return 0; @@ -344,8 +343,7 @@ static int alcor_suspend(struct device *dev) static int alcor_resume(struct device *dev) { - struct pci_dev *pdev = to_pci_dev(dev); - struct alcor_pci_priv *priv = pci_get_drvdata(pdev); + struct alcor_pci_priv *priv = dev_get_drvdata(dev); alcor_pci_aspm_ctrl(priv, 0); return 0; -- 2.20.1