iio: trigger: stm32-lptimer-trigger: remove unneeded platform_set_drvdata()
authorAndrei Coardos <aboutphysycs@gmail.com>
Wed, 2 Aug 2023 12:09:15 +0000 (15:09 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 5 Aug 2023 18:29:39 +0000 (19:29 +0100)
This function call was found to be unnecessary as there is no equivalent
platform_get_drvdata() call to access the private data of the driver. Also,
the private data is defined in this driver, so there is no risk of it being
accessed outside of this driver file.

Reviewed-by: Alexandru Ardelean <alex@shruggie.ro>
Signed-off-by: Andrei Coardos <aboutphysycs@gmail.com>
Link: https://lore.kernel.org/r/20230802120915.25631-1-aboutphysycs@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/trigger/stm32-lptimer-trigger.c

index 2e447a3..f1e1891 100644 (file)
@@ -73,7 +73,6 @@ static int stm32_lptim_trigger_probe(struct platform_device *pdev)
 {
        struct stm32_lptim_trigger *priv;
        u32 index;
-       int ret;
 
        priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
        if (!priv)
@@ -88,13 +87,7 @@ static int stm32_lptim_trigger_probe(struct platform_device *pdev)
        priv->dev = &pdev->dev;
        priv->trg = stm32_lptim_triggers[index];
 
-       ret = stm32_lptim_setup_trig(priv);
-       if (ret)
-               return ret;
-
-       platform_set_drvdata(pdev, priv);
-
-       return 0;
+       return stm32_lptim_setup_trig(priv);
 }
 
 static const struct of_device_id stm32_lptim_trig_of_match[] = {