Skip to content

Commit c0e6ba2

Browse files
DHowettTzung-Bi Shih
authored andcommitted
platform/chrome: cros_ec_lpc: pass driver_data from DMI to the device
lpc_driver_data will be stored in drvdata until probe is complete. Signed-off-by: Dustin L. Howett <[email protected]> Reviewed-by: Thomas Weißschuh <[email protected]> Tested-by: Thomas Weißschuh <[email protected]> Tested-by: Mario Limonciello <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Tzung-Bi Shih <[email protected]>
1 parent 8d4a9c6 commit c0e6ba2

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

drivers/platform/chrome/cros_ec_lpc.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -627,14 +627,16 @@ static int __init cros_ec_lpc_init(void)
627627
{
628628
int ret;
629629
acpi_status status;
630+
const struct dmi_system_id *dmi_match;
630631

631632
status = acpi_get_devices(ACPI_DRV_NAME, cros_ec_lpc_parse_device,
632633
&cros_ec_lpc_acpi_device_found, NULL);
633634
if (ACPI_FAILURE(status))
634635
pr_warn(DRV_NAME ": Looking for %s failed\n", ACPI_DRV_NAME);
635636

636-
if (!cros_ec_lpc_acpi_device_found &&
637-
!dmi_check_system(cros_ec_lpc_dmi_table)) {
637+
dmi_match = dmi_first_match(cros_ec_lpc_dmi_table);
638+
639+
if (!cros_ec_lpc_acpi_device_found && !dmi_match) {
638640
pr_err(DRV_NAME ": unsupported system.\n");
639641
return -ENODEV;
640642
}
@@ -647,6 +649,9 @@ static int __init cros_ec_lpc_init(void)
647649
}
648650

649651
if (!cros_ec_lpc_acpi_device_found) {
652+
/* Pass the DMI match's driver data down to the platform device */
653+
platform_set_drvdata(&cros_ec_lpc_device, dmi_match->driver_data);
654+
650655
/* Register the device, and it'll get hooked up automatically */
651656
ret = platform_device_register(&cros_ec_lpc_device);
652657
if (ret) {

0 commit comments

Comments
 (0)