* [PATCH] i2c: busses: Use dev_get_drvdata where possible
@ 2019-07-23 11:11 Chuhong Yuan
2019-07-23 18:34 ` Jean Delvare
0 siblings, 1 reply; 3+ messages in thread
From: Chuhong Yuan @ 2019-07-23 11:11 UTC (permalink / raw)
Cc: Jarkko Nikula, Jean Delvare, linux-i2c, linux-kernel,
Chuhong Yuan
Instead of using to_pci_dev + pci_get_drvdata,
use dev_get_drvdata to make code simpler.
Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
---
drivers/i2c/busses/i2c-designware-pcidrv.c | 6 ++----
drivers/i2c/busses/i2c-i801.c | 3 +--
2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/i2c/busses/i2c-designware-pcidrv.c b/drivers/i2c/busses/i2c-designware-pcidrv.c
index 76810deb2de6..7d2e6959679c 100644
--- a/drivers/i2c/busses/i2c-designware-pcidrv.c
+++ b/drivers/i2c/busses/i2c-designware-pcidrv.c
@@ -173,8 +173,7 @@ static struct dw_pci_controller dw_pci_controllers[] = {
#ifdef CONFIG_PM
static int i2c_dw_pci_suspend(struct device *dev)
{
- struct pci_dev *pdev = to_pci_dev(dev);
- struct dw_i2c_dev *i_dev = pci_get_drvdata(pdev);
+ struct dw_i2c_dev *i_dev = dev_get_drvdata(dev);
i_dev->suspended = true;
i_dev->disable(i_dev);
@@ -184,8 +183,7 @@ static int i2c_dw_pci_suspend(struct device *dev)
static int i2c_dw_pci_resume(struct device *dev)
{
- struct pci_dev *pdev = to_pci_dev(dev);
- struct dw_i2c_dev *i_dev = pci_get_drvdata(pdev);
+ struct dw_i2c_dev *i_dev = dev_get_drvdata(dev);
int ret;
ret = i_dev->init(i_dev);
diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
index f2956936c3f2..a6469978e735 100644
--- a/drivers/i2c/busses/i2c-i801.c
+++ b/drivers/i2c/busses/i2c-i801.c
@@ -1912,8 +1912,7 @@ static int i801_suspend(struct device *dev)
static int i801_resume(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);
i801_enable_host_notify(&priv->adapter);
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] i2c: busses: Use dev_get_drvdata where possible
2019-07-23 11:11 [PATCH] i2c: busses: Use dev_get_drvdata where possible Chuhong Yuan
@ 2019-07-23 18:34 ` Jean Delvare
2019-07-29 13:23 ` Jarkko Nikula
0 siblings, 1 reply; 3+ messages in thread
From: Jean Delvare @ 2019-07-23 18:34 UTC (permalink / raw)
To: Chuhong Yuan; +Cc: Jarkko Nikula, linux-i2c, linux-kernel
On Tue, 23 Jul 2019 19:11:10 +0800, Chuhong Yuan wrote:
> Instead of using to_pci_dev + pci_get_drvdata,
> use dev_get_drvdata to make code simpler.
>
> Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
> ---
> drivers/i2c/busses/i2c-designware-pcidrv.c | 6 ++----
> drivers/i2c/busses/i2c-i801.c | 3 +--
> 2 files changed, 3 insertions(+), 6 deletions(-)
> (...)
Looks good to me, thanks.
Reviewed-by: Jean Delvare <jdelvare@suse.de>
--
Jean Delvare
SUSE L3 Support
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] i2c: busses: Use dev_get_drvdata where possible
2019-07-23 18:34 ` Jean Delvare
@ 2019-07-29 13:23 ` Jarkko Nikula
0 siblings, 0 replies; 3+ messages in thread
From: Jarkko Nikula @ 2019-07-29 13:23 UTC (permalink / raw)
To: Jean Delvare, Chuhong Yuan; +Cc: linux-i2c, linux-kernel
On 7/23/19 9:34 PM, Jean Delvare wrote:
> On Tue, 23 Jul 2019 19:11:10 +0800, Chuhong Yuan wrote:
>> Instead of using to_pci_dev + pci_get_drvdata,
>> use dev_get_drvdata to make code simpler.
>>
>> Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
>> ---
>> drivers/i2c/busses/i2c-designware-pcidrv.c | 6 ++----
>> drivers/i2c/busses/i2c-i801.c | 3 +--
>> 2 files changed, 3 insertions(+), 6 deletions(-)
>> (...)
>
> Looks good to me, thanks.
>
> Reviewed-by: Jean Delvare <jdelvare@suse.de>
>
For the i2c-designware-pcidrv.c
Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-07-29 13:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-23 11:11 [PATCH] i2c: busses: Use dev_get_drvdata where possible Chuhong Yuan
2019-07-23 18:34 ` Jean Delvare
2019-07-29 13:23 ` Jarkko Nikula
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).