Thread (24 messages) 24 messages, 4 authors, 2019-08-05

Re: [PATCH v2 7/7] backlight: gpio: use a helper variable for &pdev->dev

From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Date: 2019-07-22 16:09:16
Also in: dri-devel, linux-sh, lkml

On Mon, Jul 22, 2019 at 05:03:02PM +0200, Bartosz Golaszewski wrote:
From: Bartosz Golaszewski <redacted>

Instead of dereferencing pdev each time, use a helper variable for
the associated device pointer.
 static int gpio_backlight_probe(struct platform_device *pdev)
 {
-	struct gpio_backlight_platform_data *pdata > -		dev_get_platdata(&pdev->dev);
+	struct gpio_backlight_platform_data *pdata;
 	struct backlight_properties props;
 	struct backlight_device *bl;
 	struct gpio_backlight *gbl;
 	enum gpiod_flags flags;
+	struct device *dev;
Can't we do

	struct device dev = &pdev->dev;
	struct gpio_backlight_platform_data *pdata = dev_get_platdata(dev);

? It fits 80 nicely.

-- 
With Best Regards,
Andy Shevchenko
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help