linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jean Delvare <jdelvare@suse.de>
To: Linux I2C <linux-i2c@vger.kernel.org>
Cc: "Volker Rümelin" <vr_qemu@t-online.de>,
	"Bjorn Helgaas" <helgaas@kernel.org>,
	"Vaibhav Gupta" <vaibhavgupta40@gmail.com>,
	"Wolfram Sang" <wsa@kernel.org>
Subject: [PATCH v2 2/2] i2c: i801: Simplify the suspend callback
Date: Tue, 1 Sep 2020 15:28:37 +0200	[thread overview]
Message-ID: <20200901152837.77bfcaaa@endymion> (raw)
In-Reply-To: <20200901152221.3cea0048@endymion>

We don't actually need to derive the PCI device from the device
structure, as we already have a pointer to it in our private data
structure.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
---
 drivers/i2c/busses/i2c-i801.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

This makes suspend and resume mostly symmetric again :-)

Changes since v1: New.

--- linux-5.8.orig/drivers/i2c/busses/i2c-i801.c	2020-09-01 12:37:04.226362935 +0200
+++ linux-5.8/drivers/i2c/busses/i2c-i801.c	2020-09-01 12:37:54.235979605 +0200
@@ -1958,10 +1958,9 @@ static void i801_shutdown(struct pci_dev
 #ifdef CONFIG_PM_SLEEP
 static int i801_suspend(struct device *dev)
 {
-	struct pci_dev *pci_dev = to_pci_dev(dev);
-	struct i801_priv *priv = pci_get_drvdata(pci_dev);
+	struct i801_priv *priv = dev_get_drvdata(dev);
 
-	pci_write_config_byte(pci_dev, SMBHSTCFG, priv->original_hstcfg);
+	pci_write_config_byte(priv->pci_dev, SMBHSTCFG, priv->original_hstcfg);
 	return 0;
 }
 

-- 
Jean Delvare
SUSE L3 Support

  reply	other threads:[~2020-09-01 13:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-01 13:22 [PATCH v2 1/2] i2c: i801: Fix resume bug Jean Delvare
2020-09-01 13:28 ` Jean Delvare [this message]
2020-09-14  7:03   ` [PATCH v2 2/2] i2c: i801: Simplify the suspend callback Wolfram Sang
2020-09-03 17:17 ` [PATCH v2 1/2] i2c: i801: Fix resume bug Jean Delvare
2020-09-06  8:00 ` Volker Rümelin
2020-09-10  7:09   ` Wolfram Sang
2020-09-10  9:32     ` Jean Delvare
2020-09-10  9:14   ` Jean Delvare
2020-09-14  7:03 ` Wolfram Sang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200901152837.77bfcaaa@endymion \
    --to=jdelvare@suse.de \
    --cc=helgaas@kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=vaibhavgupta40@gmail.com \
    --cc=vr_qemu@t-online.de \
    --cc=wsa@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).