Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9457184ybi; Wed, 24 Jul 2019 04:29:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqz++rO8gz8LUiMKbiqxT/rnsouEh3hqJ58DT8Na6RNDZARkHen/GNkAnuNR/ckBAfPK58qb X-Received: by 2002:a17:90a:8a91:: with SMTP id x17mr87566969pjn.95.1563967754713; Wed, 24 Jul 2019 04:29:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563967754; cv=none; d=google.com; s=arc-20160816; b=Fz36Gy8ZN86LCdzkdbJdvbi6tm2LPs3M5wbiIrH95LbmLpsQeMSVt1GKlrcv8k6Knh Ns4GourL0FXTpIbrjcgVBuGJlVFtsgFsUnY/LkaIWWKmYwMecD90xow7+CiMbkTEHaGA LO3wgQnX7jgzu+fhjufukGN7lCzGt6a3sQO0ZoolbstSnRgv8kqWHFw8LVFYDDsUnOs0 HHpf6LolQ8hAlqjJNhgtyLErQ8knOiY9h5pgL3ZeFHOocWL037xBJaO/5EkLwvzJkG35 c21SAhPxRdqGNX4U6+XjWCUAZA7id317snCaLsQxbo0GXa/jrRmpYnhV9pfBO7bEPPhu xtuw== 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=Iund/UB9gNsEMyB6ZwMB2lOVuWc9Eufb+ac0l5cR60E=; b=gpQjNEKbK6lW20RwdNNIE3FwfIj/0Q6XKteCq20XVqq0DLDrPZZ3JN0nF6zarbTvBr Cj0qEC/D1a8/j+zEdFLAZvSV8CHfizcqusXyLNEdiwepD4oCTmx2OMR2AhXXQ8co2CxS C+Vzau6wanCfneaS+507Z89GMJ59m8ApRw8l3yePCF58O9Kg0LyUWBLS9H69nHd9h1z7 +RHDazrQveR9z03ffaT+94zZsMm7fV4EKbIANcEmiJeI6ii348fVocZ4wL3YhkxLE3XT cCSp+0Q1HA8m7bz13ZxMNmu8wqlFFWSsxjkYtJCtAbtoWIUX862zLMaaCrzt7o0gHISi ubew== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=at5NcK2s; 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 o9si15106055pfp.158.2019.07.24.04.29.00; Wed, 24 Jul 2019 04:29:14 -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=at5NcK2s; 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 S1727714AbfGXL1x (ORCPT + 99 others); Wed, 24 Jul 2019 07:27:53 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:43694 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727378AbfGXL1w (ORCPT ); Wed, 24 Jul 2019 07:27:52 -0400 Received: by mail-pf1-f196.google.com with SMTP id i189so20808151pfg.10; Wed, 24 Jul 2019 04:27:52 -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=Iund/UB9gNsEMyB6ZwMB2lOVuWc9Eufb+ac0l5cR60E=; b=at5NcK2seyInJhe4u9iZiFKeIfzZQWhTWl+QhvVQcV7D9M//dLJUrKYzGFxjC0HXTi k4nZxcMQbMrdMEsuDie5/nVQhir0mPkiPOCqm+KYVPmhAVw2z0arLEZJBUR8lTgmlXbc kY2cjErIl28ZGU+CcVLQpH0ATIvHRoAuw8dkdemCUpCdN1cwmaojPUsw5/NISm761tzb a5rGOa8w3lqNtW12CHlo0YkMWwEQBRGcFHLTMQP3PAfZKwpI6PksHQ1b3fqBqPf1mg00 7flTBtzDR9yjiXPEziOMiwgECAzhLpJRLU85M2jLM9DrweIx8LS/8MqdS2b2Mnsu9aFZ AuEg== 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=Iund/UB9gNsEMyB6ZwMB2lOVuWc9Eufb+ac0l5cR60E=; b=rPRmI7LLWGAirx8v8+QMjVJ2BTl0OMV9P6TZrIuaMVM9YU6dwInd8Y00DgIalF24ki R/zgs/21KLDBdAfY2kONuSkWz0lJh9o+Y7nxAqtQkx22+qjy1uUff4heTNvbKBOxeWsb 55CDq6KZ8pT3WewTFZVmlR+nCLTfAsg8hWTZqT/jUiVpSJETUwYs6tNoAlW6eNVHl3x4 bt4YXUriDvjpJdPgtR5uyUswaJAiZ2Pjjnr0xyJwOcLryap8Yiyx51+FFbwgjcgAE9uA +AQcWnv/bmOQLVZdqbeUK6GUmj/yi+GLdCTQWIm9W8lmZoPQTnlUbvl0uOaBK7L3i0Ia rvOA== X-Gm-Message-State: APjAAAUkYgIKBSC1AfOxLsUjblsdccbXhBlEFRGLxYUUbxDIdo+a9kGL Oo63n2LTIi7iHXF2RumO3rA= X-Received: by 2002:a17:90a:8c92:: with SMTP id b18mr85600256pjo.97.1563967672272; Wed, 24 Jul 2019 04:27:52 -0700 (PDT) Received: from suzukaze.ipads-lab.se.sjtu.edu.cn ([89.31.126.54]) by smtp.gmail.com with ESMTPSA id x9sm54902521pfn.177.2019.07.24.04.27.48 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 24 Jul 2019 04:27:51 -0700 (PDT) From: Chuhong Yuan Cc: Amitkumar Karwar , Nishant Sarmukadam , Ganapathi Bhat , Xinming Hu , Kalle Valo , "David S . Miller" , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Chuhong Yuan Subject: [PATCH net-next 08/10] mwifiex: pcie: Use dev_get_drvdata Date: Wed, 24 Jul 2019 19:27:45 +0800 Message-Id: <20190724112745.13511-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/net/wireless/marvell/mwifiex/pcie.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.c b/drivers/net/wireless/marvell/mwifiex/pcie.c index b54f73e3d508..eff06d59e9df 100644 --- a/drivers/net/wireless/marvell/mwifiex/pcie.c +++ b/drivers/net/wireless/marvell/mwifiex/pcie.c @@ -150,10 +150,8 @@ static bool mwifiex_pcie_ok_to_access_hw(struct mwifiex_adapter *adapter) static int mwifiex_pcie_suspend(struct device *dev) { struct mwifiex_adapter *adapter; - struct pcie_service_card *card; - struct pci_dev *pdev = to_pci_dev(dev); + struct pcie_service_card *card = dev_get_drvdata(dev); - card = pci_get_drvdata(pdev); /* Might still be loading firmware */ wait_for_completion(&card->fw_done); @@ -195,10 +193,8 @@ static int mwifiex_pcie_suspend(struct device *dev) static int mwifiex_pcie_resume(struct device *dev) { struct mwifiex_adapter *adapter; - struct pcie_service_card *card; - struct pci_dev *pdev = to_pci_dev(dev); + struct pcie_service_card *card = dev_get_drvdata(dev); - card = pci_get_drvdata(pdev); if (!card->adapter) { dev_err(dev, "adapter structure is not valid\n"); -- 2.20.1