From 15e15422ba2f7b540a03cc6e7506b197f29a032d Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Wed, 17 Aug 2022 20:28:01 -0400 Subject: [PATCH] asahi: Fix warning building for macOS 12.0 Unnecessary rename that breaks forward compatibility... but Apple says this is just NULL. Do the simpler thing. Note that the argument is a mach_port_t, which is a natural_t == uint32_t in userspace... even though it's a pointer in the kernel. Although Apple's docs claim that kIOMasterPortDefault is NULL, it's really just 0. ../src/asahi/lib/agx_device.c:290:35: warning: 'kIOMasterPortDefault' is deprecated: first deprecated in macOS 12.0 [-Wdeprecated-declarations] IOServiceGetMatchingService(kIOMasterPortDefault, matching); ^~~~~~~~~~~~~~~~~~~~ kIOMainPortDefault Signed-off-by: Alyssa Rosenzweig Reviewed-by: Eric Engestrom Part-of: --- src/asahi/lib/agx_device.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/asahi/lib/agx_device.c b/src/asahi/lib/agx_device.c index d170e719a04..5889dfb1adc 100644 --- a/src/asahi/lib/agx_device.c +++ b/src/asahi/lib/agx_device.c @@ -285,9 +285,7 @@ agx_open_device(void *memctx, struct agx_device *dev) /* TODO: Support other models */ CFDictionaryRef matching = IOServiceNameMatching("AGXAcceleratorG13G_B0"); - - io_service_t service = - IOServiceGetMatchingService(kIOMasterPortDefault, matching); + io_service_t service = IOServiceGetMatchingService(0, matching); if (!service) return false;