Skip to content

Commit f1d7f0c

Browse files
committed
Revert "Bluetooth: btusb: add sysfs attribute to control USB alt setting"
JIRA: https://issues.redhat.com/browse/RHEL-93657 commit 96ace55 Author: Hsin-chen Chuang <chharry@chromium.org> Date: Wed Apr 16 09:53:38 2025 +0000 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> Signed-off-by: David Marlin <dmarlin@redhat.com>
1 parent 860ec31 commit f1d7f0c

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
@@ -3717,32 +3717,6 @@ static const struct file_operations force_poll_sync_fops = {
37173717
.llseek = default_llseek,
37183718
};
37193719

3720-
static ssize_t isoc_alt_show(struct device *dev,
3721-
struct device_attribute *attr,
3722-
char *buf)
3723-
{
3724-
struct btusb_data *data = dev_get_drvdata(dev);
3725-
3726-
return sysfs_emit(buf, "%d\n", data->isoc_altsetting);
3727-
}
3728-
3729-
static ssize_t isoc_alt_store(struct device *dev,
3730-
struct device_attribute *attr,
3731-
const char *buf, size_t count)
3732-
{
3733-
struct btusb_data *data = dev_get_drvdata(dev);
3734-
int alt;
3735-
int ret;
3736-
3737-
if (kstrtoint(buf, 10, &alt))
3738-
return -EINVAL;
3739-
3740-
ret = btusb_switch_alt_setting(data->hdev, alt);
3741-
return ret < 0 ? ret : count;
3742-
}
3743-
3744-
static DEVICE_ATTR_RW(isoc_alt);
3745-
37463720
#define BTUSB_HCI_DRV_OP_SUPPORTED_ALTSETTINGS \
37473721
hci_opcode_pack(HCI_DRV_OGF_DRIVER_SPECIFIC, 0x0000)
37483722
#define BTUSB_HCI_DRV_SUPPORTED_ALTSETTINGS_SIZE 0
@@ -4235,10 +4209,6 @@ static int btusb_probe(struct usb_interface *intf,
42354209
data->isoc, data);
42364210
if (err < 0)
42374211
goto out_free_dev;
4238-
4239-
err = device_create_file(&intf->dev, &dev_attr_isoc_alt);
4240-
if (err)
4241-
goto out_free_dev;
42424212
}
42434213

42444214
if (IS_ENABLED(CONFIG_BT_HCIBTUSB_BCM) && data->diag) {
@@ -4285,10 +4255,8 @@ static void btusb_disconnect(struct usb_interface *intf)
42854255
hdev = data->hdev;
42864256
usb_set_intfdata(data->intf, NULL);
42874257

4288-
if (data->isoc) {
4289-
device_remove_file(&intf->dev, &dev_attr_isoc_alt);
4258+
if (data->isoc)
42904259
usb_set_intfdata(data->isoc, NULL);
4291-
}
42924260

42934261
if (data->diag)
42944262
usb_set_intfdata(data->diag, NULL);

0 commit comments

Comments
 (0)