*
* @APPLE_LICENSE_HEADER_START@
*
- * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
- *
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
bool AppleMacIODevice::compareName( OSString * name,
- OSString ** matched = 0 ) const
+ OSString ** matched ) const
{
- return( ((AppleMacIO *)getProvider())->
- compareNubName( this, name, matched ));
+ return (IODTCompareNubName(this, name, matched) ||
+ IORegistryEntry::compareName(name, matched));
}
IOService * AppleMacIODevice::matchLocation( IOService * /* client */ )
{
- return( this );
+ return this;
}
IOReturn AppleMacIODevice::getResources( void )
{
- return( ((AppleMacIO *)getProvider())->getNubResources( this ));
+ IOService *macIO = this;
+
+ if (getDeviceMemory() != 0) return kIOReturnSuccess;
+
+ while (macIO && ((macIO = macIO->getProvider()) != 0))
+ if (strcmp("mac-io", macIO->getName()) == 0) break;
+
+ if (macIO == 0) return kIOReturnError;
+
+ IODTResolveAddressing(this, "reg", macIO->getDeviceMemoryWithIndex(0));
+
+ return kIOReturnSuccess;
}