From: Hsin-chen Chuang <chharry@google.com>
To: luiz.dentz@gmail.com
Cc: Hsin-chen Chuang <chharry@chromium.org>,
chromeos-bluetooth-upstreaming@chromium.org,
Marcel Holtmann <marcel@holtmann.org>,
linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2 4/4] Revert "Bluetooth: btusb: add sysfs attribute to control USB alt setting"
Date: Wed, 16 Apr 2025 09:53:38 +0000 [thread overview]
Message-ID: <20250416095505.769906-4-chharry@google.com> (raw)
In-Reply-To: <20250416095505.769906-1-chharry@google.com>
From: Hsin-chen Chuang <chharry@chromium.org>
This reverts commit b16b327edb4d030fb4c8fe38c7d299074d47ee3f.
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>
---
(no changes since v1)
drivers/bluetooth/btusb.c | 34 +---------------------------------
1 file changed, 1 insertion(+), 33 deletions(-)
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 937d69684df8..5fa75a777a71 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -3688,32 +3688,6 @@ static const struct file_operations force_poll_sync_fops = {
.llseek = default_llseek,
};
-static ssize_t isoc_alt_show(struct device *dev,
- struct device_attribute *attr,
- char *buf)
-{
- struct btusb_data *data = dev_get_drvdata(dev);
-
- return sysfs_emit(buf, "%d\n", data->isoc_altsetting);
-}
-
-static ssize_t isoc_alt_store(struct device *dev,
- struct device_attribute *attr,
- const char *buf, size_t count)
-{
- struct btusb_data *data = dev_get_drvdata(dev);
- int alt;
- int ret;
-
- if (kstrtoint(buf, 10, &alt))
- return -EINVAL;
-
- ret = btusb_switch_alt_setting(data->hdev, alt);
- return ret < 0 ? ret : count;
-}
-
-static DEVICE_ATTR_RW(isoc_alt);
-
#define BTUSB_HCI_DRV_OP_SUPPORTED_ALTSETTINGS \
hci_opcode_pack(HCI_DRV_OGF_DRIVER_SPECIFIC, 0x0000)
#define BTUSB_HCI_DRV_SUPPORTED_ALTSETTINGS_SIZE 0
@@ -4203,10 +4177,6 @@ static int btusb_probe(struct usb_interface *intf,
data->isoc, data);
if (err < 0)
goto out_free_dev;
-
- err = device_create_file(&intf->dev, &dev_attr_isoc_alt);
- if (err)
- goto out_free_dev;
}
if (IS_ENABLED(CONFIG_BT_HCIBTUSB_BCM) && data->diag) {
@@ -4253,10 +4223,8 @@ static void btusb_disconnect(struct usb_interface *intf)
hdev = data->hdev;
usb_set_intfdata(data->intf, NULL);
- if (data->isoc) {
- device_remove_file(&intf->dev, &dev_attr_isoc_alt);
+ if (data->isoc)
usb_set_intfdata(data->isoc, NULL);
- }
if (data->diag)
usb_set_intfdata(data->diag, NULL);
--
2.49.0.604.gff1f9ca942-goog
next prev parent reply other threads:[~2025-04-16 9:55 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-16 9:53 [PATCH v2 1/4] Bluetooth: Introduce HCI Driver protocol Hsin-chen Chuang
2025-04-16 9:53 ` [PATCH v2 2/4] Bluetooth: btusb: Add HCI Drv commands for configuring altsetting Hsin-chen Chuang
2025-04-16 9:53 ` [PATCH v2 3/4] Revert "Bluetooth: btusb: Configure altsetting for HCI_USER_CHANNEL" Hsin-chen Chuang
2025-04-16 9:53 ` Hsin-chen Chuang [this message]
2025-04-16 10:36 ` [v2,1/4] Bluetooth: Introduce HCI Driver protocol bluez.test.bot
2025-04-16 16:20 ` [PATCH v2 1/4] " patchwork-bot+bluetooth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250416095505.769906-4-chharry@google.com \
--to=chharry@google.com \
--cc=chharry@chromium.org \
--cc=chromeos-bluetooth-upstreaming@chromium.org \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luiz.dentz@gmail.com \
--cc=marcel@holtmann.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox