Skip to content

Commit

Permalink
backlight: hx8357: Utilise temporary variable for struct device
Browse files Browse the repository at this point in the history
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: Daniel Thompson <daniel.thompson@linaro.org>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://lore.kernel.org/r/20240201144951.294215-5-andriy.shevchenko@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>
  • Loading branch information
Andy Shevchenko authored and Lee Jones committed Mar 7, 2024
1 parent 7244d89 commit 7ebac13
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions drivers/video/backlight/hx8357.c
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ static int hx8357_probe(struct spi_device *spi)
hx8357_init_fn init_fn;
int i, ret;

lcd = devm_kzalloc(&spi->dev, sizeof(*lcd), GFP_KERNEL);
lcd = devm_kzalloc(dev, sizeof(*lcd), GFP_KERNEL);
if (!lcd)
return -ENOMEM;

Expand Down Expand Up @@ -604,8 +604,7 @@ static int hx8357_probe(struct spi_device *spi)
gpiod_set_consumer_name(lcd->im_pins->desc[i], "im_pins");
}

lcdev = devm_lcd_device_register(&spi->dev, "mxsfb", &spi->dev, lcd,
&hx8357_ops);
lcdev = devm_lcd_device_register(dev, "mxsfb", dev, lcd, &hx8357_ops);
if (IS_ERR(lcdev)) {
ret = PTR_ERR(lcdev);
return ret;
Expand All @@ -618,7 +617,7 @@ static int hx8357_probe(struct spi_device *spi)
if (ret)
return dev_err_probe(dev, ret, "Couldn't initialize panel\n");

dev_info(&spi->dev, "Panel probed\n");
dev_info(dev, "Panel probed\n");

return 0;
}
Expand Down

0 comments on commit 7ebac13

Please sign in to comment.