From patchwork Mon Jun 10 09:51:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 10984587 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 57D2C1398 for ; Mon, 10 Jun 2019 09:52:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 478B1283AF for ; Mon, 10 Jun 2019 09:52:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3851428671; Mon, 10 Jun 2019 09:52:47 +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 D7D16283AF for ; Mon, 10 Jun 2019 09:52:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388893AbfFJJw3 (ORCPT ); Mon, 10 Jun 2019 05:52:29 -0400 Received: from sauhun.de ([88.99.104.3]:39668 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388664AbfFJJw3 (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 458282C077A; Mon, 10 Jun 2019 11:52:27 +0200 (CEST) From: Wolfram Sang To: linux-i2c@vger.kernel.org Cc: Peter Rosin , Wolfram Sang , devicetree@vger.kernel.org, linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org Subject: [PATCH 0/3] treewide: simplify getting the adapter of an I2C client, part2 Date: Mon, 10 Jun 2019 11:51:53 +0200 Message-Id: <20190610095157.11814-1-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.19.1 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 This is a small follow-up series to a larger cleanup series already sent: http://patchwork.ozlabs.org/project/linux-i2c/list/?series=112605 ("treewide: simplify getting the adapter of an I2C client") These drivers use a bit different but still unnecessarily complex way to determine the adapter of a client. Thanks to Peter Rosin for pointing them out. They have been fixed manually, no need for a coccinelle script here. Build tested, too. From the previous cover-letter: The I2C core populates the parent pointer of a client as: client->dev.parent = &client->adapter->dev; Now take into consideration that to_i2c_adapter(&adapter->dev); is a complicated way of saying 'adapter', then we can even formally prove that the complicated expression can be simplified by using client->adapter. A branch can be found here: git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git i2c/no_to_adapter Please apply the patches to the individual subsystem trees. There are no dependencies. Thanks and kind regards, Wolfram Wolfram Sang (3): hwmon: lm90: simplify getting the adapter of a client leds: is31fl319x: simplify getting the adapter of a client of: unittest: simplify getting the adapter of a client drivers/hwmon/lm90.c | 2 +- drivers/leds/leds-is31fl319x.c | 2 +- drivers/of/unittest.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)