static bool device_has_acpi_name(struct device *dev)
{
#ifdef CONFIG_ACPI
- acpi_handle handle;
+ acpi_handle handle = ACPI_HANDLE(dev);
- handle = ACPI_HANDLE(dev);
if (!handle)
return false;
{
const struct dmi_device *dmi;
struct dmi_dev_onboard *donboard;
- int domain_nr;
- int bus;
- int devfn;
-
- domain_nr = pci_domain_nr(pdev->bus);
- bus = pdev->bus->number;
- devfn = pdev->devfn;
+ int domain_nr = pci_domain_nr(pdev->bus);
+ int bus = pdev->bus->number;
+ int devfn = pdev->devfn;
dmi = NULL;
while ((dmi = dmi_find_device(DMI_DEV_TYPE_DEV_ONBOARD,
static umode_t smbios_attr_is_visible(struct kobject *kobj, struct attribute *a,
int n)
{
- struct device *dev;
- struct pci_dev *pdev;
-
- dev = kobj_to_dev(kobj);
- pdev = to_pci_dev(dev);
+ struct device *dev = kobj_to_dev(kobj);
+ struct pci_dev *pdev = to_pci_dev(dev);
if (device_has_acpi_name(dev))
return 0;
static ssize_t smbios_label_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
- struct pci_dev *pdev;
- pdev = to_pci_dev(dev);
+ struct pci_dev *pdev = to_pci_dev(dev);
return find_smbios_instance_string(pdev, buf,
SMBIOS_ATTR_LABEL_SHOW);
static ssize_t index_show(struct device *dev, struct device_attribute *attr,
char *buf)
{
- struct pci_dev *pdev;
- pdev = to_pci_dev(dev);
+ struct pci_dev *pdev = to_pci_dev(dev);
return find_smbios_instance_string(pdev, buf,
SMBIOS_ATTR_INSTANCE_SHOW);
static int dsm_get_label(struct device *dev, char *buf,
enum acpi_attr_enum attr)
{
- acpi_handle handle;
+ acpi_handle handle = ACPI_HANDLE(dev);
union acpi_object *obj, *tmp;
int len = -1;
- handle = ACPI_HANDLE(dev);
if (!handle)
return -1;
static umode_t acpi_attr_is_visible(struct kobject *kobj, struct attribute *a,
int n)
{
- struct device *dev;
-
- dev = kobj_to_dev(kobj);
+ struct device *dev = kobj_to_dev(kobj);
if (!device_has_acpi_name(dev))
return 0;