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 <alyssa@rosenzweig.io>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18121>
This commit is contained in:
Alyssa Rosenzweig 2022-08-17 20:28:01 -04:00
parent 1635ad0322
commit 15e15422ba

View file

@ -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;