Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4554057ybv; Mon, 17 Feb 2020 01:15:49 -0800 (PST) X-Google-Smtp-Source: APXvYqzymk52nyGVBYDGCbgCC01SQuiDBAhi6Hc8N8eEomsyF5ZWYwF4kpYGl1a1zrcNtyPy30ZI X-Received: by 2002:a05:6830:1607:: with SMTP id g7mr11338199otr.320.1581930949810; Mon, 17 Feb 2020 01:15:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581930949; cv=none; d=google.com; s=arc-20160816; b=ZBwgChgtLP8lopvvoqe3aD4wQHiKCsnMf51mJT6Lg597xPvRKVTiL27bVaLgviF+k+ Ha4QhwBVQO90mZSHCVWHtz6C+8W3LfBdrsbpql3V2yJB1PYnWwVgiPP0DM7Wf3zjqVv/ IOru2KWYSdmV4L6afIAN8hLp0AvTM9KUjIS+ttrw//1WtoOS9eTDuzJv0jH0YkEnD5fv AvgDaA/1fF4zGX34g7bgDjQK13AZ4BevVTye2OR11ZU64JXGrns6N7IazrIcySKHV50b O+tWxwpG8yH9h7mQQmfltY5NqtZPvdPJUMA/851zKN5w7R/gmrlOYTrufLwlVnIvZDdi ZXDg== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=ZFLZ0s+wRgA46yAryydNORFTWqq7SSx+cj0rcXC2W84=; b=mmkmmBsuPcKAATp4o93jpBGOOQHiFJ9c81TaCibBzvHykx6A/HvcZIkh7GiZgOFbpQ ZLmVmO4nfPfXlCvMUTbjdo/iXUGhfeFkplmxacmpdcrchxuPlD03gr/qphl6sLkVCLtE Ma2gRZFKlV87ynOItEMyUCmWgJJfm3oqJv0g+Pt4RyMDG8qit8YWo03ce7n0FH/8Jw6j 6CnIpxcqWSKqqJsoQmSSGSMsvI2E62ueJrbRIaWYUsPTW09cjImDFofA8G1UjoTJVgIc RStKJpeZK0GtUyAk9Pd9tDDBPlIKfvz3RPrFWwMrrqbhclrjsH9H6aJtThgHqKlwUx+i B4tA== 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 g6si6436877otk.171.2020.02.17.01.15.36; Mon, 17 Feb 2020 01:15:49 -0800 (PST) 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 S1728740AbgBQJPQ (ORCPT + 99 others); Mon, 17 Feb 2020 04:15:16 -0500 Received: from hostingweb31-40.netsons.net ([89.40.174.40]:36888 "EHLO hostingweb31-40.netsons.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728272AbgBQJPQ (ORCPT ); Mon, 17 Feb 2020 04:15:16 -0500 Received: from [109.168.11.45] (port=55854 helo=[192.168.101.73]) by hostingweb31.netsons.net with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92) (envelope-from ) id 1j3cUO-004srh-KO; Mon, 17 Feb 2020 10:14:52 +0100 Subject: Re: [PATCH 1/3] i2c: convert SMBus alert setup function to return an ERRPTR To: Wolfram Sang , Robert Richter Cc: Wolfram Sang , linux-i2c@vger.kernel.org, Benjamin Tissoires , Phil Reid , Jean Delvare , George Cherian , linux-kernel@vger.kernel.org References: <20200210172929.6001-1-wsa+renesas@sang-engineering.com> <20200210172929.6001-2-wsa+renesas@sang-engineering.com> <20200217075837.2agub5deqdpet3ce@rric.localdomain> <20200217081758.GA2814@ninjato> From: Luca Ceresoli Message-ID: <64a14944-ed27-9f4f-6d1b-e31508c92692@lucaceresoli.net> Date: Mon, 17 Feb 2020 10:14:52 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <20200217081758.GA2814@ninjato> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - hostingweb31.netsons.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lucaceresoli.net X-Get-Message-Sender-Via: hostingweb31.netsons.net: authenticated_id: luca+lucaceresoli.net/only user confirmed/virtual account not confirmed X-Authenticated-Sender: hostingweb31.netsons.net: luca@lucaceresoli.net X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 17/02/20 09:17, Wolfram Sang wrote: > >>> Signed-off-by: Wolfram Sang >> >>> -struct i2c_client *i2c_setup_smbus_alert(struct i2c_adapter *adapter, >>> +struct i2c_client *i2c_install_smbus_alert(struct i2c_adapter *adapter, >>> struct i2c_smbus_alert_setup *setup); >> >> This function naming is a bit odd. It creates a struct i2c_client. >> Then, there is also i2c_new_client_device() and i2c_new_device(). For >> i2c_new_client_device() there are no users at all outside of >> i2c-core-base.c (except for Falcon NIC), it is only a wrapper. > > i2c_new_device (and friends) returned NULL on error. I am currently > converting all i2c_new_* functions to return an ERRPTR. So, > i2c_new_client_device is the new function, i2c_new_device is deprecated. > If you check v5.6-rc1, you will find many more users. Similarily, > i2c_new_dummy is deprecated (and removed already), i2c_new_dummy_device > is the new thing. > >> So how about reducing the interface to those both only to:? >> >> i2c_new_device() >> i2c_new_device_smbus() > > Given the above, it would be: > > i2c_new_client_device() > i2c_new_smbus_device() > > Yet, I think this is too vague. Maybe > > i2c_new_smbus_alert_device() I always found the function naming a bit messy in the linux i2c implementation. Among the names proposed in this thread, i2c_new_smbus_alert_device() is the only one that makes sense to me for the new function: it is not vague, and it is coherent with other names of recently introduced functions (i2c_new_*_device()). Of course the "alert device" is not a real device, but it looks like it is as it has its own "slave" address. So I vote for this name... > ? Note that I never used SMBus Alert, so I am happy for feedback from > people actually using it. ...but that said, I'm afraid I'm not using smbus alert. My 2c, -- Luca