Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4097866imu; Mon, 10 Dec 2018 13:06:23 -0800 (PST) X-Google-Smtp-Source: AFSGD/Xe/eQa7zWglhCe5AGpOV6fjERNe+a6Qdx/I+vOQZEZHhW2aMe1Ql8GaoFf1K7nv9d5APBR X-Received: by 2002:a17:902:a601:: with SMTP id u1mr13518850plq.77.1544475983550; Mon, 10 Dec 2018 13:06:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544475983; cv=none; d=google.com; s=arc-20160816; b=JXeDdFG+jw2bftoDZenuuHow7UwGhiD8+2ukoYjZSCP2KKYzmEhC3RTEQ7OTHGXp9V LVZtqp6JaiwXioIrxumBd438Tw13GKpNBzAbnLUHhsBwNMva8gkxxkGHONTxcFDKFBZr qk8j5I8yithMK/hURLqInvzO7U6xyTqdWOB5HTtXV7awn9HbUAU00DBWatZPknq7DX1S pPgV5+Z1L+EOCYrX4Ijiqo9izJvu9ZCQmSJ95WWH33pEZxRxsO333yLNUGccmSoeKe4z GcQ0ct8aT8cjVkLufLXrnsqHRyZujrYsQf/rG+dLyfPUgo22RSAXw68wbCS9/jigUMAx GJtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=IlbizJFVGaTN4la8SBQai0JJ8I6iGuZ+oExZYE4TjRU=; b=e+ThpcUzGOV5raJp9KTqo+3A9zqe0HSxRB6FcXr79Suh1jQlo7NXVKYHP2+H/IuKJs 5ljnLYg6yXZTGTwLoe+lBAnkZzHhH4DOzMn7LcHau9dc47u6vsFUAQuDAcGA3Y/fq+QP Ise8gzGVmLgMac0oFUoN7Qe+H1C/Od90a1FxVNqxcMezo/NSbWDyiGaqqXURHREKTTY4 rXR5Y171igHYNP4TYrlub8ni5Lpt1kzzy/6khkr8sc37QijxoXCRYDKLVZcpUGmujtOd zOQcutT2m0K8Q+2/dQ2f6qsTZMPwSnRE0KMjB0+V9nOLtiix7OhrgkMzpQDQkeOKWr0f Vayg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z71si9816974pgd.490.2018.12.10.13.06.07; Mon, 10 Dec 2018 13:06:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730021AbeLJVDs (ORCPT + 99 others); Mon, 10 Dec 2018 16:03:48 -0500 Received: from sauhun.de ([88.99.104.3]:36754 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729929AbeLJVDV (ORCPT ); Mon, 10 Dec 2018 16:03:21 -0500 Received: from localhost (p54B335CF.dip0.t-ipconnect.de [84.179.53.207]) by pokefinder.org (Postfix) with ESMTPSA id 8AF7D4C3C81; Mon, 10 Dec 2018 22:03:19 +0100 (CET) From: Wolfram Sang To: linux-i2c@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, Hans de Goede , linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Wolfram Sang , Kukjin Kim , Krzysztof Kozlowski , linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC/RFT 09/10] i2c: s3c2410: use core helper to mark adapter suspended Date: Mon, 10 Dec 2018 22:03:07 +0100 Message-Id: <20181210210310.12677-10-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20181210210310.12677-1-wsa+renesas@sang-engineering.com> References: <20181210210310.12677-1-wsa+renesas@sang-engineering.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Rejecting transfers should be handled by the core. Also, this will ensure proper locking which was forgotten in this open coded version. Signed-off-by: Wolfram Sang --- drivers/i2c/busses/i2c-s3c2410.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c index 2f2e28d60ef5..7c76edb25514 100644 --- a/drivers/i2c/busses/i2c-s3c2410.c +++ b/drivers/i2c/busses/i2c-s3c2410.c @@ -104,7 +104,6 @@ enum s3c24xx_i2c_state { struct s3c24xx_i2c { wait_queue_head_t wait; kernel_ulong_t quirks; - unsigned int suspended:1; struct i2c_msg *msg; unsigned int msg_num; @@ -703,9 +702,6 @@ static int s3c24xx_i2c_doxfer(struct s3c24xx_i2c *i2c, unsigned long timeout; int ret; - if (i2c->suspended) - return -EIO; - ret = s3c24xx_i2c_set_master(i2c); if (ret != 0) { dev_err(i2c->dev, "cannot get bus (error %d)\n", ret); @@ -1246,7 +1242,7 @@ static int s3c24xx_i2c_suspend_noirq(struct device *dev) { struct s3c24xx_i2c *i2c = dev_get_drvdata(dev); - i2c->suspended = 1; + i2c_mark_adapter_suspended(&i2c->adap, true); if (!IS_ERR(i2c->sysreg)) regmap_read(i2c->sysreg, EXYNOS5_SYS_I2C_CFG, &i2c->sys_i2c_cfg); @@ -1267,7 +1263,7 @@ static int s3c24xx_i2c_resume_noirq(struct device *dev) return ret; s3c24xx_i2c_init(i2c); clk_disable(i2c->clk); - i2c->suspended = 0; + i2c_mark_adapter_suspended(&i2c->adap, false); return 0; } -- 2.11.0