diff mbox series

[v1,4/4] backlight: hx8357: Utilise temporary variable for struct device

Message ID 20240114152759.1040563-5-andriy.shevchenko@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series backlight: hx8357: Clean up and make OF-independent | expand

Commit Message

Andy Shevchenko Jan. 14, 2024, 3:25 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/video/backlight/hx8357.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Comments

Javier Martinez Canillas Jan. 15, 2024, 8:27 a.m. UTC | #1
Andy Shevchenko <andriy.shevchenko@linux.intel.com> writes:

> 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: Javier Martinez Canillas <javierm@redhat.com>
Daniel Thompson Jan. 24, 2024, 5:25 p.m. UTC | #2
On Sun, Jan 14, 2024 at 05:25:11PM +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: Daniel Thompson <daniel.thompson@linaro.org>


Daniel.
Andy Shevchenko Jan. 28, 2024, 2:39 p.m. UTC | #3
On Wed, Jan 24, 2024 at 05:25:07PM +0000, Daniel Thompson wrote:
> On Sun, Jan 14, 2024 at 05:25:11PM +0200, Andy Shevchenko wrote:

...

> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>

Thank you for the review, I will address comments and send a new version
at the end of the next week I hope.
diff mbox series

Patch

diff --git a/drivers/video/backlight/hx8357.c b/drivers/video/backlight/hx8357.c
index fbe02fd73272..e4dc76f25f8e 100644
--- a/drivers/video/backlight/hx8357.c
+++ b/drivers/video/backlight/hx8357.c
@@ -574,7 +574,7 @@  static int hx8357_probe(struct spi_device *spi)
 	hx8357_init init;
 	int i, ret;
 
-	lcd = devm_kzalloc(&spi->dev, sizeof(*lcd), GFP_KERNEL);
+	lcd = devm_kzalloc(dev, sizeof(*lcd), GFP_KERNEL);
 	if (!lcd)
 		return -ENOMEM;
 
@@ -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;
@@ -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;
 }