summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChuhong Yuan <hslester96@gmail.com>2019-07-23 04:13:14 -0400
committerDavid S. Miller <davem@davemloft.net>2019-07-23 16:02:41 -0400
commitc349c0a28326c98ca145b59e0f7ba69e4eef3b80 (patch)
treeff1bf4b8d0b6cadd7cd45b998d68da8abe846fb1
parent084323f62b0b976c9fd931d86c5d2553af5eb9f7 (diff)
atm: Use dev_get_drvdata
Instead of using to_pci_dev + pci_get_drvdata, use dev_get_drvdata to make code simpler. Signed-off-by: Chuhong Yuan <hslester96@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/atm/solos-pci.c9
1 files 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 {
516static ssize_t geos_gpio_store(struct device *dev, struct device_attribute *attr, 516static ssize_t geos_gpio_store(struct device *dev, struct device_attribute *attr,
517 const char *buf, size_t count) 517 const char *buf, size_t count)
518{ 518{
519 struct pci_dev *pdev = to_pci_dev(dev);
520 struct geos_gpio_attr *gattr = container_of(attr, struct geos_gpio_attr, attr); 519 struct geos_gpio_attr *gattr = container_of(attr, struct geos_gpio_attr, attr);
521 struct solos_card *card = pci_get_drvdata(pdev); 520 struct solos_card *card = dev_get_drvdata(dev);
522 uint32_t data32; 521 uint32_t data32;
523 522
524 if (count != 1 && (count != 2 || buf[1] != '\n')) 523 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
542static ssize_t geos_gpio_show(struct device *dev, struct device_attribute *attr, 541static ssize_t geos_gpio_show(struct device *dev, struct device_attribute *attr,
543 char *buf) 542 char *buf)
544{ 543{
545 struct pci_dev *pdev = to_pci_dev(dev);
546 struct geos_gpio_attr *gattr = container_of(attr, struct geos_gpio_attr, attr); 544 struct geos_gpio_attr *gattr = container_of(attr, struct geos_gpio_attr, attr);
547 struct solos_card *card = pci_get_drvdata(pdev); 545 struct solos_card *card = dev_get_drvdata(dev);
548 uint32_t data32; 546 uint32_t data32;
549 547
550 data32 = ioread32(card->config_regs + GPIO_STATUS); 548 data32 = ioread32(card->config_regs + GPIO_STATUS);
@@ -556,9 +554,8 @@ static ssize_t geos_gpio_show(struct device *dev, struct device_attribute *attr,
556static ssize_t hardware_show(struct device *dev, struct device_attribute *attr, 554static ssize_t hardware_show(struct device *dev, struct device_attribute *attr,
557 char *buf) 555 char *buf)
558{ 556{
559 struct pci_dev *pdev = to_pci_dev(dev);
560 struct geos_gpio_attr *gattr = container_of(attr, struct geos_gpio_attr, attr); 557 struct geos_gpio_attr *gattr = container_of(attr, struct geos_gpio_attr, attr);
561 struct solos_card *card = pci_get_drvdata(pdev); 558 struct solos_card *card = dev_get_drvdata(dev);
562 uint32_t data32; 559 uint32_t data32;
563 560
564 data32 = ioread32(card->config_regs + GPIO_STATUS); 561 data32 = ioread32(card->config_regs + GPIO_STATUS);