alpha: use kobj_to_dev()
authorGeliang Tang <geliangtang@163.com>
Wed, 6 Jan 2016 15:35:16 +0000 (23:35 +0800)
committerMatt Turner <mattst88@gmail.com>
Mon, 4 Sep 2017 19:04:33 +0000 (12:04 -0700)
Use kobj_to_dev() instead of open-coding it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
arch/alpha/kernel/pci-sysfs.c

index 652449ebed524f4954b0a580f302732cc5204fb8..cbecd527c696c7a0b508c8e67e54399d8a54c38d 100644 (file)
@@ -64,8 +64,7 @@ static int pci_mmap_resource(struct kobject *kobj,
                             struct bin_attribute *attr,
                             struct vm_area_struct *vma, int sparse)
 {
-       struct pci_dev *pdev = to_pci_dev(container_of(kobj,
-                                                      struct device, kobj));
+       struct pci_dev *pdev = to_pci_dev(kobj_to_dev(kobj));
        struct resource *res = attr->private;
        enum pci_mmap_state mmap_type;
        struct pci_bus_region bar;