Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9165907ybi; Tue, 23 Jul 2019 23:09:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqwqI1PuSKc3XhFUBW14psnFsa8dM/b20f1aALZG4Rt4bLRpkCwIJ+TSmdKt47cIL3+pjJiJ X-Received: by 2002:a62:5252:: with SMTP id g79mr9403562pfb.18.1563948571610; Tue, 23 Jul 2019 23:09:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563948571; cv=none; d=google.com; s=arc-20160816; b=OERVy3Eof/BvLlvNU177lOFD7mI3i+UQf1l9LtYy2A5/edt7k09i6pLKxMOFcS6q1b C5R43pEsOD08YxwCpEvIHYCURgFccSAGpngvhxFF19GSugdi2hKMKqHJJyzNFwKFgBfR 46VNq/jCrN8khS9vf1ItlyuLh3AfnVl5d6vBbX9ZRu5yevVP8vaO2Z/W3RQGBebt4uH2 s843bRMkzPisw5AmK7nqxDM+v016LxH9aym4s8q6ABb8mNLfsfZ8O5jQyed5PaZqAaLu 3TpqkFIFAwBsvm1O4rHp3koddVGIeGZprEg0kabHHPeA0ND+28cNo2SYs0QND/qR2tJl jk+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=3nezsYKelUkWXu/WuGZ4bisaP+vEJX1eIGb2BGpr5fM=; b=Nvwts3LkfF+0vU2A0c56pkOqqzMPfGpO5r7gbkmsGPEi/Onqn2KALXInTpxdZrWtZl Bvl9ytD8ziU48fFNF3V1eG7gzKafzoDpKqtDCtAf8YnGuK2cnbv3hsVCo6Fymg+oMUZ+ ++Vqygfe6Trh+ZWss24IegTTf8FJF5wD2QtN3VODZyD160vGFzMcrvdwiLk5XQCVplYt 2lTqJCAZg68Sx251djIQ875ByBmLn6onB+XrrcjEbwrNntEw5rh+mYCANIOk6jIFY/kX Vpergc8uUD6cmafMkIKIuIgRaNv5FKe/F98h+wJi6if3kGtfq3ph+/J6Q6lh30rN16Er aWGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=KGSRuqNw; 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 j25si12976849pfr.11.2019.07.23.23.09.17; Tue, 23 Jul 2019 23:09:31 -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=KGSRuqNw; 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 S1726663AbfGXGGs (ORCPT + 99 others); Wed, 24 Jul 2019 02:06:48 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:43045 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725900AbfGXGGq (ORCPT ); Wed, 24 Jul 2019 02:06:46 -0400 Received: by mail-pl1-f196.google.com with SMTP id 4so14574395pld.10; Tue, 23 Jul 2019 23:06:46 -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=3nezsYKelUkWXu/WuGZ4bisaP+vEJX1eIGb2BGpr5fM=; b=KGSRuqNwdw3I5D6WthFGXLlumNPsFAdIb9aHb13ZA1o7zMKRfMt8T25tR2bR4KgOxN RWIFoK0UR6eel68uSKRYdtskX4E4J/kaPBAJlaGXQZoPBJgbthKSCx9/KQfanKt0qm/l JjrdPWSo3bveOsvv5V7CkEtJ5Ndr+1OqW+6yvWxD2zwBvkg+kfLpEuTqp41xzNBQnI26 Ab41Bt6iIizdz32iX6MEUZFYzEKGQ23ESOFwaW1HTobW1gGRV/DSqCvSdczN2/iQiVNQ JMgVRHXTfTxIWVuqfK15xpODn7pbuhrHgPgSwtcNMsjNhV2HKAyFVg4aOcszcPMEL+KO EwyA== 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=3nezsYKelUkWXu/WuGZ4bisaP+vEJX1eIGb2BGpr5fM=; b=qi5K2p3e0z3NscwXRPtbhq9C8Uz39Q377Xys/7rVf4DP6Erumm27K3sJcfV0egtfzI 2/+QN5dDzx4deXvzV4dbMnhJFmBq6VwAMbzqoFivcW3KW23lFGTbiD7oQCHt6Mkq5afO 1Jeg5qn23e6+ctW1D+U0I4PYanYikbtl6W7Y/J10ujj+09P0mg17nnfLxiK0YM6ZtX19 SVHzx8SYvC9pY4NPOeCXCmtexiSL/zknK3m5P89CnbZBKPA1dsgx77upi0qBZ1hPJNxr 33l5Yr+ZijGMIN/ukCpFrxVkFX0xP5k/wL5KJ5xfOiHbMXFw0sJ42986YiUCtwE3OM// Cg/w== X-Gm-Message-State: APjAAAXCgLV1jj3ytrGlqA5TtU4N27C044sYQpyBB9wh19pHVno3W50g CaWjE2ntQg134Xs8A4cLgek= X-Received: by 2002:a17:902:2983:: with SMTP id h3mr84740917plb.45.1563948405996; Tue, 23 Jul 2019 23:06:45 -0700 (PDT) Received: from suzukaze.ipads-lab.se.sjtu.edu.cn ([89.31.126.54]) by smtp.gmail.com with ESMTPSA id z63sm11682896pfb.98.2019.07.23.23.06.43 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 23 Jul 2019 23:06:45 -0700 (PDT) From: Chuhong Yuan Cc: Guo-Fu Tseng , "David S . Miller" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Chuhong Yuan Subject: [PATCH net-next v2 8/8] net: jme: Use dev_get_drvdata Date: Wed, 24 Jul 2019 14:06:41 +0800 Message-Id: <20190724060641.24334-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: - Change pci_set_drvdata to dev_set_drvdata to keep consistency. drivers/net/ethernet/jme.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/jme.c b/drivers/net/ethernet/jme.c index 0b668357db4d..6815bd18a477 100644 --- a/drivers/net/ethernet/jme.c +++ b/drivers/net/ethernet/jme.c @@ -3000,7 +3000,7 @@ jme_init_one(struct pci_dev *pdev, netdev->max_mtu = MAX_ETHERNET_JUMBO_PACKET_SIZE - ETH_HLEN; SET_NETDEV_DEV(netdev, &pdev->dev); - pci_set_drvdata(pdev, netdev); + dev_set_drvdata(&pdev->dev, netdev); /* * init adapter info @@ -3193,8 +3193,7 @@ jme_shutdown(struct pci_dev *pdev) static int jme_suspend(struct device *dev) { - struct pci_dev *pdev = to_pci_dev(dev); - struct net_device *netdev = pci_get_drvdata(pdev); + struct net_device *netdev = dev_get_drvdata(dev); struct jme_adapter *jme = netdev_priv(netdev); if (!netif_running(netdev)) @@ -3236,8 +3235,7 @@ jme_suspend(struct device *dev) static int jme_resume(struct device *dev) { - struct pci_dev *pdev = to_pci_dev(dev); - struct net_device *netdev = pci_get_drvdata(pdev); + struct net_device *netdev = dev_get_drvdata(dev); struct jme_adapter *jme = netdev_priv(netdev); if (!netif_running(netdev)) -- 2.20.1