PCI: Use kobj_to_dev() instead of open-coding it
[sfrench/cifs-2.6.git] / drivers / pci / pci-label.c
index 024b5c179348e26f062a2becab6896c260e26a06..0ae74d96ed8577b5980484f0c0c9ecbea1e60c84 100644 (file)
@@ -77,7 +77,7 @@ static umode_t smbios_instance_string_exist(struct kobject *kobj,
        struct device *dev;
        struct pci_dev *pdev;
 
-       dev = container_of(kobj, struct device, kobj);
+       dev = kobj_to_dev(kobj);
        pdev = to_pci_dev(dev);
 
        return find_smbios_instance_string(pdev, NULL, SMBIOS_ATTR_NONE) ?
@@ -221,7 +221,7 @@ static umode_t acpi_index_string_exist(struct kobject *kobj,
 {
        struct device *dev;
 
-       dev = container_of(kobj, struct device, kobj);
+       dev = kobj_to_dev(kobj);
 
        if (device_has_dsm(dev))
                return S_IRUGO;