drivers: core: device: add support to check dt compatible for a device/machine