]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
media: ipu6: Remove redundant driver data checks
authorSakari Ailus <sakari.ailus@linux.intel.com>
Thu, 18 Dec 2025 22:52:43 +0000 (00:52 +0200)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Tue, 13 Jan 2026 11:47:56 +0000 (12:47 +0100)
Both runtime PM resume and suspend callbacks check whether the driver's
data is set for the device. This is done in probe(); drop the redundant
checks.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Bingbu Cao <bingbu.cao@intel.com>
Tested-by: Mehdi Djait <mehdi.djait@linux.intel.com> # Dell XPS 9315
Reviewed-by: Mehdi Djait <mehdi.djait@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/pci/intel/ipu6/ipu6-isys.c

index 226bfae21c1682b0dcb7b09ea41eeab8795e99b2..ef01dcb635fa82053a43b22aa6af0ba064c5a8cd 100644 (file)
@@ -857,9 +857,6 @@ static int isys_runtime_pm_resume(struct device *dev)
        unsigned long flags;
        int ret;
 
-       if (!isys)
-               return 0;
-
        ret = ipu6_mmu_hw_init(adev->mmu);
        if (ret)
                return ret;
@@ -884,13 +881,9 @@ static int isys_runtime_pm_resume(struct device *dev)
 static int isys_runtime_pm_suspend(struct device *dev)
 {
        struct ipu6_bus_device *adev = to_ipu6_bus_device(dev);
-       struct ipu6_isys *isys;
+       struct ipu6_isys *isys = dev_get_drvdata(dev);
        unsigned long flags;
 
-       isys = dev_get_drvdata(dev);
-       if (!isys)
-               return 0;
-
        spin_lock_irqsave(&isys->power_lock, flags);
        isys->power = 0;
        spin_unlock_irqrestore(&isys->power_lock, flags);