summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOatmealDome <OatmealDome@users.noreply.github.com>2025-02-08 01:01:58 -0500
committerGitHub <noreply@github.com>2025-02-08 01:01:58 -0500
commitc770e7c2766155799095d1a1df19f898a2db7bc5 (patch)
treedb4af4d0018e08c9cb8c8877b50f747bd076c095
parentc6be362a8c8f53502ec61b2afa34414e1d5a040e (diff)
parent10e044872d1568af1d536b1b56e27a24f3f211f2 (diff)
Merge pull request #13318 from sanjay900/dont-detach-macos
LibusbDevice: Don't detach kernel drivers on macOS
-rw-r--r--Source/Core/Core/IOS/USB/LibusbDevice.cpp4
-rw-r--r--Source/Core/InputCommon/GCAdapter.cpp2
2 files changed, 5 insertions, 1 deletions
diff --git a/Source/Core/Core/IOS/USB/LibusbDevice.cpp b/Source/Core/Core/IOS/USB/LibusbDevice.cpp
index 1e8188de9b..6770990a9d 100644
--- a/Source/Core/Core/IOS/USB/LibusbDevice.cpp
+++ b/Source/Core/Core/IOS/USB/LibusbDevice.cpp
@@ -439,6 +439,9 @@ static int DoForEachInterface(const Configs& configs, u8 config_num, Function ac
int LibusbDevice::ClaimAllInterfaces(u8 config_num) const
{
const int ret = DoForEachInterface(m_config_descriptors, config_num, [this](u8 i) {
+ // On macos detaching would fail without root or entitlement.
+ // We assume user is using GCAdapterDriver and therefore don't want to detach anything
+#if !defined(__APPLE__)
const int ret2 = libusb_detach_kernel_driver(m_handle, i);
if (ret2 < LIBUSB_SUCCESS && ret2 != LIBUSB_ERROR_NOT_FOUND &&
ret2 != LIBUSB_ERROR_NOT_SUPPORTED)
@@ -447,6 +450,7 @@ int LibusbDevice::ClaimAllInterfaces(u8 config_num) const
LibusbUtils::ErrorWrap(ret2));
return ret2;
}
+#endif
return libusb_claim_interface(m_handle, i);
});
if (ret < LIBUSB_SUCCESS)
diff --git a/Source/Core/InputCommon/GCAdapter.cpp b/Source/Core/InputCommon/GCAdapter.cpp
index 9da1548034..5cfe513935 100644
--- a/Source/Core/InputCommon/GCAdapter.cpp
+++ b/Source/Core/InputCommon/GCAdapter.cpp
@@ -584,7 +584,7 @@ static bool CheckDeviceAccess(libusb_device* device)
if (ret == 1) // 1: kernel driver is active
{
// On macos detaching would fail without root or entitlement.
- // We assume user is using GCAdapterDriver and therefor don't want to detach anything
+ // We assume user is using GCAdapterDriver and therefore don't want to detach anything
#if !defined(__APPLE__)
ret = libusb_detach_kernel_driver(s_handle, 0);
detach_failed =