[PATCH v2 7/7] gpio: 74x164: Utilise temporary variable for struct device

Andy Shevchenko posted 7 patches 1 year ago
[PATCH v2 7/7] gpio: 74x164: Utilise temporary variable for struct device
Posted by Andy Shevchenko 1 year ago
We have a temporary variable to keep a pointer to struct device.
Utilise it where it makes sense.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/gpio/gpio-74x164.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/gpio/gpio-74x164.c b/drivers/gpio/gpio-74x164.c
index bbeef03e3797..db41abcd73e1 100644
--- a/drivers/gpio/gpio-74x164.c
+++ b/drivers/gpio/gpio-74x164.c
@@ -124,7 +124,7 @@ static int gen_74x164_probe(struct spi_device *spi)
 	if (ret < 0)
 		return ret;
 
-	ret = device_property_read_u32(&spi->dev, "registers-number", &nregs);
+	ret = device_property_read_u32(dev, "registers-number", &nregs);
 	if (ret)
 		return dev_err_probe(dev, ret, "Missing 'registers-number' property.\n");
 
@@ -134,8 +134,7 @@ static int gen_74x164_probe(struct spi_device *spi)
 
 	chip->registers = nregs;
 
-	chip->gpiod_oe = devm_gpiod_get_optional(&spi->dev, "enable",
-						 GPIOD_OUT_LOW);
+	chip->gpiod_oe = devm_gpiod_get_optional(dev, "enable", GPIOD_OUT_LOW);
 	if (IS_ERR(chip->gpiod_oe))
 		return PTR_ERR(chip->gpiod_oe);
 
@@ -147,7 +146,7 @@ static int gen_74x164_probe(struct spi_device *spi)
 	chip->gpio_chip.base = -1;
 	chip->gpio_chip.ngpio = GEN_74X164_NUMBER_GPIOS * chip->registers;
 	chip->gpio_chip.can_sleep = true;
-	chip->gpio_chip.parent = &spi->dev;
+	chip->gpio_chip.parent = dev;
 	chip->gpio_chip.owner = THIS_MODULE;
 
 	ret = devm_mutex_init(&spi->dev, &chip->lock);
-- 
2.43.0.rc1.1336.g36b5255a03ac
Re: [PATCH v2 7/7] gpio: 74x164: Utilise temporary variable for struct device
Posted by Andy Shevchenko 1 year ago
On Fri, Feb 07, 2025 at 05:17:14PM +0200, Andy Shevchenko wrote:
> We have a temporary variable to keep a pointer to struct device.
> Utilise it where it makes sense.

Urgh, this seems incomplete...
There are more lines to convert, however they do not affect ± statistics.

Tell me if I need to send full v3 or just this patch.

-- 
With Best Regards,
Andy Shevchenko
Re: [PATCH v2 7/7] gpio: 74x164: Utilise temporary variable for struct device
Posted by Bartosz Golaszewski 1 year ago
On Fri, Feb 7, 2025 at 4:42 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> On Fri, Feb 07, 2025 at 05:17:14PM +0200, Andy Shevchenko wrote:
> > We have a temporary variable to keep a pointer to struct device.
> > Utilise it where it makes sense.
>
> Urgh, this seems incomplete...
> There are more lines to convert, however they do not affect ą statistics.
>
> Tell me if I need to send full v3 or just this patch.
>
> --
> With Best Regards,
> Andy Shevchenko
>
>

No worries, I may fix it when applying.

I'll still give this series a few more days on the list.

Bart
Re: [PATCH v2 7/7] gpio: 74x164: Utilise temporary variable for struct device
Posted by Andy Shevchenko 12 months ago
On Fri, Feb 07, 2025 at 08:56:45PM +0100, Bartosz Golaszewski wrote:
> On Fri, Feb 7, 2025 at 4:42 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> >
> > On Fri, Feb 07, 2025 at 05:17:14PM +0200, Andy Shevchenko wrote:
> > > We have a temporary variable to keep a pointer to struct device.
> > > Utilise it where it makes sense.
> >
> > Urgh, this seems incomplete...
> > There are more lines to convert, however they do not affect ą statistics.
> >
> > Tell me if I need to send full v3 or just this patch.
> 
> No worries, I may fix it when applying.
> 
> I'll still give this series a few more days on the list.

Sure, thanks!


-- 
With Best Regards,
Andy Shevchenko