mfd: intel-lpss: Revert "Add missing check for platform_get_resource"
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 24 Nov 2023 19:31:24 +0000 (21:31 +0200)
committerLee Jones <lee@kernel.org>
Thu, 7 Dec 2023 13:50:29 +0000 (13:50 +0000)
This reverts commit d918e0d5824495a75d00b879118b098fcab36fdb.

The commit in question does not fix anything and only introduces
a duplication in the code. The main intel_lpss_probe() performs
all necessary checks.

While at it and in order of avoiding similar patches to come, add
a comment.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20231124200258.3682979-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/mfd/intel-lpss-acpi.c
drivers/mfd/intel-lpss-pci.c

index 5184fd1a5df130cf712c674072fb44c9b662b208..52ffc0d9c23f13b6fb17c78f49ca2a12ee90a75c 100644 (file)
@@ -182,10 +182,8 @@ static int intel_lpss_acpi_probe(struct platform_device *pdev)
        if (!info)
                return -ENOMEM;
 
+       /* No need to check mem and irq here as intel_lpss_probe() does it for us */
        info->mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       if (!info->mem)
-               return -ENODEV;
-
        info->irq = platform_get_irq(pdev, 0);
 
        ret = intel_lpss_probe(&pdev->dev, info);
index cf56cd3a40ee1cc84f1f2428d895543160738bf8..709b0fb4419de35e7c1b73aa8dbdba14cd4565ac 100644 (file)
@@ -46,6 +46,7 @@ static int intel_lpss_pci_probe(struct pci_dev *pdev,
        if (!info)
                return -ENOMEM;
 
+       /* No need to check mem and irq here as intel_lpss_probe() does it for us */
        info->mem = pci_resource_n(pdev, 0);
        info->irq = pci_irq_vector(pdev, 0);