From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 32FA7C28CC5 for ; Sat, 8 Jun 2019 10:57:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 10801212F5 for ; Sat, 8 Jun 2019 10:57:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727280AbfFHK5N (ORCPT ); Sat, 8 Jun 2019 06:57:13 -0400 Received: from sauhun.de ([88.99.104.3]:51874 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727197AbfFHK5A (ORCPT ); Sat, 8 Jun 2019 06:57:00 -0400 Received: from localhost (p5486CBCC.dip0.t-ipconnect.de [84.134.203.204]) by pokefinder.org (Postfix) with ESMTPSA id EE3A03E47A1; Sat, 8 Jun 2019 12:56:58 +0200 (CEST) From: Wolfram Sang To: linux-i2c@vger.kernel.org Cc: Wolfram Sang , Guenter Roeck , Heikki Krogerus , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 34/34] usb: typec: tcpm: fusb302: simplify getting the adapter of a client Date: Sat, 8 Jun 2019 12:56:13 +0200 Message-Id: <20190608105619.593-35-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/usb/typec/tcpm/fusb302.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/usb/typec/tcpm/fusb302.c b/drivers/usb/typec/tcpm/fusb302.c index 7302f7501ec9..c524088246ee 100644 --- a/drivers/usb/typec/tcpm/fusb302.c +++ b/drivers/usb/typec/tcpm/fusb302.c @@ -1697,13 +1697,12 @@ static int fusb302_probe(struct i2c_client *client, const struct i2c_device_id *id) { struct fusb302_chip *chip; - struct i2c_adapter *adapter; + struct i2c_adapter *adapter = client->adapter; struct device *dev = &client->dev; const char *name; int ret = 0; u32 v; - adapter = to_i2c_adapter(client->dev.parent); if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_I2C_BLOCK)) { dev_err(&client->dev, "I2C/SMBus block functionality not supported!\n"); -- 2.19.1