Commit 9ffe4c10 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Lee Jones

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: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20231124200258.3682979-3-andriy.shevchenko@linux.intel.comSigned-off-by: default avatarLee Jones <lee@kernel.org>
parent 3b6dba22
...@@ -8,9 +8,9 @@ ...@@ -8,9 +8,9 @@
* Mika Westerberg <mika.westerberg@linux.intel.com> * Mika Westerberg <mika.westerberg@linux.intel.com>
*/ */
#include <linux/acpi.h>
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
...@@ -169,16 +169,15 @@ MODULE_DEVICE_TABLE(acpi, intel_lpss_acpi_ids); ...@@ -169,16 +169,15 @@ MODULE_DEVICE_TABLE(acpi, intel_lpss_acpi_ids);
static int intel_lpss_acpi_probe(struct platform_device *pdev) static int intel_lpss_acpi_probe(struct platform_device *pdev)
{ {
const struct intel_lpss_platform_info *data;
struct intel_lpss_platform_info *info; struct intel_lpss_platform_info *info;
const struct acpi_device_id *id;
int ret; int ret;
id = acpi_match_device(intel_lpss_acpi_ids, &pdev->dev); data = device_get_match_data(&pdev->dev);
if (!id) if (!data)
return -ENODEV; return -ENODEV;
info = devm_kmemdup(&pdev->dev, (void *)id->driver_data, sizeof(*info), info = devm_kmemdup(&pdev->dev, data, sizeof(*info), GFP_KERNEL);
GFP_KERNEL);
if (!info) if (!info)
return -ENOMEM; return -ENOMEM;
......
...@@ -30,6 +30,7 @@ static const struct pci_device_id ignore_resource_conflicts_ids[] = { ...@@ -30,6 +30,7 @@ static const struct pci_device_id ignore_resource_conflicts_ids[] = {
static int intel_lpss_pci_probe(struct pci_dev *pdev, static int intel_lpss_pci_probe(struct pci_dev *pdev,
const struct pci_device_id *id) const struct pci_device_id *id)
{ {
const struct intel_lpss_platform_info *data = (void *)id->driver_data;
struct intel_lpss_platform_info *info; struct intel_lpss_platform_info *info;
int ret; int ret;
...@@ -41,8 +42,7 @@ static int intel_lpss_pci_probe(struct pci_dev *pdev, ...@@ -41,8 +42,7 @@ static int intel_lpss_pci_probe(struct pci_dev *pdev,
if (ret) if (ret)
return ret; return ret;
info = devm_kmemdup(&pdev->dev, (void *)id->driver_data, sizeof(*info), info = devm_kmemdup(&pdev->dev, data, sizeof(*info), GFP_KERNEL);
GFP_KERNEL);
if (!info) if (!info)
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment