* [PATCH v2 5/5] i2c: tegra: Remove suspension check
[not found] <1405608520-5644-1-git-send-email-hechtb@gmail.com>
@ 2014-07-17 14:48 ` Bastian Hecht
[not found] ` <1405608520-5644-5-git-send-email-hechtb-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Bastian Hecht @ 2014-07-17 14:48 UTC (permalink / raw)
To: linux-i2c
Cc: Linux-SH, Tomoya MORINAGA, Wolfram Sang, linux-arm-kernel,
Bastian Hecht, Laxman Dewangan, Stephen Warren, Thierry Reding,
open list:TEGRA ARCHITECTUR..., open list
We now take care of suspension in the i2c core code. So we can remove this
check here.
Signed-off-by: Bastian Hecht <hechtb@gmail.com>
---
same as v1
drivers/i2c/busses/i2c-tegra.c | 19 +------------------
1 file changed, 1 insertion(+), 18 deletions(-)
diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c
index f1bb2fc..c279d85 100644
--- a/drivers/i2c/busses/i2c-tegra.c
+++ b/drivers/i2c/busses/i2c-tegra.c
@@ -172,7 +172,6 @@ struct tegra_i2c_dev {
size_t msg_buf_remaining;
int msg_read;
u32 bus_clk_rate;
- bool is_suspended;
};
static void dvc_writel(struct tegra_i2c_dev *i2c_dev, u32 val, unsigned long reg)
@@ -628,9 +627,6 @@ static int tegra_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[],
int i;
int ret = 0;
- if (i2c_dev->is_suspended)
- return -EBUSY;
-
ret = tegra_i2c_clock_enable(i2c_dev);
if (ret < 0) {
dev_err(i2c_dev->dev, "Clock enable failed %d\n", ret);
@@ -817,17 +813,6 @@ static int tegra_i2c_remove(struct platform_device *pdev)
}
#ifdef CONFIG_PM_SLEEP
-static int tegra_i2c_suspend(struct device *dev)
-{
- struct tegra_i2c_dev *i2c_dev = dev_get_drvdata(dev);
-
- i2c_lock_adapter(&i2c_dev->adapter);
- i2c_dev->is_suspended = true;
- i2c_unlock_adapter(&i2c_dev->adapter);
-
- return 0;
-}
-
static int tegra_i2c_resume(struct device *dev)
{
struct tegra_i2c_dev *i2c_dev = dev_get_drvdata(dev);
@@ -842,14 +827,12 @@ static int tegra_i2c_resume(struct device *dev)
return ret;
}
- i2c_dev->is_suspended = false;
-
i2c_unlock_adapter(&i2c_dev->adapter);
return 0;
}
-static SIMPLE_DEV_PM_OPS(tegra_i2c_pm, tegra_i2c_suspend, tegra_i2c_resume);
+static SIMPLE_DEV_PM_OPS(tegra_i2c_pm, tegra_i2c_resume);
#define TEGRA_I2C_PM (&tegra_i2c_pm)
#else
#define TEGRA_I2C_PM NULL
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2 5/5] i2c: tegra: Remove suspension check
[not found] ` <1405608520-5644-5-git-send-email-hechtb-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2014-07-17 14:59 ` Thierry Reding
2014-07-17 16:52 ` Bastian Hecht
0 siblings, 1 reply; 3+ messages in thread
From: Thierry Reding @ 2014-07-17 14:59 UTC (permalink / raw)
To: Bastian Hecht
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA, Linux-SH, Tomoya MORINAGA,
Wolfram Sang, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
Laxman Dewangan, Stephen Warren, open list:TEGRA ARCHITECTUR...,
open list
[-- Attachment #1: Type: text/plain, Size: 962 bytes --]
On Thu, Jul 17, 2014 at 04:48:40PM +0200, Bastian Hecht wrote:
[...]
> #ifdef CONFIG_PM_SLEEP
> -static int tegra_i2c_suspend(struct device *dev)
> -{
> - struct tegra_i2c_dev *i2c_dev = dev_get_drvdata(dev);
> -
> - i2c_lock_adapter(&i2c_dev->adapter);
> - i2c_dev->is_suspended = true;
> - i2c_unlock_adapter(&i2c_dev->adapter);
> -
> - return 0;
> -}
> -
> static int tegra_i2c_resume(struct device *dev)
> {
> struct tegra_i2c_dev *i2c_dev = dev_get_drvdata(dev);
> @@ -842,14 +827,12 @@ static int tegra_i2c_resume(struct device *dev)
> return ret;
> }
>
> - i2c_dev->is_suspended = false;
> -
> i2c_unlock_adapter(&i2c_dev->adapter);
>
> return 0;
> }
>
> -static SIMPLE_DEV_PM_OPS(tegra_i2c_pm, tegra_i2c_suspend, tegra_i2c_resume);
> +static SIMPLE_DEV_PM_OPS(tegra_i2c_pm, tegra_i2c_resume);
Shouldn't this be:
static SIMPLE_DEV_OPS(tegra_i2c_pm, NULL, tegra_i2c_resume);
instead?
Thierry
[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2 5/5] i2c: tegra: Remove suspension check
2014-07-17 14:59 ` Thierry Reding
@ 2014-07-17 16:52 ` Bastian Hecht
0 siblings, 0 replies; 3+ messages in thread
From: Bastian Hecht @ 2014-07-17 16:52 UTC (permalink / raw)
To: Thierry Reding
Cc: Stephen Warren, Wolfram Sang, Linux-SH, Tomoya MORINAGA,
open list, Laxman Dewangan, linux-i2c,
open list:TEGRA ARCHITECTUR...,
linux-arm-kernel@lists.infradead.org
2014-07-17 16:59 GMT+02:00 Thierry Reding <thierry.reding@gmail.com>:
> On Thu, Jul 17, 2014 at 04:48:40PM +0200, Bastian Hecht wrote:
> [...]
>> #ifdef CONFIG_PM_SLEEP
>> -static int tegra_i2c_suspend(struct device *dev)
>> -{
>> - struct tegra_i2c_dev *i2c_dev = dev_get_drvdata(dev);
>> -
>> - i2c_lock_adapter(&i2c_dev->adapter);
>> - i2c_dev->is_suspended = true;
>> - i2c_unlock_adapter(&i2c_dev->adapter);
>> -
>> - return 0;
>> -}
>> -
>> static int tegra_i2c_resume(struct device *dev)
>> {
>> struct tegra_i2c_dev *i2c_dev = dev_get_drvdata(dev);
>> @@ -842,14 +827,12 @@ static int tegra_i2c_resume(struct device *dev)
>> return ret;
>> }
>>
>> - i2c_dev->is_suspended = false;
>> -
>> i2c_unlock_adapter(&i2c_dev->adapter);
>>
>> return 0;
>> }
>>
>> -static SIMPLE_DEV_PM_OPS(tegra_i2c_pm, tegra_i2c_suspend, tegra_i2c_resume);
>> +static SIMPLE_DEV_PM_OPS(tegra_i2c_pm, tegra_i2c_resume);
>
> Shouldn't this be:
>
> static SIMPLE_DEV_OPS(tegra_i2c_pm, NULL, tegra_i2c_resume);
>
> instead?
Oh yes thanks. I made the same mistake in [PATCH 3/5] too.
Thanks,
Bastian
> Thierry
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-07-17 16:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1405608520-5644-1-git-send-email-hechtb@gmail.com>
2014-07-17 14:48 ` [PATCH v2 5/5] i2c: tegra: Remove suspension check Bastian Hecht
[not found] ` <1405608520-5644-5-git-send-email-hechtb-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-07-17 14:59 ` Thierry Reding
2014-07-17 16:52 ` Bastian Hecht
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox