mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
media: ir-spi: Utilise temporary variable for struct device
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> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
This commit is contained in:
parent
191d638f2d
commit
37308961cf
1 changed files with 3 additions and 3 deletions
|
@ -121,11 +121,11 @@ static int ir_spi_probe(struct spi_device *spi)
|
||||||
u8 dc;
|
u8 dc;
|
||||||
struct ir_spi_data *idata;
|
struct ir_spi_data *idata;
|
||||||
|
|
||||||
idata = devm_kzalloc(&spi->dev, sizeof(*idata), GFP_KERNEL);
|
idata = devm_kzalloc(dev, sizeof(*idata), GFP_KERNEL);
|
||||||
if (!idata)
|
if (!idata)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
idata->regulator = devm_regulator_get(&spi->dev, "irda_regulator");
|
idata->regulator = devm_regulator_get(dev, "irda_regulator");
|
||||||
if (IS_ERR(idata->regulator))
|
if (IS_ERR(idata->regulator))
|
||||||
return PTR_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;
|
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[] = {
|
static const struct of_device_id ir_spi_of_match[] = {
|
||||||
|
|
Loading…
Add table
Reference in a new issue