summaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-merrifield.c
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2023-02-16 20:03:42 +0200
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>2023-03-06 17:10:46 +0200
commitdc537030647a451bca169209d05b50d2ca3fe4f6 (patch)
tree395e85695596ba5752c842964bd234d7ddc3e5de /drivers/gpio/gpio-merrifield.c
parentdd0ccef23649d2e54aea1b317be36b2dbde0f329 (diff)
downloadlinux-stable-dc537030647a451bca169209d05b50d2ca3fe4f6.tar.gz
linux-stable-dc537030647a451bca169209d05b50d2ca3fe4f6.tar.bz2
linux-stable-dc537030647a451bca169209d05b50d2ca3fe4f6.zip
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>
Diffstat (limited to 'drivers/gpio/gpio-merrifield.c')
-rw-r--r--drivers/gpio/gpio-merrifield.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/gpio/gpio-merrifield.c b/drivers/gpio/gpio-merrifield.c
index c64057343954..421d7e3a6c66 100644
--- a/drivers/gpio/gpio-merrifield.c
+++ b/drivers/gpio/gpio-merrifield.c
@@ -51,12 +51,13 @@ static const struct tng_gpio_pinrange mrfld_gpio_ranges[] = {
static const char *mrfld_gpio_get_pinctrl_dev_name(struct tng_gpio *priv)
{
+ struct device *dev = priv->dev;
struct acpi_device *adev;
const char *name;
adev = acpi_dev_get_first_match_dev("INTC1002", NULL, -1);
if (adev) {
- name = devm_kstrdup(priv->dev, acpi_dev_name(adev), GFP_KERNEL);
+ name = devm_kstrdup(dev, acpi_dev_name(adev), GFP_KERNEL);
acpi_dev_put(adev);
} else {
name = "pinctrl-merrifield";
@@ -89,11 +90,11 @@ static int mrfld_gpio_probe(struct pci_dev *pdev, const struct pci_device_id *id
/* Release the IO mapping, since we already get the info from BAR1 */
pcim_iounmap_regions(pdev, BIT(1));
- priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
+ priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
if (!priv)
return -ENOMEM;
- priv->dev = &pdev->dev;
+ priv->dev = dev;
priv->reg_base = pcim_iomap_table(pdev)[0];
priv->pin_info.pin_ranges = mrfld_gpio_ranges;