Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mfd: intel-lpss: Use device_get_match_data()

Use preferred device_get_match_data() instead of acpi_match_device() to
get the driver match data. With this, adjust the includes to explicitly
include the correct headers.

Introduce a temporary variable in PCI glue driver to be consistent with
ACPI one on the same matter.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20231124200258.3682979-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>

authored by

Andy Shevchenko and committed by
Lee Jones
9ffe4c10 3b6dba22

+7 -8
+5 -6
drivers/mfd/intel-lpss-acpi.c
··· 8 8 * Mika Westerberg <mika.westerberg@linux.intel.com> 9 9 */ 10 10 11 - #include <linux/acpi.h> 12 11 #include <linux/ioport.h> 13 12 #include <linux/kernel.h> 13 + #include <linux/mod_devicetable.h> 14 14 #include <linux/module.h> 15 15 #include <linux/pm_runtime.h> 16 16 #include <linux/platform_device.h> ··· 169 169 170 170 static int intel_lpss_acpi_probe(struct platform_device *pdev) 171 171 { 172 + const struct intel_lpss_platform_info *data; 172 173 struct intel_lpss_platform_info *info; 173 - const struct acpi_device_id *id; 174 174 int ret; 175 175 176 - id = acpi_match_device(intel_lpss_acpi_ids, &pdev->dev); 177 - if (!id) 176 + data = device_get_match_data(&pdev->dev); 177 + if (!data) 178 178 return -ENODEV; 179 179 180 - info = devm_kmemdup(&pdev->dev, (void *)id->driver_data, sizeof(*info), 181 - GFP_KERNEL); 180 + info = devm_kmemdup(&pdev->dev, data, sizeof(*info), GFP_KERNEL); 182 181 if (!info) 183 182 return -ENOMEM; 184 183
+2 -2
drivers/mfd/intel-lpss-pci.c
··· 30 30 static int intel_lpss_pci_probe(struct pci_dev *pdev, 31 31 const struct pci_device_id *id) 32 32 { 33 + const struct intel_lpss_platform_info *data = (void *)id->driver_data; 33 34 struct intel_lpss_platform_info *info; 34 35 int ret; 35 36 ··· 42 41 if (ret) 43 42 return ret; 44 43 45 - info = devm_kmemdup(&pdev->dev, (void *)id->driver_data, sizeof(*info), 46 - GFP_KERNEL); 44 + info = devm_kmemdup(&pdev->dev, data, sizeof(*info), GFP_KERNEL); 47 45 if (!info) 48 46 return -ENOMEM; 49 47