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=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 0E8A9C3A59C for ; Fri, 16 Aug 2019 12:34:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D4CE920644 for ; Fri, 16 Aug 2019 12:34:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727202AbfHPMeB (ORCPT ); Fri, 16 Aug 2019 08:34:01 -0400 Received: from enpas.org ([46.38.239.100]:33562 "EHLO mail.enpas.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726981AbfHPMeB (ORCPT ); Fri, 16 Aug 2019 08:34:01 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail.enpas.org (Postfix) with ESMTPSA id 2AD37100073; Fri, 16 Aug 2019 12:33:57 +0000 (UTC) Subject: Re: [PATCH v3 3/3] i2c/busses/i2c-icy: Add LTC2990 present on 2019 board revision To: Wolfram Sang Cc: linux-i2c@vger.kernel.org, linux-hwmon@vger.kernel.org, Wolfram Sang , Jean Delvare , Guenter Roeck , linux-m68k@vger.kernel.org, linux-kernel@vger.kernel.org, glaubitz@physik.fu-berlin.de References: <20190815125802.16500-1-max@enpas.org> <20190815125802.16500-3-max@enpas.org> <20190816115112.GA3507@kunai> From: Max Staudt Openpgp: preference=signencrypt Autocrypt: addr=max@enpas.org; prefer-encrypt=mutual; keydata= xsNNBFWfXgEBIADcbJMG2xuJBIVNlhj5AFBwKLZ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pKauvc/z0gkNkbySPPLzof /gBw5zuaaTU8nzXWoPbDl6EuWtyVrwo1S6sSoeEb+7KHJYig8mPeyJvA+1tSTzOjPZLlA56j L7B2x7Mf+vohJx6qS93MVqOLPZo3lvi3QH+ScUNmQNBcLe+sGd8EIJCIMJa9ab8Esx1I8AVr ZVP2hV0XjPJCw/bGp66yYq7dYvvT2wOMk9FUOKCTTBxHEgz5H4LjrA0gJONNrqjI9Hjo8IJU IHKdyyMuKDhs8FkGpx9UTEBMXYasF2J1V9wMJp+JWYEDKQ/ienhXzMpTKeTntPaF3EPcwdmo n6Ro70RlUvNcCNXlosS6KWgXLVZx0xy3cFsF6m4HL3GEXarDm2ub3EatN4nGbknQqzh+1gUG fN1OsIbabwgqrLEUO4tTTE5BKcccjti20S8+3Xn4LCyowrqMREfXDHDT2tStJmi4i8l1NDsf 0deMB5e+8oupffJn64n0qod8e535MEZ8UM244dTv1bR3w9GLWr1eLIF1hOeN6YkRgks7zD1O qowubYXvP+RW4E9h6/NwGzS3Sbw7dRC6HK7xeSjmnzgrbbdF3TbHa5WHGZ3MLFQqbMuSn1Gn a0dBnIpkQG5yGknQjCL7SGEun1siNzluV19nLu66YRJsZ1HE9RgbMhTe2Ca8bWH1985ra4GV urZIw0nz8zec+73Bv/qF4GHHftLYfA== Message-ID: <513d49dd-70fc-a226-fdfd-598aadcfec05@enpas.org> Date: Fri, 16 Aug 2019 14:34:32 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20190816115112.GA3507@kunai> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-hwmon-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org On 08/16/2019 01:51 PM, Wolfram Sang wrote: > >> + if (IS_ERR(new_fwnode)) >> + dev_info(&z->dev, "Failed to create fwnode for LTC2990, error: %ld\n", >> + PTR_ERR(new_fwnode)); >> + else { > > Braces for both blocks. Did you run checkpatch? I did, and it didn't say anything. Turns out I misremembered the CodingStyle as having a corner case where it doesn't. I'll fix the style - I dislike the above, too ;) >> + /* >> + * Store the fwnode so we can destroy it on .remove(). >> + * Only store it on success, as fwnode_remove_software_node() >> + * is NULL safe, but not PTR_ERR safe. >> + */ >> + i2c->ltc2990_fwnode = new_fwnode; >> + ltc2990_info.fwnode = new_fwnode; >> + >> + i2c->ltc2990_client = >> + i2c_new_probed_device(&i2c->adapter, >> + <c2990_info, >> + icy_ltc2990_addresses, >> + NULL); > > i2c_new_device (or better, the new i2c_new_client_device) should be > sufficient, or? You only have one potential address. Yes and no. Now that you mention it - the LTC2990 can be at four addresses (0x4c - 0x4f), and there are jumpers (solder pads) on the PCB to select its address. Shall I add all 4 addresses to the array? It's also possible that there is no LTC2990 at all (because it's hard to solder at home), and that's why we need to probe for it first. I believe i2c_new[_client]_device doesn't do probing, but rather assumes the device to be there. Correct? Max