Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp4130326rwi; Mon, 17 Oct 2022 01:45:53 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7/3XVQ+TcdZJuMAJHP+McdZMM2w0beHTHyELrsy9x6CyUMy+eu4jDQ0mkGudhzNLswo27T X-Received: by 2002:a17:907:2e0b:b0:78d:387d:1579 with SMTP id ig11-20020a1709072e0b00b0078d387d1579mr7602270ejc.761.1665996353152; Mon, 17 Oct 2022 01:45:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665996353; cv=none; d=google.com; s=arc-20160816; b=QnIM13lyTey7W1V2uscgghvq1C6IuvzWlsxaIHYr11go+44wHAV3FSiIV1o6DxQcYW 56JMWE9UlGnSpcFESpjL1K0QYXZTVGcrvxImE/Z2pdPSbL6WTV95DVzRpJ7NBDv+8iA8 TEOXvvIre51d3f6fKioWuBXI0iSXQk9vPsWeEyXrsUy0dObUn9lag/UpQL0Sdd6CmeBF 0VXVXZlaOeXNVWIE15oHYq5MOPKodZ5Oujp8ZagVf9eb4Jc1qv8db66YkC2sHaATkqHf LZf9aWXQVO8bdS1U1N3Ww3QTKMjGNZ2+19JGx408lRI4ILTTiYlKW10vXpifPZw4EZfJ 7xsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=pj7Uc+fSGuW/+mV3e7UOaQy8Kb79Jdamd+/ilxCpkZw=; b=o8TlRVi0NROSkg/y3S4tOdRrv/3kXMWPB7F/JhVwy+FOurIn8xgjKri2KbnjAD0ELe UqkldhCs3tNg/x+g3oH/hDoI/exdnMDqu+a4k8MSctRcf27xH1M9ckpq75vND2GIm/Cs Acxl3zmM1ea54NQEerBh9ubSu6gpYBNhzI3ltE5gBpW2df8BVH8HElPUz+0Hov0Cw1PR iLTmFEt8UTedh32g6BsKAjnQjnhhvYWZbvZrFnBgSxqabRf5HiLfcNZt2AbwLwnOpY0p hjZBT/Tuc6oqQcYexd7YWMN/gn158nusI/kM3++Jk+WoBkNiJn9f90i2UGIyjmAf9oyd LRwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20210112.gappssmtp.com header.s=20210112 header.b=xiZlR3Pc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e10-20020a170906504a00b0078210c21ecesi7477779ejk.304.2022.10.17.01.45.26; Mon, 17 Oct 2022 01:45:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20210112.gappssmtp.com header.s=20210112 header.b=xiZlR3Pc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229819AbiJQIhY (ORCPT + 99 others); Mon, 17 Oct 2022 04:37:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229779AbiJQIhX (ORCPT ); Mon, 17 Oct 2022 04:37:23 -0400 Received: from mail-vk1-xa36.google.com (mail-vk1-xa36.google.com [IPv6:2607:f8b0:4864:20::a36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EFF626F9 for ; Mon, 17 Oct 2022 01:37:22 -0700 (PDT) Received: by mail-vk1-xa36.google.com with SMTP id m128so4985218vka.12 for ; Mon, 17 Oct 2022 01:37:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=pj7Uc+fSGuW/+mV3e7UOaQy8Kb79Jdamd+/ilxCpkZw=; b=xiZlR3Pc5tBEzG91zAIHwuiZGKTyeUq9cEMI3/Xn2i3C7Iuf+pZglnH71uppem/8cK zwmHqSpGwhlQVxmTq2unMPgkYSWX1eD1A3YbTu2ZlQJzFQlZDxRxaylKJeHsmhlkVzwc EClQPPKQrh+gnwsYv+Ke3xGOwj78DuLWIgd9QVkQ4NqiCK/Zzfn/AGTdiqEmnecinhJg zJtplrZ+RqHiPspQoNIxjsPfzfz+TYLgQK9FFkLKnC9Q8kYTqYDH3cl5Reu4akdcixOg yDk7tDsvSyLHNgy+eUZCz1RapXamXRXPtBMYs8zIvZv17K9WSrccdhhEUg2P+rvZV3sp qazA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=pj7Uc+fSGuW/+mV3e7UOaQy8Kb79Jdamd+/ilxCpkZw=; b=3lr521tQfuYzCyTOFa23qU1sf4AfCV50V/WKJfJODhyYEi67FCNcn20nKWRPiHDYfI mX3o985JxHxAZB9j1D+AhRhVZ2T6IqUQrFySioouAoqsAa29a4miifBc1jTe1JCFThBW xwPC0Nf4zAIQO3nHNIrROneUcNwR6xT78rO5MFaDwNtphKroldlt8xRLl0UXxDWX+Z+9 cNMMAN7aZVNAGlErs2npD3587SQFxY/et3EgDkPlW2oTbFpEAv6VSRhJ+t9mIebf+66Q EJS4opNY58bEyWIxBDqlDgB+UMsCuqqxEIrWplblWcJL5b9aOl6sZTjCaNljVuEvFQWB rZuw== X-Gm-Message-State: ACrzQf0HkNGy7EOeagMpHkQv7eg33UrUXclAQtNuOC0mC714SkzhVSyW Z8c/0+Q+QyEsQRyRrSjfONQEY57riehsewW22VMEvocuNS0= X-Received: by 2002:a1f:4843:0:b0:3ae:c4a3:d653 with SMTP id v64-20020a1f4843000000b003aec4a3d653mr3457835vka.1.1665995841549; Mon, 17 Oct 2022 01:37:21 -0700 (PDT) MIME-Version: 1.0 References: <20221012142524.3920266-1-steve@sk2.org> In-Reply-To: <20221012142524.3920266-1-steve@sk2.org> From: Bartosz Golaszewski Date: Mon, 17 Oct 2022 10:37:10 +0200 Message-ID: Subject: Re: [PATCH] drivers/gpio: use simple i2c probe To: Stephen Kitt Cc: Linus Walleij , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE autolearn=ham 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 On Wed, Oct 12, 2022 at 4:25 PM Stephen Kitt wrote: > > All these drivers have an i2c probe function which doesn't use the > "struct i2c_device_id *id" parameter, so they can trivially be > converted to the "probe_new" style of probe with a single argument. > > This is part of an ongoing transition to single-argument i2c probe > functions. Old-style probe functions involve a call to i2c_match_id: > in drivers/i2c/i2c-core-base.c, > > /* > * When there are no more users of probe(), > * rename probe_new to probe. > */ > if (driver->probe_new) > status = driver->probe_new(client); > else if (driver->probe) > status = driver->probe(client, > i2c_match_id(driver->id_table, client)); > else > status = -EINVAL; > > Drivers which don't need the second parameter can be declared using > probe_new instead, avoiding the call to i2c_match_id. Drivers which do > can still be converted to probe_new-style, calling i2c_match_id > themselves (as is done currently for of_match_id). > > This change was done using the following Coccinelle script, and fixed > up for whitespace changes: > > @ rule1 @ > identifier fn; > identifier client, id; > @@ > > - static int fn(struct i2c_client *client, const struct i2c_device_id *id) > + static int fn(struct i2c_client *client) > { > ...when != id > } > > @ rule2 depends on rule1 @ > identifier rule1.fn; > identifier driver; > @@ > > struct i2c_driver driver = { > - .probe > + .probe_new > = > ( > fn > | > - &fn > + fn > ) > , > }; > > Signed-off-by: Stephen Kitt > --- Applied, thanks! Bart