Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp8791722ybi; Tue, 23 Jul 2019 15:20:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqxbGQeDDVy6+YJNc+5aOqV885vpRbqupI4AGxYne5WgbiN7lSI/HRuFYVJn+LMAYCp0Bccu X-Received: by 2002:a62:ab18:: with SMTP id p24mr7993637pff.113.1563920440725; Tue, 23 Jul 2019 15:20:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563920440; cv=none; d=google.com; s=arc-20160816; b=BlCZFRkCiDlifnWCmFo8tDmiaI11Qfe19aJeDHG8XIzdVIXb1MycaPBOPxKvAhMjen LXMRZqpzbovgz07vSMFbDu2aCvYCC9S53B/3FsTGcIfaKc3rdDIkiqkvGoRh6c+YLrjB JyzfXDA/WcYBEdqSQ9H5M24aCs3JYUv+BmbydIMCcc9KVj/LROeH6pY4JTydHjrNcElR sIa4BaeOvh9F9lOSUde6PUQEB9d0n7NK8y0LLufGOy5lTyqNubi6zFRB155XgMGZc8ON d3AcsLrpDjfnHXreQXzgyupPxx6dGOzpQk3OdF5QuQZxZe+fKGildnvMgrJGuAxm5wj8 2+/A== 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=DBge7YjElO6QELDaAyXNwqPgMlSt8RrUe6yJAAvRsBQ=; b=ggDio+DvwR4T9icCoPo9uDT2CzoTOf160wyak0DFMw0voxHW6lY41sWjSZ6Fym8ww1 YuOz5bxyalg9HSXSIRF0y1DFEoXGZz7paJq5YZ3tDexwI6kXC5LQvEHxClqeWgwHPF5u Wv8W7SovrIJukHkMfFxHHW8jIMjxhV3o4k7Ni3H8TsAca4OWoahwRc6zSqwXh08BDvw2 0uCT9ToJvW2TH6270a4TACGiJGJ2T1599Fg4jyNX2CIKRhBatzXGjEA2wt36g5VJwogK NSROkHz+Ipiwu5Jc+gX1s1ySMLpGGHF5SHtXFXU/m7DoLC9EV0mqoEqksZ6rlLbJRQzn 2ybA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=Fnk4GPD9; 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 v62si16452949pgv.126.2019.07.23.15.20.24; Tue, 23 Jul 2019 15:20: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=Fnk4GPD9; 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 S2387741AbfGWLuu (ORCPT + 99 others); Tue, 23 Jul 2019 07:50:50 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:41995 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730670AbfGWLuu (ORCPT ); Tue, 23 Jul 2019 07:50:50 -0400 Received: by mail-pg1-f196.google.com with SMTP id t132so19306066pgb.9; Tue, 23 Jul 2019 04:50:50 -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=DBge7YjElO6QELDaAyXNwqPgMlSt8RrUe6yJAAvRsBQ=; b=Fnk4GPD9ipYpd5G/f19UTtdckAVmhl7eF3OHln9LtlUnXrUu2/jxGWUjLAzQmExSpG bcaurTnk/OtFq6bRq6UZ0ucc0zkcabTy0TyiWsNYf/FcmFFVmtUbtqp6ouigLf6PgoDF JjpBRJ2d+DfY3vZK1lR5qtbDF/O6PKEFzdWwHBfD56I35umqUTJzxcK42rMI1xyM2JFd m1WnXSDikxe2CIf+XxAslD+CI4JuD4sjpWKP0B31Vh0Qfm03/542BbVjEZeDzJiWGs5v sZLA+XUet1HAFuaipHqKnXpgRUuMoVT+oJz1spVvVs48ItLX7r+JqM4zEcaBG6sb25PQ cYdA== 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=DBge7YjElO6QELDaAyXNwqPgMlSt8RrUe6yJAAvRsBQ=; b=mnCexmY9QOxI1QOAse1BPLh4rmsjTiRohpkgGJhXJlBS6Ts3LpoHeEA28YJ5FITE33 wwIk/iovlfnjnG+/XjjiNWFeJ2PSydrtBg8V1vEr/Uso3au4s3g6fBhE9/BylkuhwA7l BgD6OuDhtVetX1eEyS4P0z+EIqLt74qIqJ70fgL3aokBMaVmHY/2gkLCEykYs3rNoYHY K2Ss63ZEY3jJqnGotYVEdhxbvvLsBE8ZZJwuvCuxtg2pvf4BTHIYRtwuZFRaI+1AemTx oeOIBCOmr6m2j5FUavbv1Ed8E6vdipYJiPsf6Mdg+XyTeZJZIeRpKhEnzHJAf5ijBCHq Nymw== X-Gm-Message-State: APjAAAW96t0yU5NMoleNIVX1w4eJvh4ZYZE4XqXi7cVooY2ISYndZjdE 1I1hWjwJy6IEz3ghiZ7fS6E= X-Received: by 2002:a62:14c4:: with SMTP id 187mr5260749pfu.241.1563882649787; Tue, 23 Jul 2019 04:50:49 -0700 (PDT) Received: from suzukaze.ipads-lab.se.sjtu.edu.cn ([89.31.126.54]) by smtp.gmail.com with ESMTPSA id k6sm51991430pfi.12.2019.07.23.04.50.47 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 23 Jul 2019 04:50:49 -0700 (PDT) From: Chuhong Yuan Cc: Maxim Levitsky , Alex Dubov , Ulf Hansson , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Chuhong Yuan Subject: [PATCH] memstick: r592: Use dev_get_drvdata Date: Tue, 23 Jul 2019 19:50:44 +0800 Message-Id: <20190723115044.18591-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/memstick/host/r592.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/memstick/host/r592.c b/drivers/memstick/host/r592.c index 2932f421b3ea..dd3a1f3dcc19 100644 --- a/drivers/memstick/host/r592.c +++ b/drivers/memstick/host/r592.c @@ -847,8 +847,7 @@ static void r592_remove(struct pci_dev *pdev) #ifdef CONFIG_PM_SLEEP static int r592_suspend(struct device *core_dev) { - struct pci_dev *pdev = to_pci_dev(core_dev); - struct r592_device *dev = pci_get_drvdata(pdev); + struct r592_device *dev = dev_get_drvdata(core_dev); r592_clear_interrupts(dev); memstick_suspend_host(dev->host); @@ -858,8 +857,7 @@ static int r592_suspend(struct device *core_dev) static int r592_resume(struct device *core_dev) { - struct pci_dev *pdev = to_pci_dev(core_dev); - struct r592_device *dev = pci_get_drvdata(pdev); + struct r592_device *dev = dev_get_drvdata(core_dev); r592_clear_interrupts(dev); r592_enable_device(dev, false); -- 2.20.1