[driver-core PATCH v10 2/9] device core: Consolidate locking and unlocking of parent and device