Lines Matching +refs:sb +refs:id +refs:attrs
106 .attrs = hwmon_dev_attrs,
115 static void hwmon_free_attrs(struct attribute **attrs) in hwmon_free_attrs() argument
119 for (i = 0; attrs[i]; i++) { in hwmon_free_attrs()
120 struct device_attribute *dattr = to_dev_attr(attrs[i]); in hwmon_free_attrs()
125 kfree(attrs); in hwmon_free_attrs()
132 if (hwdev->group.attrs) in hwmon_dev_release()
133 hwmon_free_attrs(hwdev->group.attrs); in hwmon_dev_release()
689 struct attribute **attrs, in hwmon_genattrs() argument
721 attrs[aindex++] = a; in hwmon_genattrs()
731 struct attribute **attrs; in __hwmon_create_attrs() local
739 attrs = kcalloc(nattrs + 1, sizeof(*attrs), GFP_KERNEL); in __hwmon_create_attrs()
740 if (!attrs) in __hwmon_create_attrs()
744 ret = hwmon_genattrs(drvdata, &attrs[aindex], chip->ops, in __hwmon_create_attrs()
747 hwmon_free_attrs(attrs); in __hwmon_create_attrs()
753 return attrs; in __hwmon_create_attrs()
765 int i, err, id; in __hwmon_device_register() local
773 id = ida_alloc(&hwmon_ida, GFP_KERNEL); in __hwmon_device_register()
774 if (id < 0) in __hwmon_device_register()
775 return ERR_PTR(id); in __hwmon_device_register()
786 struct attribute **attrs; in __hwmon_device_register() local
799 attrs = __hwmon_create_attrs(drvdata, chip); in __hwmon_device_register()
800 if (IS_ERR(attrs)) { in __hwmon_device_register()
801 err = PTR_ERR(attrs); in __hwmon_device_register()
805 hwdev->group.attrs = attrs; in __hwmon_device_register()
839 dev_set_name(hdev, HWMON_ID_FORMAT, id); in __hwmon_device_register()
867 ida_free(&hwmon_ida, id); in __hwmon_device_register()
975 int id; in hwmon_device_unregister() local
977 if (likely(sscanf(dev_name(dev), HWMON_ID_FORMAT, &id) == 1)) { in hwmon_device_unregister()
979 ida_free(&hwmon_ida, id); in hwmon_device_unregister()
1147 struct pci_dev *sb; in hwmon_pci_quirks() local
1152 sb = pci_get_device(PCI_VENDOR_ID_ATI, 0x436c, NULL); in hwmon_pci_quirks()
1153 if (sb) { in hwmon_pci_quirks()
1154 if (sb->subsystem_vendor == 0x1462 && /* MSI */ in hwmon_pci_quirks()
1155 sb->subsystem_device == 0x0031) { /* MS-7031 */ in hwmon_pci_quirks()
1156 pci_read_config_byte(sb, 0x48, &enable); in hwmon_pci_quirks()
1157 pci_read_config_word(sb, 0x64, &base); in hwmon_pci_quirks()
1160 dev_info(&sb->dev, in hwmon_pci_quirks()
1162 pci_write_config_word(sb, 0x64, 0x295); in hwmon_pci_quirks()
1163 pci_write_config_byte(sb, 0x48, in hwmon_pci_quirks()
1167 pci_dev_put(sb); in hwmon_pci_quirks()