Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gpio: merrifield: 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>

+4 -3
+4 -3
drivers/gpio/gpio-merrifield.c
··· 51 51 52 52 static const char *mrfld_gpio_get_pinctrl_dev_name(struct tng_gpio *priv) 53 53 { 54 + struct device *dev = priv->dev; 54 55 struct acpi_device *adev; 55 56 const char *name; 56 57 57 58 adev = acpi_dev_get_first_match_dev("INTC1002", NULL, -1); 58 59 if (adev) { 59 - name = devm_kstrdup(priv->dev, acpi_dev_name(adev), GFP_KERNEL); 60 + name = devm_kstrdup(dev, acpi_dev_name(adev), GFP_KERNEL); 60 61 acpi_dev_put(adev); 61 62 } else { 62 63 name = "pinctrl-merrifield"; ··· 90 89 /* Release the IO mapping, since we already get the info from BAR1 */ 91 90 pcim_iounmap_regions(pdev, BIT(1)); 92 91 93 - priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); 92 + priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); 94 93 if (!priv) 95 94 return -ENOMEM; 96 95 97 - priv->dev = &pdev->dev; 96 + priv->dev = dev; 98 97 priv->reg_base = pcim_iomap_table(pdev)[0]; 99 98 100 99 priv->pin_info.pin_ranges = mrfld_gpio_ranges;