From patchwork Mon Jun 10 09:51:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 10984585 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2EAFA1398 for ; Mon, 10 Jun 2019 09:52:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1FE27285B7 for ; Mon, 10 Jun 2019 09:52:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 10A4C283AF; Mon, 10 Jun 2019 09:52:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 53AB5283AF for ; Mon, 10 Jun 2019 09:52:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389148AbfFJJwa (ORCPT ); Mon, 10 Jun 2019 05:52:30 -0400 Received: from sauhun.de ([88.99.104.3]:39680 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388033AbfFJJw3 (ORCPT ); Mon, 10 Jun 2019 05:52:29 -0400 Received: from localhost (p54B33062.dip0.t-ipconnect.de [84.179.48.98]) by pokefinder.org (Postfix) with ESMTPSA id D6CB12C78FF; Mon, 10 Jun 2019 11:52:27 +0200 (CEST) From: Wolfram Sang To: linux-i2c@vger.kernel.org Cc: Peter Rosin , Wolfram Sang , Jean Delvare , Guenter Roeck , linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] hwmon: lm90: simplify getting the adapter of a client Date: Mon, 10 Jun 2019 11:51:54 +0200 Message-Id: <20190610095157.11814-2-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190610095157.11814-1-wsa+renesas@sang-engineering.com> References: <20190610095157.11814-1-wsa+renesas@sang-engineering.com> MIME-Version: 1.0 Sender: linux-hwmon-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We have a dedicated pointer for that, so use it. Much easier to read and less computation involved. Reported-by: Peter Rosin Signed-off-by: Wolfram Sang --- Please apply to your subsystem tree. drivers/hwmon/lm90.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c index e562a578f20e..2ebcab8b0a9b 100644 --- a/drivers/hwmon/lm90.c +++ b/drivers/hwmon/lm90.c @@ -1718,7 +1718,7 @@ static int lm90_probe(struct i2c_client *client, const struct i2c_device_id *id) { struct device *dev = &client->dev; - struct i2c_adapter *adapter = to_i2c_adapter(dev->parent); + struct i2c_adapter *adapter = client->adapter; struct hwmon_channel_info *info; struct regulator *regulator; struct device *hwmon_dev;