Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1162486ybi; Sat, 8 Jun 2019 03:58:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqzKqjHxyftq6uMc5nQt3vKgpYKkOtX9+mfrOpSkcC4Goix4EEkZsGan0vf1DZXobAvq6adX X-Received: by 2002:a17:902:5c2:: with SMTP id f60mr60404524plf.61.1559991526966; Sat, 08 Jun 2019 03:58:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559991526; cv=none; d=google.com; s=arc-20160816; b=aD+islIRii7zm4nXlWmvmOcIR03woBvY/xrxW9KBZlcZXfdYqumRtQWbyPlm2MUWyA yOyz5iIsU9LehEMfhdYQvQz+Mu+PVODiAHqX7tD53kyyXzl8OF3nx1ZxwMQq8d6mqoVX WHCWA8XufAcbFl+ZPBdykwo4okOrr8t0sCSm635bPYgnsLqmHooAdCaWzStNT5IdFBs7 NI8PWjNBjiRbZO4ph8/kwI913ngtrp7rTfOuA3wW/uBedHzmwVTwLpO0hkbvIqfnjFIy mLzR3nshS1G4jWfaaVYKi1NcWF/PwUkHTygjELC11jRE3hHYb9ZZfKcR6uM12Z8v8q0t aFMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=grl4Y+8AszQbb/yd7oucgjl3ckU33+mTBMGF9ffB0pU=; b=YVdCYdk0MzFY8vszuP0WRcSyI/OR9tEsXxf1YVhQNFkf1zsY4xfN20L+U1TpN1UUVJ 4aZXk1n9FE1Gdbnb1eL7xiqxDmDm6xrivTZGWHUX3O/PmiT1BcU3ZaGqYlWlMg7KZ8Hg EqNmmbRk+MslY5b4dCxDSR2h+6tb/4wUqEp+MBxIsgR0HWqqJ8QmtDdlvNg49RKI89I3 niYG1m5ZxMhsESUg08se4Fe43bCbYk0aaX8rnF5MolAfC00Hzytewt7jmlbGBpYgnkFN pKV4IwJXtwjK5lglBS/swTIx/8jn4t+nlpxOhBseAbsXc8YNY2vN2W5Qk4cvve69E6Bd ywuA== 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 b38si1122965pla.65.2019.06.08.03.58.31; Sat, 08 Jun 2019 03:58:46 -0700 (PDT) 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 S1727234AbfFHK5C (ORCPT + 99 others); Sat, 8 Jun 2019 06:57:02 -0400 Received: from sauhun.de ([88.99.104.3]:51934 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727134AbfFHK44 (ORCPT ); Sat, 8 Jun 2019 06:56:56 -0400 Received: from localhost (p5486CBCC.dip0.t-ipconnect.de [84.134.203.204]) by pokefinder.org (Postfix) with ESMTPSA id AD80A3E4788; Sat, 8 Jun 2019 12:56:54 +0200 (CEST) From: Wolfram Sang To: linux-i2c@vger.kernel.org Cc: Wolfram Sang , Alessandro Zummo , Alexandre Belloni , linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 26/34] rtc: fm3130: simplify getting the adapter of a client Date: Sat, 8 Jun 2019 12:56:05 +0200 Message-Id: <20190608105619.593-27-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190608105619.593-1-wsa+renesas@sang-engineering.com> References: <20190608105619.593-1-wsa+renesas@sang-engineering.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We have a dedicated pointer for that, so use it. Much easier to read and less computation involved. Signed-off-by: Wolfram Sang --- Please apply to your subsystem tree. drivers/rtc/rtc-fm3130.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/rtc/rtc-fm3130.c b/drivers/rtc/rtc-fm3130.c index e1137670d4d2..015cf639166e 100644 --- a/drivers/rtc/rtc-fm3130.c +++ b/drivers/rtc/rtc-fm3130.c @@ -107,8 +107,7 @@ static int fm3130_get_time(struct device *dev, struct rtc_time *t) fm3130_rtc_mode(dev, FM3130_MODE_READ); /* read the RTC date and time registers all at once */ - tmp = i2c_transfer(to_i2c_adapter(fm3130->client->dev.parent), - fm3130->msg, 2); + tmp = i2c_transfer(fm3130->client->adapter, fm3130->msg, 2); if (tmp != 2) { dev_err(dev, "%s error %d\n", "read", tmp); return -EIO; @@ -200,8 +199,7 @@ static int fm3130_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) } /* read the RTC alarm registers all at once */ - tmp = i2c_transfer(to_i2c_adapter(fm3130->client->dev.parent), - &fm3130->msg[2], 2); + tmp = i2c_transfer(fm3130->client->adapter, &fm3130->msg[2], 2); if (tmp != 2) { dev_err(dev, "%s error %d\n", "read", tmp); return -EIO; @@ -351,7 +349,7 @@ static int fm3130_probe(struct i2c_client *client, struct fm3130 *fm3130; int err = -ENODEV; int tmp; - struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); + struct i2c_adapter *adapter = client->adapter; if (!i2c_check_functionality(adapter, I2C_FUNC_I2C | I2C_FUNC_SMBUS_WRITE_BYTE_DATA)) -- 2.19.1