Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iio: trigger: stm32-lptimer-trigger: remove unneeded platform_set_drvdata()

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>

authored by

Andrei Coardos and committed by
Jonathan Cameron
d866f140 e19480dd

+1 -8
+1 -8
drivers/iio/trigger/stm32-lptimer-trigger.c
··· 73 73 { 74 74 struct stm32_lptim_trigger *priv; 75 75 u32 index; 76 - int ret; 77 76 78 77 priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); 79 78 if (!priv) ··· 87 88 priv->dev = &pdev->dev; 88 89 priv->trg = stm32_lptim_triggers[index]; 89 90 90 - ret = stm32_lptim_setup_trig(priv); 91 - if (ret) 92 - return ret; 93 - 94 - platform_set_drvdata(pdev, priv); 95 - 96 - return 0; 91 + return stm32_lptim_setup_trig(priv); 97 92 } 98 93 99 94 static const struct of_device_id stm32_lptim_trig_of_match[] = {