staging: mt7621-pci: directly return 'mt7621_pcie_register_host'
authorSergio Paracuellos <sergio.paracuellos@gmail.com>
Wed, 5 May 2021 12:17:32 +0000 (14:17 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 10 May 2021 09:19:40 +0000 (11:19 +0200)
Return code after call function 'mt7621_pcie_register_host' is
being checked to give an error message. This function internally
is calling 'pci_host_probe' which if something fails will complain
already. Hence, directly return result of this call making decrease
a bit LOC.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Link: https://lore.kernel.org/r/20210505121736.6459-7-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/mt7621-pci/pci-mt7621.c

index 40bb2e8a117735e9ceefb612e258a84153ccafe6..331bd8b47d997ad0f511860becd783b27cb8c362 100644 (file)
@@ -694,13 +694,7 @@ static int mt7621_pci_probe(struct platform_device *pdev)
 
        setup_cm_memory_region(pcie);
 
-       err = mt7621_pcie_register_host(bridge);
-       if (err) {
-               dev_err(dev, "Error registering host\n");
-               return err;
-       }
-
-       return 0;
+       return mt7621_pcie_register_host(bridge);
 }
 
 static const struct of_device_id mt7621_pci_ids[] = {