Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp8572846ybi; Tue, 23 Jul 2019 11:00:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqwxkLc0CevZLZ3fIrfehpGuhUg1nN1l9dVRUXBnNZk9f19GSIRpgN9kxdeQJEwZ8tA3FpTX X-Received: by 2002:a65:614a:: with SMTP id o10mr76038174pgv.407.1563904844038; Tue, 23 Jul 2019 11:00:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563904844; cv=none; d=google.com; s=arc-20160816; b=J4ux0ylrM/WDh+O0/IQTcalZIlbfzKXjm5ZkHtiW9JU1zmwdbDaR6QDISQiSooE3TX 0NbgbMAwwX8o8K3a3jMjI7vpDtofvcfKpV57KxnguxXmjyfreYonx2akqTc0ifRsxMsq f/EiRv54J8lwzCCKhTPRebbm7gritrynrCmrWSchNtt884GE1b7iegqXSlWWCCDJvNrQ rLrb55X8ygVaBh6QU5t9457J5E+mcKN4qIH7Kk3xSO00ve8XNVJvE0ue0awc0KW+YOVa uX1X3P3G04Ml8cxZRHm53dMmSAyNwtlNBPugP52l+VucIuuboigZ75id1iWfmf/YACBm LQTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from:dkim-signature; bh=P/IhrnANi+2O2v80X4s3O9Ae0AOuA4HxAuKTn1SEfO4=; b=ajUxIy6BCgY/a4HS0i2jS3K1B8J72MIVYUAdFkzsDhZdwWWpS0cVYyysNISDln/Kre um9rlIu4/3BE/pzOm366DDGSdfOvIyjRIAzSHr8jglufRZB0k54EqxLTYVIyDkT/Iau0 e2E4FutXcCFrl3KK0dsnFQruUUXRUhJBFcbvUKHvY8uV/CuSIcrT+DgUoA55fQ0tyvQX /Gvfio5q8JPndKu4SKAscufk3STikuiGT5Z1/cDXYu5boObLXzH0nsmiCuHcP7vxAFIH tinercALTzCAprvfQ4ytuXkDNzyt3XzPPsNh697OJ1URpA7B7YYWucVY5irP2L6FWZy7 3LZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b="Or7q/736"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d13si13026138pgu.268.2019.07.23.11.00.28; Tue, 23 Jul 2019 11:00:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b="Or7q/736"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733191AbfGWI3q (ORCPT + 99 others); Tue, 23 Jul 2019 04:29:46 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:41840 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729876AbfGWI3q (ORCPT ); Tue, 23 Jul 2019 04:29:46 -0400 Received: by mail-pl1-f196.google.com with SMTP id m9so20233495pls.8; Tue, 23 Jul 2019 01:29:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=P/IhrnANi+2O2v80X4s3O9Ae0AOuA4HxAuKTn1SEfO4=; b=Or7q/736P9pmrzN0Z4uGLSF7JdsOo1NktSjHRB2KsG3UsdxMu/L2XlHIJemSmmVJ+W 7nfgtIOwQh38wllJvbdagP/c9rKPiqZwN7IZy+9+vFNKCB75SbDcWhg6golzgaki6og1 aSMI+NJ06RTVxBxoNw+hCkzQHbTfrihpkCwlKxbMatdwHmqHd8QjUvhavnBivYez7j/R AhZ5MgrN8ic//q/Mi3HEs/QJWmTMGtIk9v5YMrLiiFU+D2PLFqHS2QKKwM4y03QC/v/o 0XD5tgNCIhO2kjXVnYn1JJDKlT9bCA1ZAFVIlYa5QgRY4m5XDN539LeWwS5XGUh5SRHS UiVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=P/IhrnANi+2O2v80X4s3O9Ae0AOuA4HxAuKTn1SEfO4=; b=JfejHGcAvcj7HT7WBMLFv7pcVguyYRiVIJNG/jgy4VTJRbvkifdQrU3+pN24fqU6YH eIl04z2mK+u0tfGNanql1KY0GlZXl1Tpx/jwu8Z/myeJCBaSHBJvx2zoNUjrF3EWkbk2 XOw1SeY8yDd68RmJZvzEo5Dd/5BV83xLPyZVzZgQs3RJk+4/pyE0t+JXuHUP5fLoZeck Sj5dCwXmLPXJEkdG0GFiRqcsHMXSfyg4Igs7zYvA6wXioxZodpBRBKzTa8J03hPTkppa 6uAkaJa8HHXZ46YziBGIWD3rx1JhBbrrvgdKjPn3w2HRwra3xCi4LqkU/tqYOsMAYzfE 7zIA== X-Gm-Message-State: APjAAAXlRVMh8oLib8c0LQB2Yqw8tQTyEWX1CP6i3jP/nS2WFamT7xux CZgA25tKMs+W7HOawlhOgzU= X-Received: by 2002:a17:902:24b:: with SMTP id 69mr76138487plc.250.1563870585552; Tue, 23 Jul 2019 01:29:45 -0700 (PDT) Received: from suzukaze.ipads-lab.se.sjtu.edu.cn ([89.31.126.54]) by smtp.gmail.com with ESMTPSA id x22sm46780579pff.5.2019.07.23.01.29.43 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 23 Jul 2019 01:29:45 -0700 (PDT) From: Chuhong Yuan Cc: Andy Shevchenko , Linus Walleij , Bartosz Golaszewski , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Chuhong Yuan Subject: [PATCH] gpio: Use dev_get_drvdata Date: Tue, 23 Jul 2019 16:29:34 +0800 Message-Id: <20190723082933.21134-1-hslester96@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Instead of using to_pci_dev + pci_get_drvdata, use dev_get_drvdata to make code simpler. Signed-off-by: Chuhong Yuan --- drivers/gpio/gpio-pch.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpio/gpio-pch.c b/drivers/gpio/gpio-pch.c index 1d99293096f2..3f3d9a94b709 100644 --- a/drivers/gpio/gpio-pch.c +++ b/drivers/gpio/gpio-pch.c @@ -409,8 +409,7 @@ static int pch_gpio_probe(struct pci_dev *pdev, static int __maybe_unused pch_gpio_suspend(struct device *dev) { - struct pci_dev *pdev = to_pci_dev(dev); - struct pch_gpio *chip = pci_get_drvdata(pdev); + struct pch_gpio *chip = dev_get_drvdata(dev); unsigned long flags; spin_lock_irqsave(&chip->spinlock, flags); @@ -422,8 +421,7 @@ static int __maybe_unused pch_gpio_suspend(struct device *dev) static int __maybe_unused pch_gpio_resume(struct device *dev) { - struct pci_dev *pdev = to_pci_dev(dev); - struct pch_gpio *chip = pci_get_drvdata(pdev); + struct pch_gpio *chip = dev_get_drvdata(dev); unsigned long flags; spin_lock_irqsave(&chip->spinlock, flags); -- 2.20.1