]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
i3c: mipi-i3c-hci-pci: Do not repeatedly check for NULL driver_data
authorAdrian Hunter <adrian.hunter@intel.com>
Tue, 6 Jan 2026 16:44:09 +0000 (18:44 +0200)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Wed, 14 Jan 2026 14:53:33 +0000 (15:53 +0100)
All entries in the id_table have driver_data. Do not repeatedly check for
NULL driver_data.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260106164416.67074-5-adrian.hunter@intel.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/i3c/master/mipi-i3c-hci/mipi-i3c-hci-pci.c

index dc8ede0f8ad8df71c3092a4da70e2ad92aa81053..8ade911e3835876239e8ca51553f12084ba8ea0f 100644 (file)
@@ -229,7 +229,7 @@ static int mipi_i3c_hci_pci_probe(struct pci_dev *pci,
                goto err;
 
        hci->info = (const struct mipi_i3c_hci_pci_info *)id->driver_data;
-       if (hci->info && hci->info->init) {
+       if (hci->info->init) {
                ret = hci->info->init(hci);
                if (ret)
                        goto err;
@@ -244,7 +244,7 @@ static int mipi_i3c_hci_pci_probe(struct pci_dev *pci,
        return 0;
 
 err_exit:
-       if (hci->info && hci->info->exit)
+       if (hci->info->exit)
                hci->info->exit(hci);
 err:
        platform_device_put(hci->pdev);
@@ -258,7 +258,7 @@ static void mipi_i3c_hci_pci_remove(struct pci_dev *pci)
        struct platform_device *pdev = hci->pdev;
        int dev_id = pdev->id;
 
-       if (hci->info && hci->info->exit)
+       if (hci->info->exit)
                hci->info->exit(hci);
 
        platform_device_unregister(pdev);