Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2100057pxb; Fri, 25 Mar 2022 11:05:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw80e1n0wYp2wsGkSSOHKpp+UKhG68D3gUR08papIjT4O0BnOgglOrnjFjmrxQ9ieA87MR7 X-Received: by 2002:a05:6870:c20f:b0:dd:977e:f2f with SMTP id z15-20020a056870c20f00b000dd977e0f2fmr9599153oae.250.1648231499648; Fri, 25 Mar 2022 11:04:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648231499; cv=none; d=google.com; s=arc-20160816; b=k6jQcEHSafA1HhVj/2NWrRbPB4cKRf7EJ2uVi1Zutd5adWFd70tD6fGJKnEvDDe0Cl MHYNx/57KT1eDpFj5MVLvNofHCsRn2TWLDxu1nfaHZKYXU39SUP8ZzCO8vW7cuLbygb4 b+Ak9PeS2UoO0DnzEnCTsrbynaGV2QgqSQwc4BFhNGFDZ7LpnmqnuPGZIkl96SyQ5a9V NVSgkKb89x/ESBwcIZULg/uQzKM9sySY1r/FCldwYVAWjISmDqKB0dQqWl5hJWPHLzN/ cT4PcOb4vgAfmUdPuBRADfOWbN/J+BLXYaI8wrt+T5D5iT369Kh0yYkfsiB1mD2hJq+F hd8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=e6N5MTFXY0iLXltN3E1ZOj2zx5+PxN3kQhgXvv95GpM=; b=O7yRmNlS1atbFZTITO+IIkQF8tu09rFJkZrD1xQhg1o6SQsFNmFURN/PPg9RAGgS7Z QdE7dD3FGgFmpCBKszsXIo0sZQmm9TTeVp/n7K1CXri9h3Rq4s0WeOWlJALH2oHc24r1 IqbJ8DNLu1RHp416HdaQCPF8ELEjgO7FsoLSHh38H5Re+sHuqNcmL8G8w0DgvjdTxnTa alEy1g4eZ9UiliZ5ovPpyHvlCeFNLOfpM/PtVG6+0ueFjj3w6EQUrpUkiCqNZhU6aQ6B KAXda3ij9AE8qcG7xxnKTcN/dD3qaYq5NOuH1VX320c3d7nHGMc8yw9gBqX03Z6npJQU BbcA== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id h7-20020a056870170700b000de0b1054casi2247606oae.293.2022.03.25.11.04.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 11:04:59 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BBB0E12E764; Fri, 25 Mar 2022 10:39:50 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349534AbiCYRAl (ORCPT + 99 others); Fri, 25 Mar 2022 13:00:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231269AbiCYRAk (ORCPT ); Fri, 25 Mar 2022 13:00:40 -0400 X-Greylist: delayed 1197 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Fri, 25 Mar 2022 09:59:05 PDT Received: from 4.mo550.mail-out.ovh.net (4.mo550.mail-out.ovh.net [46.105.76.26]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E55C4AE18 for ; Fri, 25 Mar 2022 09:59:05 -0700 (PDT) Received: from player695.ha.ovh.net (unknown [10.110.171.117]) by mo550.mail-out.ovh.net (Postfix) with ESMTP id 3689621A0B for ; Fri, 25 Mar 2022 16:19:27 +0000 (UTC) Received: from sk2.org (82-65-25-201.subs.proxad.net [82.65.25.201]) (Authenticated sender: steve@sk2.org) by player695.ha.ovh.net (Postfix) with ESMTPSA id C9F4628AAD10E; Fri, 25 Mar 2022 16:19:23 +0000 (UTC) Authentication-Results: garm.ovh; auth=pass (GARM-102R004ceb7d065-e90c-401e-ab9e-18557b73c586, 1702D5D0C6B5DF16716081994498F990499A02DA) smtp.auth=steve@sk2.org X-OVh-ClientIp: 82.65.25.201 From: Stephen Kitt To: Wolfram Sang Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Stephen Kitt Subject: [PATCH] docs: i2c: reference simple probes Date: Fri, 25 Mar 2022 17:19:10 +0100 Message-Id: <20220325161910.1202539-1-steve@sk2.org> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 16973785521511499398 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvvddrudehuddgkeeiucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufffkffoggfgsedtkeertdertddtnecuhfhrohhmpefuthgvphhhvghnucfmihhtthcuoehsthgvvhgvsehskhdvrdhorhhgqeenucggtffrrghtthgvrhhnpeetgedugfelkeeikeetgeegteevfeeufeetuefgudeiiedthfehtdeffeekvdeffeenucfkpheptddrtddrtddrtddpkedvrdeihedrvdehrddvtddunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmohguvgepshhmthhpohhuthdphhgvlhhopehplhgrhigvrheileehrdhhrgdrohhvhhdrnhgvthdpihhnvghtpedtrddtrddtrddtpdhmrghilhhfrhhomhepshhtvghvvgesshhkvddrohhrghdpnhgspghrtghpthhtohepuddprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrgh X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Instead of documenting old-style probes, reference "simple probes" and document the i2c_match_id function. This might help reduce the use of two-argument probes in new code. Signed-off-by: Stephen Kitt --- Documentation/i2c/writing-clients.rst | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Documentation/i2c/writing-clients.rst b/Documentation/i2c/writing-clients.rst index 978cc8210bf3..e3b126cf4a3b 100644 --- a/Documentation/i2c/writing-clients.rst +++ b/Documentation/i2c/writing-clients.rst @@ -46,7 +46,7 @@ driver model device node, and its I2C address. }, .id_table = foo_idtable, - .probe = foo_probe, + .probe_new = foo_probe, .remove = foo_remove, /* if device autodetection is needed: */ .class = I2C_CLASS_SOMETHING, @@ -155,8 +155,7 @@ those devices, and a remove() method to unbind. :: - static int foo_probe(struct i2c_client *client, - const struct i2c_device_id *id); + static int foo_probe(struct i2c_client *client); static int foo_remove(struct i2c_client *client); Remember that the i2c_driver does not create those client handles. The @@ -165,8 +164,12 @@ handle may be used during foo_probe(). If foo_probe() reports success foo_remove() returns. That binding model is used by most Linux drivers. The probe function is called when an entry in the id_table name field -matches the device's name. It is passed the entry that was matched so -the driver knows which one in the table matched. +matches the device's name. If the probe function needs that entry, it +can retrieve it using + +:: + + const struct i2c_device_id *id = i2c_match_id(foo_idtable, client); Device Creation -- 2.27.0