Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4098470imu; Mon, 10 Dec 2018 13:06:59 -0800 (PST) X-Google-Smtp-Source: AFSGD/XozNtlibP3VAOcSpZ5C9fPTwKBXs4QVpTtKQQrwznhV9nRaqBBGVLTYJ9z9bmAMtGjhzLk X-Received: by 2002:a62:9913:: with SMTP id d19mr13795818pfe.107.1544476019023; Mon, 10 Dec 2018 13:06:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544476018; cv=none; d=google.com; s=arc-20160816; b=lWRcKHyCk9rinQgbRHyRLNv6zPjJrm8b/7ogZSLnAVGqzQAw/a8Gtsa4JXpFgKwxaP h/dm+DxXI53VTPTW+lj4b7v70+yHLcKO+xn4mquHIh32dVP/lEY8hAXEegX4uG49UpHw 4ibBhFmzAJjOGUnNI/shtXHH7ynv2nI+dbTl8j8EuGalRJj+9bq/spS0rkvMb3pysqIJ G1fNzbj2MfaXL96LdJHnfVZHiWTi2dpBTxpwTEggtbK12mjQwgFebTddDF98tB4BVQvV dkxc9hXgpP6qj329JQROUFKlDFxOJNFKzsMcuqIYneoCr22v+T+8l8T7bqRabC5RD9lw f1Nw== 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=VqYrg1a39oHQruswhVp3adm4UChlxS+ShuONZrCHCFs=; b=cvDIdzqAQ/W8ypfD18fCtogdMJk5U0DLOgsUVHY0SDHbBGXW/tpRJbWBwEcwmnys4V mClOvMSn1DWABXAM6B/SMnatS9m+AWgIGPBBuLwzKNRIqaTqsX8yqWsSzic9KZjvO1Rb DX6cC8fwaRAKtQVPMxc5sG1aTmSvQuvaXzNYKc+bwE50Q+woF1kxMrB5R/mzjeMWWN58 HdBsnZeCuhbvVmmJnagI3OEUdd6zy9+qxaTxKFXgi1G1YjB8F8fZmC71FPcdUIbwHw41 n3Whleb+Kbim28xzxuPmeW3unPRRqte+3FLw4W62eRhxjbKyMu3PmMEeH+ST/ICBK/4r sX4g== 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 q7si11489903pfa.99.2018.12.10.13.06.43; Mon, 10 Dec 2018 13:06:58 -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 S1730033AbeLJVDt (ORCPT + 99 others); Mon, 10 Dec 2018 16:03:49 -0500 Received: from sauhun.de ([88.99.104.3]:36750 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729928AbeLJVDU (ORCPT ); Mon, 10 Dec 2018 16:03:20 -0500 Received: from localhost (p54B335CF.dip0.t-ipconnect.de [84.179.53.207]) by pokefinder.org (Postfix) with ESMTPSA id CF0C64C3C7D; Mon, 10 Dec 2018 22:03:18 +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 08/10] i2c: exynos5: use core helper to mark adapter suspended Date: Mon, 10 Dec 2018 22:03:06 +0100 Message-Id: <20181210210310.12677-9-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-exynos5.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/i2c/busses/i2c-exynos5.c b/drivers/i2c/busses/i2c-exynos5.c index c1ce2299a76e..fe2f2031ea36 100644 --- a/drivers/i2c/busses/i2c-exynos5.c +++ b/drivers/i2c/busses/i2c-exynos5.c @@ -183,7 +183,6 @@ enum i2c_type_exynos { struct exynos5_i2c { struct i2c_adapter adap; - unsigned int suspended:1; struct i2c_msg *msg; struct completion msg_complete; @@ -715,11 +714,6 @@ static int exynos5_i2c_xfer(struct i2c_adapter *adap, struct exynos5_i2c *i2c = adap->algo_data; int i, ret; - if (i2c->suspended) { - dev_err(i2c->dev, "HS-I2C is not initialized.\n"); - return -EIO; - } - ret = clk_enable(i2c->clk); if (ret) return ret; @@ -847,8 +841,7 @@ static int exynos5_i2c_suspend_noirq(struct device *dev) { struct exynos5_i2c *i2c = dev_get_drvdata(dev); - i2c->suspended = 1; - + i2c_mark_adapter_suspended(&i2c->adap, true); clk_unprepare(i2c->clk); return 0; @@ -871,7 +864,7 @@ static int exynos5_i2c_resume_noirq(struct device *dev) exynos5_i2c_init(i2c); clk_disable(i2c->clk); - i2c->suspended = 0; + i2c_mark_adapter_suspended(&i2c->adap, false); return 0; } -- 2.11.0