Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp867782imu; Tue, 11 Dec 2018 08:47:04 -0800 (PST) X-Google-Smtp-Source: AFSGD/UtqlivyHEzAWI9ZE1YOzUaXGMCRf7lhaNXjmOdz+XQAz91skzESdFNnrfDN+wUIaFwtxDH X-Received: by 2002:a17:902:50e3:: with SMTP id c32mr16906343plj.318.1544546824913; Tue, 11 Dec 2018 08:47:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544546824; cv=none; d=google.com; s=arc-20160816; b=f16qz9cHYsZ6f9nmv4cY9dT/EwnsOD5xdMS0OthGUtsWCOmvLJG9pUZloM3QrKnbWb 9rdKXn+uYP5UshlFFn+BThplKW3y5nprkRtT9nv09X20WTAxU1Jac9PcsbE0jSRYVWxW tOoSogn7ZbL6KmFKnVwGmMU2w3KbGlEbIAvOJIgMAhsIiW58Fc1cRGLK8FB+rQXpoujW 8Brn+zyLsJrJnituu8Yr3YZEjs8kZrGezl2lm7JLb6isvoxCSKpapkX6H2fseyRc6vJG YqsXuLYItCH/oxsGBdJoa5gUvyLY7G0IYB1i21oSrr/E1iIXicFcDKr32rFKL1ghhji/ r8tQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=DwyPkcVNlLZnkFsH0IBvFgeaelucitRwz/cnxhMyq00=; b=w793VWIOcbyPVkReLH83s1ihlb6z/S8PmMfD7pL0OjamufYKwBIHXpsKGGWiLvQNbY 6JyzQ6qzx7knQGfO47P47WcBPWXqiuQzi0HOO4fyTLRfPTNuADe4lyBkPT2A8ZCmUeDL GLK81iVA5WuiMkAxnqoeIr7krmZAr17hppXQfrB8gHLRRhaGyaH56JSRSPMUS0JcT56i 2LrMLimxLKrRCgmhm7VpM4Vl5QZ1XmlhAIf8Nz99vkpupGVhenjYmjIepYtn+n2ASDvm Y5+gu3fsLLX7mQs9c1LKRXuQSjLy2HyDuhHkGOP902OUydin6PUuiRx0dp5wxt7hOGB+ BQsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OcNWtioe; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x8si12602993pll.187.2018.12.11.08.46.49; Tue, 11 Dec 2018 08:47:04 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OcNWtioe; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727987AbeLKQoX (ORCPT + 99 others); Tue, 11 Dec 2018 11:44:23 -0500 Received: from mail-it1-f193.google.com ([209.85.166.193]:38765 "EHLO mail-it1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727400AbeLKQoX (ORCPT ); Tue, 11 Dec 2018 11:44:23 -0500 Received: by mail-it1-f193.google.com with SMTP id h65so4867916ith.3; Tue, 11 Dec 2018 08:44:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=DwyPkcVNlLZnkFsH0IBvFgeaelucitRwz/cnxhMyq00=; b=OcNWtioevuvc/8nzGgqOOYaIHMqoBT6YJ2NyNbql7RMuuxhL4oV92ktm8oRmQnUeIG wu+lLgmvB9xMGXFdQsHo8M2mx3yzMuu2aqVH3iec43sjq6rrdbM2cEGBu5pw3bfMPnXE m3gXAzkzLSipA7Njzg8vduGttGwauGeMi3MGnkoFa0iBjSoQWuJ4lfDEshT+KDbTBz20 uswk+V0hIyoh40gz15/V25colYk6DlMJ5dVylZU5NRN3fhBYBhESBBcaylxHsR6U83qp TIHpswi79HBhZWqQX3MD8RU2zYCizeJYDdZ6ynCTDzUqZnQ+ggrITAvsleIPYG2nEg23 PiuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=DwyPkcVNlLZnkFsH0IBvFgeaelucitRwz/cnxhMyq00=; b=qFzEIfVpQ38Z9fV0yhdph44OB8WMsETkP2UQWHrbzDLKw3h6yKjUqLSVS7HXilMdMk GHzWO7fQoRh5wuRXSVfmBwvxG90NPw1ymPHSeBAm050JEV1Hi4wMcu6x09/yz8ba+HaR yhSHqnmXZ5O4OISvejrFnvTnm8ITeyMeRx5tMhA5iJH9HFVAwXtH76WeTMvQlRe+bh7v Z8fWf8m3VirSexNHM5PJ0I8jCOp6BcJUwkQ+fGrEfxViyYgjjXiiRFDi0D6jSmJiB4lZ r5iEQgpp78dAsd2xeSi0n0jHGSn8H4Vs891xnMGRh/AVzrl8tGD32g7GaP2idoMWRRq7 KfSA== X-Gm-Message-State: AA+aEWZHH1CVTMeLsDJ3bdsXbSyxs37M7UvcpZrLBEThJDQPoCjkh3Ks /PP9RgyacGheyWJzuSzRQjlt7tKCLGEmxufqnXY= X-Received: by 2002:a24:a701:: with SMTP id a1mr2731659itf.7.1544546661714; Tue, 11 Dec 2018 08:44:21 -0800 (PST) MIME-Version: 1.0 References: <20181210210310.12677-1-wsa+renesas@sang-engineering.com> <20181210210310.12677-5-wsa+renesas@sang-engineering.com> In-Reply-To: <20181210210310.12677-5-wsa+renesas@sang-engineering.com> From: Kamal Dasu Date: Tue, 11 Dec 2018 11:44:01 -0500 Message-ID: Subject: Re: [RFC/RFT 04/10] i2c: brcmstb: use core helper to mark adapter suspended To: wsa+renesas@sang-engineering.com Cc: linux-i2c@vger.kernel.org, linux-renesas-soc@vger.kernel.org, hdegoede@redhat.com, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Brian Norris , Gregory Fong , Florian Fainelli , bcm-kernel-feedback-list@broadcom.com, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 10, 2018 at 4:03 PM Wolfram Sang wrote: > > Rejecting transfers should be handled by the core. > > Signed-off-by: Wolfram Sang Reviewed-by: Kamal Dasu > --- > drivers/i2c/busses/i2c-brcmstb.c | 13 ++----------- > 1 file changed, 2 insertions(+), 11 deletions(-) > > diff --git a/drivers/i2c/busses/i2c-brcmstb.c b/drivers/i2c/busses/i2c-brcmstb.c > index 826d32049996..05c822e5a3f6 100644 > --- a/drivers/i2c/busses/i2c-brcmstb.c > +++ b/drivers/i2c/busses/i2c-brcmstb.c > @@ -170,7 +170,6 @@ struct brcmstb_i2c_dev { > struct bsc_regs *bsc_regmap; > struct i2c_adapter adapter; > struct completion done; > - bool is_suspended; > u32 clk_freq_hz; > int data_regsz; > }; > @@ -467,9 +466,6 @@ static int brcmstb_i2c_xfer(struct i2c_adapter *adapter, > int xfersz = brcmstb_i2c_get_xfersz(dev); > u32 cond, cond_per_msg; > > - if (dev->is_suspended) > - return -EBUSY; > - > /* Loop through all messages */ > for (i = 0; i < num; i++) { > pmsg = &msgs[i]; > @@ -689,10 +685,7 @@ static int brcmstb_i2c_suspend(struct device *dev) > { > struct brcmstb_i2c_dev *i2c_dev = dev_get_drvdata(dev); > > - i2c_lock_bus(&i2c_dev->adapter, I2C_LOCK_ROOT_ADAPTER); > - i2c_dev->is_suspended = true; > - i2c_unlock_bus(&i2c_dev->adapter, I2C_LOCK_ROOT_ADAPTER); > - > + i2c_mark_adapter_suspended(&i2c_dev->adapter, true); > return 0; > } > > @@ -700,10 +693,8 @@ static int brcmstb_i2c_resume(struct device *dev) > { > struct brcmstb_i2c_dev *i2c_dev = dev_get_drvdata(dev); > > - i2c_lock_bus(&i2c_dev->adapter, I2C_LOCK_ROOT_ADAPTER); > brcmstb_i2c_set_bsc_reg_defaults(i2c_dev); > - i2c_dev->is_suspended = false; > - i2c_unlock_bus(&i2c_dev->adapter, I2C_LOCK_ROOT_ADAPTER); > + i2c_mark_adapter_suspended(&i2c_dev->adapter, false); > > return 0; > } > -- > 2.11.0 >