Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Bluetooth: Remove controller device attributes

The controller device attributes are not used and expose no valuable
information.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>

authored by

Marcel Holtmann and committed by
Johan Hedberg
e14dbe72 2a0be139

-54
-54
net/bluetooth/hci_sysfs.c
··· 79 79 hci_dev_put(hdev); 80 80 } 81 81 82 - static inline char *host_typetostr(int type) 83 - { 84 - switch (type) { 85 - case HCI_BREDR: 86 - return "BR/EDR"; 87 - case HCI_AMP: 88 - return "AMP"; 89 - default: 90 - return "UNKNOWN"; 91 - } 92 - } 93 - 94 - static ssize_t show_type(struct device *dev, 95 - struct device_attribute *attr, char *buf) 96 - { 97 - struct hci_dev *hdev = to_hci_dev(dev); 98 - return sprintf(buf, "%s\n", host_typetostr(hdev->dev_type)); 99 - } 100 - 101 - static ssize_t show_name(struct device *dev, 102 - struct device_attribute *attr, char *buf) 103 - { 104 - struct hci_dev *hdev = to_hci_dev(dev); 105 - char name[HCI_MAX_NAME_LENGTH + 1]; 106 - int i; 107 - 108 - for (i = 0; i < HCI_MAX_NAME_LENGTH; i++) 109 - name[i] = hdev->dev_name[i]; 110 - 111 - name[HCI_MAX_NAME_LENGTH] = '\0'; 112 - return sprintf(buf, "%s\n", name); 113 - } 114 - 115 - static ssize_t show_address(struct device *dev, 116 - struct device_attribute *attr, char *buf) 117 - { 118 - struct hci_dev *hdev = to_hci_dev(dev); 119 - return sprintf(buf, "%pMR\n", &hdev->bdaddr); 120 - } 121 - 122 - static DEVICE_ATTR(type, S_IRUGO, show_type, NULL); 123 - static DEVICE_ATTR(name, S_IRUGO, show_name, NULL); 124 - static DEVICE_ATTR(address, S_IRUGO, show_address, NULL); 125 - 126 - static struct attribute *bt_host_attrs[] = { 127 - &dev_attr_type.attr, 128 - &dev_attr_name.attr, 129 - &dev_attr_address.attr, 130 - NULL 131 - }; 132 - 133 - ATTRIBUTE_GROUPS(bt_host); 134 - 135 82 static void bt_host_release(struct device *dev) 136 83 { 137 84 struct hci_dev *hdev = to_hci_dev(dev); ··· 88 141 89 142 static struct device_type bt_host = { 90 143 .name = "host", 91 - .groups = bt_host_groups, 92 144 .release = bt_host_release, 93 145 }; 94 146