static int cros_ec_cec_get_notifier(struct device *dev, struct cec_notifier **notify) { int i; for (i = 0 ; i < ARRAY_SIZE(cec_dmi_match_table) ; ++i) { const struct cec_dmi_match *m = &cec_dmi_match_table[i]; if (dmi_match(DMI_SYS_VENDOR, m->sys_vendor) && dmi_match(DMI_PRODUCT_NAME, m->product_name)) { struct device *d; /* Find the device, bail out if not yet registered */ d = bus_find_device_by_name(&pci_bus_type, NULL, m->devname); if (!d) return -EPROBE_DEFER; *notify = cec_notifier_get_conn(d, m->conn); put_device(d); return 0; } } /* Hardware support must be added in the cec_dmi_match_table */ dev_warn(dev, "CEC notifier not configured for this hardware\n"); return -ENODEV; }
void __init early_platform_quirks(void) { x86_apple_machine = dmi_match(DMI_SYS_VENDOR, "Apple Inc.") || dmi_match(DMI_SYS_VENDOR, "Apple Computer, Inc."); }