Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp8421339ybi; Tue, 23 Jul 2019 08:15:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqw/7PDQMyKMjY1Bf7EVQlozBG5sG8BkeaI0eQQYf2tuSUUWlUC0+di33xLWXs2QiOF/NxdS X-Received: by 2002:a17:902:7083:: with SMTP id z3mr41880993plk.278.1563894951530; Tue, 23 Jul 2019 08:15:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563894951; cv=none; d=google.com; s=arc-20160816; b=0LTLSXimvTdlZgJuwYP40fh96JJhqn4mo8cUyEl3cKEvF8mUjpnouhlir1h2Qb0l8W tc/thYOqM4Z3nu0fcOlo4QRIPtB50y1P6XGb4VOWnMcnYvESN3+nmDf87EOlJMYPG5ly X5dnZacZE+oPO7ICe9GD5bBYYFReVg7OOJy9UlVc/2mRf9fl6+TjhvwzV5OXddQOfygE yM4J/EFuP//pvaOaD9y4jO9eSiYnevnlLtCtZSEdR/MHjo1BMy2JAdMWwEJ8du6s+f0H ZdiRpv7b+6qivjijpvL3rpCk64/zdd4z874ceI3jmJ2VSZxe93SazM0h0WcURdQgzIr6 T1dg== 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=obZilEP52opY5jpftYWjHMQed1ZMJ+r+EMQoImR6PmE=; b=nRU97za7g00odNj2xMO9yufF2PX9EP6n2zQ+2tV3XqpzTqx8HwkaPinnyJ04DHDKId r4MHBTJIn/KXiojSL0SbOLfe6Msn3jmMWF0qL5qtH9gKcFD+1KyxRJKJnbVJf2+9ZyhC CVmVt1C0wO37u0LwjIBE50evzYJQAaoG/wSUSbD5zTNiT3Bx1D2npOEGzpZo6jAhnMbS XHBcnU7emMABSK3uJ1K060zFBNEtlpsoauEN+/gOBuxMA8Deq49iHrQrUuhFasbgNyA9 kNo9NI2auQ9SJUZgtqmr1ZNx63BcoEmDGYq/j6VJ5S0my/hsd6gdh9BrC6+jEZYD316w ZYrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=RFrpPA5r; 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 u137si11300246pgc.349.2019.07.23.08.15.35; Tue, 23 Jul 2019 08:15:51 -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=RFrpPA5r; 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 S1731987AbfGWINm (ORCPT + 99 others); Tue, 23 Jul 2019 04:13:42 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:39721 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726405AbfGWINm (ORCPT ); Tue, 23 Jul 2019 04:13:42 -0400 Received: by mail-pl1-f195.google.com with SMTP id b7so20337507pls.6; Tue, 23 Jul 2019 01:13:42 -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=obZilEP52opY5jpftYWjHMQed1ZMJ+r+EMQoImR6PmE=; b=RFrpPA5rPbTn78xatZKRi/cfsqcVUj18wS/s40wian+qMNKWu/6D4EQvS98x0FoQT/ siF3Bx7TVHMII85anle2of2nHe9ASQDbsO3egvG8Xuj0WpUPseDlBzK0m/DdWSmtsHI5 1vJ/tJOGzEofMMam+kdnorI4u2x0B57/gVaf4VoC8HMJno494F5XvTZPWdJIhLxHANVJ +sA6g8n60kR/KZLIlwFQh09RnfQWWcRbnfrkK2SCa8Z7zUjtL0xBS2ZKCLEFcP64PdNH ENXldH2ccLGuMqIqn/vVqcXPZE+dxHSoV6cfH71Csaijxq+yZldsfoFc1StMT5jdfzOm b9Mg== 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=obZilEP52opY5jpftYWjHMQed1ZMJ+r+EMQoImR6PmE=; b=c7KN+GT02vs/hHh4oA8T6ALoPnsBnvseIouKj1nUuKX7LmG8VXYNOkjmsuykzZ7ly+ CfhunP0c4upzK7ncW1ph5zvxYS51QNpXvzJt1UGJs73TUpNxFrTIzBS2vywhGKo/0hhq 3S983uDiW8vrbCPBfRdpAGcF7D7CJYJgxBbSpOpZkpcsnA+e70efebzq3+6Yv0m9lbmU dLpWvK3ZICix7KPqp8Jtw46hSaaD87k/V9g0D4tQD6AJxghj6U5i5SQ4D3qsP7v6efD/ VhapYRvCltKvCTK0CzWiVeZQGUzAzXtD0WEIxD6+zOv9eavxpXGzB5ZMqJOzevssimbI 4LLQ== X-Gm-Message-State: APjAAAXyzjdPQVwqga7W8vhd7FlBCIyvZAQ59T+oK8MkcJcQJ0pp4Tzx 1JMxeujxL9NaGAm+IhkNgeY= X-Received: by 2002:a17:902:1e2:: with SMTP id b89mr81314288plb.7.1563869621920; Tue, 23 Jul 2019 01:13:41 -0700 (PDT) Received: from suzukaze.ipads-lab.se.sjtu.edu.cn ([89.31.126.54]) by smtp.gmail.com with ESMTPSA id k64sm22913758pge.65.2019.07.23.01.13.39 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 23 Jul 2019 01:13:41 -0700 (PDT) From: Chuhong Yuan Cc: Chas Williams <3chas3@gmail.com>, linux-atm-general@lists.sourceforge.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Chuhong Yuan Subject: [PATCH] atm: Use dev_get_drvdata Date: Tue, 23 Jul 2019 16:13:14 +0800 Message-Id: <20190723081313.18552-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/atm/solos-pci.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/atm/solos-pci.c b/drivers/atm/solos-pci.c index 5c4c6eeb505c..c32f7dd9879a 100644 --- a/drivers/atm/solos-pci.c +++ b/drivers/atm/solos-pci.c @@ -516,9 +516,8 @@ struct geos_gpio_attr { static ssize_t geos_gpio_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { - struct pci_dev *pdev = to_pci_dev(dev); struct geos_gpio_attr *gattr = container_of(attr, struct geos_gpio_attr, attr); - struct solos_card *card = pci_get_drvdata(pdev); + struct solos_card *card = dev_get_drvdata(dev); uint32_t data32; if (count != 1 && (count != 2 || buf[1] != '\n')) @@ -542,9 +541,8 @@ static ssize_t geos_gpio_store(struct device *dev, struct device_attribute *attr static ssize_t geos_gpio_show(struct device *dev, struct device_attribute *attr, char *buf) { - struct pci_dev *pdev = to_pci_dev(dev); struct geos_gpio_attr *gattr = container_of(attr, struct geos_gpio_attr, attr); - struct solos_card *card = pci_get_drvdata(pdev); + struct solos_card *card = dev_get_drvdata(dev); uint32_t data32; data32 = ioread32(card->config_regs + GPIO_STATUS); @@ -556,9 +554,8 @@ static ssize_t geos_gpio_show(struct device *dev, struct device_attribute *attr, static ssize_t hardware_show(struct device *dev, struct device_attribute *attr, char *buf) { - struct pci_dev *pdev = to_pci_dev(dev); struct geos_gpio_attr *gattr = container_of(attr, struct geos_gpio_attr, attr); - struct solos_card *card = pci_get_drvdata(pdev); + struct solos_card *card = dev_get_drvdata(dev); uint32_t data32; data32 = ioread32(card->config_regs + GPIO_STATUS); -- 2.20.1