Skip to content

Commit dc53703

Browse files
committed
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>
1 parent dd0ccef commit dc53703

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

drivers/gpio/gpio-merrifield.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,13 @@ static const struct tng_gpio_pinrange mrfld_gpio_ranges[] = {
5151

5252
static const char *mrfld_gpio_get_pinctrl_dev_name(struct tng_gpio *priv)
5353
{
54+
struct device *dev = priv->dev;
5455
struct acpi_device *adev;
5556
const char *name;
5657

5758
adev = acpi_dev_get_first_match_dev("INTC1002", NULL, -1);
5859
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);
6061
acpi_dev_put(adev);
6162
} else {
6263
name = "pinctrl-merrifield";
@@ -89,11 +90,11 @@ static int mrfld_gpio_probe(struct pci_dev *pdev, const struct pci_device_id *id
8990
/* Release the IO mapping, since we already get the info from BAR1 */
9091
pcim_iounmap_regions(pdev, BIT(1));
9192

92-
priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
93+
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
9394
if (!priv)
9495
return -ENOMEM;
9596

96-
priv->dev = &pdev->dev;
97+
priv->dev = dev;
9798
priv->reg_base = pcim_iomap_table(pdev)[0];
9899

99100
priv->pin_info.pin_ranges = mrfld_gpio_ranges;

0 commit comments

Comments
 (0)