From patchwork Tue Nov 24 07:31:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubhrajyoti Datta X-Patchwork-Id: 547870 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 6C8AB1402A2 for ; Tue, 24 Nov 2015 18:47:33 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752238AbbKXHrc (ORCPT ); Tue, 24 Nov 2015 02:47:32 -0500 Received: from mail-bl2nam02on0087.outbound.protection.outlook.com ([104.47.38.87]:15271 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751714AbbKXHrc (ORCPT ); Tue, 24 Nov 2015 02:47:32 -0500 Received: from BL2NAM02FT030.eop-nam02.prod.protection.outlook.com (10.152.76.51) by BL2NAM02HT078.eop-nam02.prod.protection.outlook.com (10.152.76.166) with Microsoft SMTP Server (TLS) id 15.1.337.8; Tue, 24 Nov 2015 07:32:16 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by BL2NAM02FT030.mail.protection.outlook.com (10.152.77.172) with Microsoft SMTP Server (TLS) id 15.1.337.8 via Frontend Transport; Tue, 24 Nov 2015 07:32:16 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1a185H-0008At-OG; Mon, 23 Nov 2015 23:32:15 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1a185H-00005f-ER; Mon, 23 Nov 2015 23:32:15 -0800 Received: from xsj-pvapsmtp01 (mailman.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id tAO7W34D029752; Mon, 23 Nov 2015 23:32:03 -0800 Received: from [172.23.146.171] (helo=xhdl3763.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1a1852-0008MQ-8C; Mon, 23 Nov 2015 23:32:01 -0800 Received: by xhdl3763.xilinx.com (Postfix, from userid 9049) id 55FDE2CE04DF; Tue, 24 Nov 2015 13:01:59 +0530 (IST) From: Shubhrajyoti Datta To: CC: , , , , Shubhrajyoti Datta Subject: [PATCHv3 2/2] i2c: cadence: Remove the suspended flag Date: Tue, 24 Nov 2015 13:01:57 +0530 Message-ID: <1448350317-37077-2-git-send-email-shubhraj@xilinx.com> X-Mailer: git-send-email 2.1.2 In-Reply-To: <1448350317-37077-1-git-send-email-shubhraj@xilinx.com> References: <1448350317-37077-1-git-send-email-shubhraj@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.0.0.1202-21958.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:149.199.60.83; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(438002)(199003)(189002)(46386002)(5003940100001)(50986999)(50466002)(76176999)(92566002)(103686003)(86362001)(229853001)(36756003)(52956003)(4001430100002)(45336002)(5007970100001)(19580405001)(5008740100001)(586003)(6806005)(19580395003)(90966002)(47776003)(11100500001)(87936001)(106466001)(50226001)(2351001)(81156007)(110136002)(189998001)(107886002)(33646002)(63266004)(48376002)(42186005)(2950100001)(5001920100001)(5001960100002)(36386004)(107986001); DIR:OUT; SFP:1101; SCL:1; SRVR:BL2NAM02HT078; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; PTR:unknown-60-83.xilinx.com; A:1; MX:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501001); SRVR:BL2NAM02HT078; X-Microsoft-Antispam-PRVS: <9483724c999646ffae349e04656a4fc6@BL2NAM02HT078.eop-nam02.prod.protection.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(520078)(8121501046)(5005006)(3002001)(10201501046); SRVR:BL2NAM02HT078; BCL:0; PCL:0; RULEID:; SRVR:BL2NAM02HT078; X-Forefront-PRVS: 0770F75EA9 X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Nov 2015 07:32:16.6244 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2NAM02HT078 Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org 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 --- 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; }