diff mbox series

[v1,3/5] media: ir-spi: Utilise temporary variable for struct device

Message ID 20240305174933.1370708-4-andriy.shevchenko@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series media: ir-spi: A few cleanups | expand

Commit Message

Andy Shevchenko March 5, 2024, 5:48 p.m. UTC
We have a temporary variable to keep pointer to struct device.
Utilise it inside the ->probe() implementation.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/media/rc/ir-spi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Andi Shyti March 5, 2024, 10:47 p.m. UTC | #1
Hi Andy,

On Tue, Mar 05, 2024 at 07:48:28PM +0200, Andy Shevchenko wrote:
> We have a temporary variable to keep pointer to struct device.
> Utilise it inside the ->probe() implementation.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Reviewed-by: Andi Shyti <andi.shyti@kernel.org>

Thanks,
Andi
diff mbox series

Patch

diff --git a/drivers/media/rc/ir-spi.c b/drivers/media/rc/ir-spi.c
index 846d407a1f7e..19102bdcfd6f 100644
--- a/drivers/media/rc/ir-spi.c
+++ b/drivers/media/rc/ir-spi.c
@@ -121,11 +121,11 @@  static int ir_spi_probe(struct spi_device *spi)
 	u8 dc;
 	struct ir_spi_data *idata;
 
-	idata = devm_kzalloc(&spi->dev, sizeof(*idata), GFP_KERNEL);
+	idata = devm_kzalloc(dev, sizeof(*idata), GFP_KERNEL);
 	if (!idata)
 		return -ENOMEM;
 
-	idata->regulator = devm_regulator_get(&spi->dev, "irda_regulator");
+	idata->regulator = devm_regulator_get(dev, "irda_regulator");
 	if (IS_ERR(idata->regulator))
 		return PTR_ERR(idata->regulator);
 
@@ -154,7 +154,7 @@  static int ir_spi_probe(struct spi_device *spi)
 
 	idata->freq = IR_SPI_DEFAULT_FREQUENCY;
 
-	return devm_rc_register_device(&spi->dev, idata->rc);
+	return devm_rc_register_device(dev, idata->rc);
 }
 
 static const struct of_device_id ir_spi_of_match[] = {