From: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
To: linux-i2c@vger.kernel.org
Cc: soren.brinkmann@xilinx.com, michal.simek@xilinx.com,
anirudh@xilinx.com, wsa@the-dreams.de,
Shubhrajyoti Datta <shubhraj@xilinx.com>
Subject: [PATCHv3 2/2] i2c: cadence: Remove the suspended flag
Date: Tue, 24 Nov 2015 13:01:57 +0530 [thread overview]
Message-ID: <1448350317-37077-2-git-send-email-shubhraj@xilinx.com> (raw)
In-Reply-To: <1448350317-37077-1-git-send-email-shubhraj@xilinx.com>
The suspended flag is a flag holding the device's PM status.
The runtime framework does that for us.
Use pm_runtime_suspended call instead.
Signed-off-by: Shubhrajyoti Datta <shubhraj@xilinx.com>
---
v3: split the patches
drivers/i2c/busses/i2c-cadence.c | 7 +------
1 files changed, 1 insertions(+), 6 deletions(-)
diff --git a/drivers/i2c/busses/i2c-cadence.c b/drivers/i2c/busses/i2c-cadence.c
index d54ad46..6b08d16 100644
--- a/drivers/i2c/busses/i2c-cadence.c
+++ b/drivers/i2c/busses/i2c-cadence.c
@@ -131,7 +131,6 @@
* @xfer_done: Transfer complete status
* @p_send_buf: Pointer to transmit buffer
* @p_recv_buf: Pointer to receive buffer
- * @suspended: Flag holding the device's PM status
* @send_count: Number of bytes still expected to send
* @recv_count: Number of bytes still expected to receive
* @curr_recv_count: Number of bytes to be received in current transfer
@@ -152,7 +151,6 @@ struct cdns_i2c {
struct completion xfer_done;
unsigned char *p_send_buf;
unsigned char *p_recv_buf;
- u8 suspended;
unsigned int send_count;
unsigned int recv_count;
unsigned int curr_recv_count;
@@ -776,7 +774,7 @@ static int cdns_i2c_clk_notifier_cb(struct notifier_block *nb, unsigned long
struct clk_notifier_data *ndata = data;
struct cdns_i2c *id = to_cdns_i2c(nb);
- if (id->suspended)
+ if (pm_runtime_suspended(id->dev))
return NOTIFY_OK;
switch (event) {
@@ -830,7 +828,6 @@ static int __maybe_unused cdns_i2c_runtime_suspend(struct device *dev)
struct cdns_i2c *xi2c = platform_get_drvdata(pdev);
clk_disable(xi2c->clk);
- xi2c->suspended = 1;
return 0;
}
@@ -855,8 +852,6 @@ static int __maybe_unused cdns_i2c_runtime_resume(struct device *dev)
return ret;
}
- xi2c->suspended = 0;
-
return 0;
}
--
1.7.1
next prev parent reply other threads:[~2015-11-24 7:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-24 7:31 [PATCHv3 1/2] i2c: cadence: Move to sensible power management Shubhrajyoti Datta
2015-11-24 7:31 ` Shubhrajyoti Datta [this message]
2015-11-30 20:10 ` [PATCHv3 2/2] i2c: cadence: Remove the suspended flag Wolfram Sang
2015-11-30 20:10 ` [PATCHv3 1/2] i2c: cadence: Move to sensible power management 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=1448350317-37077-2-git-send-email-shubhraj@xilinx.com \
--to=shubhrajyoti.datta@xilinx.com \
--cc=anirudh@xilinx.com \
--cc=linux-i2c@vger.kernel.org \
--cc=michal.simek@xilinx.com \
--cc=shubhraj@xilinx.com \
--cc=soren.brinkmann@xilinx.com \
--cc=wsa@the-dreams.de \
/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).