--- zzzz-none-000/linux-3.10.107/drivers/firmware/google/gsmi.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/firmware/google/gsmi.c 2021-02-04 17:41:59.000000000 +0000 @@ -525,7 +525,7 @@ u32 data_type; } param; - rc = strict_strtoul(buf, 0, &val); + rc = kstrtoul(buf, 0, &val); if (rc) return rc; @@ -764,6 +764,13 @@ static struct kobject *gsmi_kobj; static struct efivars efivars; +static const struct platform_device_info gsmi_dev_info = { + .name = "gsmi", + .id = -1, + /* SMI callbacks require 32bit addresses */ + .dma_mask = DMA_BIT_MASK(32), +}; + static __init int gsmi_init(void) { unsigned long flags; @@ -776,7 +783,7 @@ gsmi_dev.smi_cmd = acpi_gbl_FADT.smi_command; /* register device */ - gsmi_dev.pdev = platform_device_register_simple("gsmi", -1, NULL, 0); + gsmi_dev.pdev = platform_device_register_full(&gsmi_dev_info); if (IS_ERR(gsmi_dev.pdev)) { printk(KERN_ERR "gsmi: unable to register platform device\n"); return PTR_ERR(gsmi_dev.pdev); @@ -785,10 +792,6 @@ /* SMI access needs to be serialized */ spin_lock_init(&gsmi_dev.lock); - /* SMI callbacks require 32bit addresses */ - gsmi_dev.pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); - gsmi_dev.pdev->dev.dma_mask = - &gsmi_dev.pdev->dev.coherent_dma_mask; ret = -ENOMEM; gsmi_dev.dma_pool = dma_pool_create("gsmi", &gsmi_dev.pdev->dev, GSMI_BUF_SIZE, GSMI_BUF_ALIGN, 0); @@ -889,13 +892,6 @@ goto out_remove_sysfs_files; } - ret = efivars_sysfs_init(); - if (ret) { - printk(KERN_INFO "gsmi: Failed to create efivars files\n"); - efivars_unregister(&efivars); - goto out_remove_sysfs_files; - } - register_reboot_notifier(&gsmi_reboot_notifier); register_die_notifier(&gsmi_die_notifier); atomic_notifier_chain_register(&panic_notifier_list,