Skip to content

Commit 9ffe4c1

Browse files
andy-shevlag-linaro
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lee Jones <[email protected]>
1 parent 3b6dba2 commit 9ffe4c1

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

drivers/mfd/intel-lpss-acpi.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
* Mika Westerberg <[email protected]>
99
*/
1010

11-
#include <linux/acpi.h>
1211
#include <linux/ioport.h>
1312
#include <linux/kernel.h>
13+
#include <linux/mod_devicetable.h>
1414
#include <linux/module.h>
1515
#include <linux/pm_runtime.h>
1616
#include <linux/platform_device.h>
@@ -169,16 +169,15 @@ MODULE_DEVICE_TABLE(acpi, intel_lpss_acpi_ids);
169169

170170
static int intel_lpss_acpi_probe(struct platform_device *pdev)
171171
{
172+
const struct intel_lpss_platform_info *data;
172173
struct intel_lpss_platform_info *info;
173-
const struct acpi_device_id *id;
174174
int ret;
175175

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)
178178
return -ENODEV;
179179

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);
182181
if (!info)
183182
return -ENOMEM;
184183

drivers/mfd/intel-lpss-pci.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ static const struct pci_device_id ignore_resource_conflicts_ids[] = {
3030
static int intel_lpss_pci_probe(struct pci_dev *pdev,
3131
const struct pci_device_id *id)
3232
{
33+
const struct intel_lpss_platform_info *data = (void *)id->driver_data;
3334
struct intel_lpss_platform_info *info;
3435
int ret;
3536

@@ -41,8 +42,7 @@ static int intel_lpss_pci_probe(struct pci_dev *pdev,
4142
if (ret)
4243
return ret;
4344

44-
info = devm_kmemdup(&pdev->dev, (void *)id->driver_data, sizeof(*info),
45-
GFP_KERNEL);
45+
info = devm_kmemdup(&pdev->dev, data, sizeof(*info), GFP_KERNEL);
4646
if (!info)
4747
return -ENOMEM;
4848

0 commit comments

Comments
 (0)