Skip to content

Commit 96ace55

Browse files
Hsin-chen ChuangVudentz
authored andcommitted
Revert "Bluetooth: btusb: add sysfs attribute to control USB alt setting"
This reverts commit b16b327. The sysfs node introduced by this patch could potentially race with user space. The original motivation - Support configuring altsetting from the user space will be added by another series. Cc: chromeos-bluetooth-upstreaming@chromium.org Signed-off-by: Hsin-chen Chuang <chharry@chromium.org> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
1 parent f330734 commit 96ace55

File tree

1 file changed

+1
-33
lines changed

1 file changed

+1
-33
lines changed

drivers/bluetooth/btusb.c

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3734,32 +3734,6 @@ static const struct file_operations force_poll_sync_fops = {
37343734
.llseek = default_llseek,
37353735
};
37363736

3737-
static ssize_t isoc_alt_show(struct device *dev,
3738-
struct device_attribute *attr,
3739-
char *buf)
3740-
{
3741-
struct btusb_data *data = dev_get_drvdata(dev);
3742-
3743-
return sysfs_emit(buf, "%d\n", data->isoc_altsetting);
3744-
}
3745-
3746-
static ssize_t isoc_alt_store(struct device *dev,
3747-
struct device_attribute *attr,
3748-
const char *buf, size_t count)
3749-
{
3750-
struct btusb_data *data = dev_get_drvdata(dev);
3751-
int alt;
3752-
int ret;
3753-
3754-
if (kstrtoint(buf, 10, &alt))
3755-
return -EINVAL;
3756-
3757-
ret = btusb_switch_alt_setting(data->hdev, alt);
3758-
return ret < 0 ? ret : count;
3759-
}
3760-
3761-
static DEVICE_ATTR_RW(isoc_alt);
3762-
37633737
#define BTUSB_HCI_DRV_OP_SUPPORTED_ALTSETTINGS \
37643738
hci_opcode_pack(HCI_DRV_OGF_DRIVER_SPECIFIC, 0x0000)
37653739
#define BTUSB_HCI_DRV_SUPPORTED_ALTSETTINGS_SIZE 0
@@ -4252,10 +4226,6 @@ static int btusb_probe(struct usb_interface *intf,
42524226
data->isoc, data);
42534227
if (err < 0)
42544228
goto out_free_dev;
4255-
4256-
err = device_create_file(&intf->dev, &dev_attr_isoc_alt);
4257-
if (err)
4258-
goto out_free_dev;
42594229
}
42604230

42614231
if (IS_ENABLED(CONFIG_BT_HCIBTUSB_BCM) && data->diag) {
@@ -4302,10 +4272,8 @@ static void btusb_disconnect(struct usb_interface *intf)
43024272
hdev = data->hdev;
43034273
usb_set_intfdata(data->intf, NULL);
43044274

4305-
if (data->isoc) {
4306-
device_remove_file(&intf->dev, &dev_attr_isoc_alt);
4275+
if (data->isoc)
43074276
usb_set_intfdata(data->isoc, NULL);
4308-
}
43094277

43104278
if (data->diag)
43114279
usb_set_intfdata(data->diag, NULL);

0 commit comments

Comments
 (0)