From patchwork Fri Oct 21 07:39:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 617578 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A2E27C4332F for ; Fri, 21 Oct 2022 07:39:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229815AbiJUHjv (ORCPT ); Fri, 21 Oct 2022 03:39:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229602AbiJUHjt (ORCPT ); Fri, 21 Oct 2022 03:39:49 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C68F2CC9E for ; Fri, 21 Oct 2022 00:39:46 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1olmd6-0006Mj-AN; Fri, 21 Oct 2022 09:39:44 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1olmd3-000TRU-Ae; Fri, 21 Oct 2022 09:39:43 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1olmd4-009WBA-Ho; Fri, 21 Oct 2022 09:39:42 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Wolfram Sang Cc: linux-i2c@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH v1 1/5] i2c: Convert the dummy_driver to .probe_new() Date: Fri, 21 Oct 2022 09:39:31 +0200 Message-Id: <20221021073935.165158-2-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20221021073935.165158-1-u.kleine-koenig@pengutronix.de> References: <20221021073935.165158-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=899; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=udjqYNrFRO88QYK+CXBlmrarRiTbAOE8271jzyrA3GQ=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBjUkyhZMCnj5mz91InCVKNxfW0h7K8iV0li+KqPQnl +7eRK5OJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCY1JMoQAKCRDB/BR4rcrsCarJB/ 4oNEH1/tqaC53pKGxaJZv56+vXHY7Pip9jpPmX1mGjCHb6ctMi8tHZctENdUTF8GUDwXijq8bMQBrx k0GuOJL5dv8gzZheQF1JXVjR4GP7e7S98xJ1TjD/BYL3itgGFOyrgNqYtuI/uvb1sHXkkYl3fVw99j qtLYc6+Pkn822D61/OEsJWOiwPmmBu1WqgGqReB8maD3bUbvvSTOTYK+i90RmEPOoZRKPGJsYNM5/x U0D5OqPxsFWCnfWbhJdy5dRMLSVWCsT+zuinIz9szcrx6QOZoZSl6KTm26/0P+xTK2XTATo2FRsn7n 4XMnLu1HZpy3WRgWU9h/jeir1EhqwR X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-i2c@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org The probe function doesn't make use of the id parameter, so the driver can be converted trivially to .probe_new(). Signed-off-by: Uwe Kleine-König --- drivers/i2c/i2c-core-base.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index b4edf10e8fd0..f786917a7f44 100644 --- a/drivers/i2c/i2c-core-base.c +++ b/drivers/i2c/i2c-core-base.c @@ -1017,15 +1017,14 @@ static const struct i2c_device_id dummy_id[] = { { }, }; -static int dummy_probe(struct i2c_client *client, - const struct i2c_device_id *id) +static int dummy_probe(struct i2c_client *client) { return 0; } static struct i2c_driver dummy_driver = { .driver.name = "dummy", - .probe = dummy_probe, + .probe_new = dummy_probe, .id_table = dummy_id, }; From patchwork Fri Oct 21 07:39:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 617371 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6D0C0C43219 for ; Fri, 21 Oct 2022 07:39:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229585AbiJUHjx (ORCPT ); Fri, 21 Oct 2022 03:39:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229697AbiJUHjt (ORCPT ); Fri, 21 Oct 2022 03:39:49 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C7A32CCBF for ; Fri, 21 Oct 2022 00:39:46 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1olmd6-0006Mg-8i; Fri, 21 Oct 2022 09:39:44 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1olmd3-000TRK-26; Fri, 21 Oct 2022 09:39:43 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1olmd4-009WBD-Ns; Fri, 21 Oct 2022 09:39:42 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Wolfram Sang Cc: linux-i2c@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH v1 2/5] i2c: slave eeprom: Convert to .probe_new() Date: Fri, 21 Oct 2022 09:39:32 +0200 Message-Id: <20221021073935.165158-3-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20221021073935.165158-1-u.kleine-koenig@pengutronix.de> References: <20221021073935.165158-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3169; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=cGxD5LI6RpVRvkuUReTvWQ8ZC84cttB4FAhdlcluDOQ=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBjUkyk4/PnCDv5S/Zi1/vyo6/bqBbPn8uc/VMDpWD9 hK1XMVCJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCY1JMpAAKCRDB/BR4rcrsCQ++CA CC1yjHYODnmQo8ujhFqd6EZ/hTu4FMEQhRFg9pjREKCUTfhqJq5w50vMk4639OyytaWwLv87Xa3HFP 8qshYzckJBthxZgBGGnfEN7R64kTf2M1HceXposHx9EJmRyudyylgGtlcK3WaDXvTNKm7veDiGeNRG NTsLVMy5SlgMuhC7gkqW4VkCeTOaeec7QW4uTOL2qsoS3hhY/BopkB992CKfaq3RhyMZnh3VT3ruiP YmpFjoRXJvAD90HGmgKlEn+fIDyih5mXkM50j5pSFcAOkZ29k0ebrFpxdhoYxUYbOAD9p3ZreuGHsB wEoN6AnHRZWuKM08zfhZh23r7oNBcT X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-i2c@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org .probe_new() doesn't get the i2c_device_id * parameter, so determine that explicitly in .probe(). The device_id array has to move up for that to work. Signed-off-by: Uwe Kleine-König --- drivers/i2c/i2c-slave-eeprom.c | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/drivers/i2c/i2c-slave-eeprom.c b/drivers/i2c/i2c-slave-eeprom.c index 4abc2d919881..44c14bfd1fda 100644 --- a/drivers/i2c/i2c-slave-eeprom.c +++ b/drivers/i2c/i2c-slave-eeprom.c @@ -140,10 +140,24 @@ static int i2c_slave_init_eeprom_data(struct eeprom_data *eeprom, struct i2c_cli return 0; } -static int i2c_slave_eeprom_probe(struct i2c_client *client, const struct i2c_device_id *id) +static const struct i2c_device_id i2c_slave_eeprom_id[] = { + { "slave-24c02", I2C_SLAVE_DEVICE_MAGIC(2048 / 8, 0) }, + { "slave-24c02ro", I2C_SLAVE_DEVICE_MAGIC(2048 / 8, I2C_SLAVE_FLAG_RO) }, + { "slave-24c32", I2C_SLAVE_DEVICE_MAGIC(32768 / 8, I2C_SLAVE_FLAG_ADDR16) }, + { "slave-24c32ro", I2C_SLAVE_DEVICE_MAGIC(32768 / 8, I2C_SLAVE_FLAG_ADDR16 | I2C_SLAVE_FLAG_RO) }, + { "slave-24c64", I2C_SLAVE_DEVICE_MAGIC(65536 / 8, I2C_SLAVE_FLAG_ADDR16) }, + { "slave-24c64ro", I2C_SLAVE_DEVICE_MAGIC(65536 / 8, I2C_SLAVE_FLAG_ADDR16 | I2C_SLAVE_FLAG_RO) }, + { "slave-24c512", I2C_SLAVE_DEVICE_MAGIC(524288 / 8, I2C_SLAVE_FLAG_ADDR16) }, + { "slave-24c512ro", I2C_SLAVE_DEVICE_MAGIC(524288 / 8, I2C_SLAVE_FLAG_ADDR16 | I2C_SLAVE_FLAG_RO) }, + { } +}; +MODULE_DEVICE_TABLE(i2c, i2c_slave_eeprom_id); + +static int i2c_slave_eeprom_probe(struct i2c_client *client) { struct eeprom_data *eeprom; int ret; + const struct i2c_device_id *id = i2c_match_id(i2c_slave_eeprom_id, client); unsigned int size = FIELD_GET(I2C_SLAVE_BYTELEN, id->driver_data) + 1; unsigned int flag_addr16 = FIELD_GET(I2C_SLAVE_FLAG_ADDR16, id->driver_data); @@ -189,24 +203,11 @@ static void i2c_slave_eeprom_remove(struct i2c_client *client) sysfs_remove_bin_file(&client->dev.kobj, &eeprom->bin); } -static const struct i2c_device_id i2c_slave_eeprom_id[] = { - { "slave-24c02", I2C_SLAVE_DEVICE_MAGIC(2048 / 8, 0) }, - { "slave-24c02ro", I2C_SLAVE_DEVICE_MAGIC(2048 / 8, I2C_SLAVE_FLAG_RO) }, - { "slave-24c32", I2C_SLAVE_DEVICE_MAGIC(32768 / 8, I2C_SLAVE_FLAG_ADDR16) }, - { "slave-24c32ro", I2C_SLAVE_DEVICE_MAGIC(32768 / 8, I2C_SLAVE_FLAG_ADDR16 | I2C_SLAVE_FLAG_RO) }, - { "slave-24c64", I2C_SLAVE_DEVICE_MAGIC(65536 / 8, I2C_SLAVE_FLAG_ADDR16) }, - { "slave-24c64ro", I2C_SLAVE_DEVICE_MAGIC(65536 / 8, I2C_SLAVE_FLAG_ADDR16 | I2C_SLAVE_FLAG_RO) }, - { "slave-24c512", I2C_SLAVE_DEVICE_MAGIC(524288 / 8, I2C_SLAVE_FLAG_ADDR16) }, - { "slave-24c512ro", I2C_SLAVE_DEVICE_MAGIC(524288 / 8, I2C_SLAVE_FLAG_ADDR16 | I2C_SLAVE_FLAG_RO) }, - { } -}; -MODULE_DEVICE_TABLE(i2c, i2c_slave_eeprom_id); - static struct i2c_driver i2c_slave_eeprom_driver = { .driver = { .name = "i2c-slave-eeprom", }, - .probe = i2c_slave_eeprom_probe, + .probe_new = i2c_slave_eeprom_probe, .remove = i2c_slave_eeprom_remove, .id_table = i2c_slave_eeprom_id, }; From patchwork Fri Oct 21 07:39:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 617372 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35133C433FE for ; Fri, 21 Oct 2022 07:39:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229602AbiJUHjw (ORCPT ); Fri, 21 Oct 2022 03:39:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229456AbiJUHjt (ORCPT ); Fri, 21 Oct 2022 03:39:49 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C6FF2CCB5 for ; Fri, 21 Oct 2022 00:39:46 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1olmd6-0006Mi-AG; Fri, 21 Oct 2022 09:39:44 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1olmd3-000TRS-9V; Fri, 21 Oct 2022 09:39:43 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1olmd4-009WBG-Tn; Fri, 21 Oct 2022 09:39:42 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Wolfram Sang Cc: linux-i2c@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH v1 3/5] i2c: smbus: Convert to .probe_new() Date: Fri, 21 Oct 2022 09:39:33 +0200 Message-Id: <20221021073935.165158-4-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20221021073935.165158-1-u.kleine-koenig@pengutronix.de> References: <20221021073935.165158-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1057; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=7a5TTsET6f6PqjDsmSs8UrKAbWVDqlXFZFAMpzXXsx0=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBjUkyo8B0gEWWVemPBnwldLNOVZNFST4HbEJcXtZ8Q AT5BXHOJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCY1JMqAAKCRDB/BR4rcrsCY1fB/ 90PovCrh+VqxpWl6D/TfgHfDHGjc2Z+xR80yAepgsOqdq0ewdI4EDs4ZSiWldx4leM3g/gtvtgew7w MVbnlvVPFIWlK1/HFJB485Jd2VSfsoJynBAWqBFCkSydLbtG+p0yl88HXuFA2Ejl389yz7OX4TQRe1 TcvScuM8s9y/PER44AmxDuVGqxWzwH74PR0VriLmZhH4TEWs15g2yyrz9Ep7p1A+Q4nKUrAAQPjxq9 VT5ogyqrRnqW/czZlPuXidOlmqVnmnCeTefFpWvS8Kwcgakprmhxm//QhlqojL58ddHiuiitEnujL4 IRKKnEL4BcvNR3JUZZt0NL5Ke+k9gd X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-i2c@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König --- drivers/i2c/i2c-smbus.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/i2c/i2c-smbus.c b/drivers/i2c/i2c-smbus.c index 07c92c8495a3..f4c74b9135b3 100644 --- a/drivers/i2c/i2c-smbus.c +++ b/drivers/i2c/i2c-smbus.c @@ -112,8 +112,7 @@ static void smbalert_work(struct work_struct *work) } /* Setup SMBALERT# infrastructure */ -static int smbalert_probe(struct i2c_client *ara, - const struct i2c_device_id *id) +static int smbalert_probe(struct i2c_client *ara) { struct i2c_smbus_alert_setup *setup = dev_get_platdata(&ara->dev); struct i2c_smbus_alert *alert; @@ -170,7 +169,7 @@ static struct i2c_driver smbalert_driver = { .driver = { .name = "smbus_alert", }, - .probe = smbalert_probe, + .probe_new = smbalert_probe, .remove = smbalert_remove, .id_table = smbalert_ids, }; From patchwork Fri Oct 21 07:39:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 617576 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 11E35C4332F for ; Fri, 21 Oct 2022 07:39:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229697AbiJUHjx (ORCPT ); Fri, 21 Oct 2022 03:39:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229765AbiJUHju (ORCPT ); Fri, 21 Oct 2022 03:39:50 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A9421F9E5 for ; Fri, 21 Oct 2022 00:39:47 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1olmd7-0006Mw-3z; Fri, 21 Oct 2022 09:39:45 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1olmd3-000TRa-T5; Fri, 21 Oct 2022 09:39:44 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1olmd5-009WBJ-4w; Fri, 21 Oct 2022 09:39:43 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Guenter Roeck , Peter Rosin Cc: linux-i2c@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH v1 4/5] i2c: mux: pca9541: Convert to .probe_new() Date: Fri, 21 Oct 2022 09:39:34 +0200 Message-Id: <20221021073935.165158-5-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20221021073935.165158-1-u.kleine-koenig@pengutronix.de> References: <20221021073935.165158-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1149; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=bCp6vTLy4fOgzko1zHynMiRUdoC5QcYiSr8cpMUoFFo=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBjUkyrPNWGTHQX2VhAkWISPMJwmYhh7kRaygjTnuRq 4M8BjAGJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCY1JMqwAKCRDB/BR4rcrsCYHGB/ 94UDOAoQMA07dSjvysLyGpzDyFxZKC0b4kPHHkSeidgvVt9OB+iftmJnZXE/8vRDHphP27b3sESn7p eYp2fZ8/qttpft/1Q/jZGY92o21eHicY+y0MCiP70/WCMbi8eKX6OzAqeah8Me6EXUh4qoYOTE66yV zFNEwbnmDMIAQr3WhqRez5gJB4Tez2a6X2Yk/rvVDCltljuMQ/g6McRKognvwFoy2zlIPNqluZZsp9 Wxqu++q9X9H6alZRTGUZFBNaKX/wsEoPfeBEGVl5GoA2g6izp09lL2onUL7gmjhf6vxGGD026ZhIUz vvD1l1z4nPX4HwxHoivZu8t5uE6ogp X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-i2c@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted. Signed-off-by: Uwe Kleine-König --- drivers/i2c/muxes/i2c-mux-pca9541.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/i2c/muxes/i2c-mux-pca9541.c b/drivers/i2c/muxes/i2c-mux-pca9541.c index ea83de78f52d..09d1d9e67e31 100644 --- a/drivers/i2c/muxes/i2c-mux-pca9541.c +++ b/drivers/i2c/muxes/i2c-mux-pca9541.c @@ -283,8 +283,7 @@ static int pca9541_release_chan(struct i2c_mux_core *muxc, u32 chan) /* * I2C init/probing/exit functions */ -static int pca9541_probe(struct i2c_client *client, - const struct i2c_device_id *id) +static int pca9541_probe(struct i2c_client *client) { struct i2c_adapter *adap = client->adapter; struct i2c_mux_core *muxc; @@ -337,7 +336,7 @@ static struct i2c_driver pca9541_driver = { .name = "pca9541", .of_match_table = of_match_ptr(pca9541_of_match), }, - .probe = pca9541_probe, + .probe_new = pca9541_probe, .remove = pca9541_remove, .id_table = pca9541_id, }; From patchwork Fri Oct 21 07:39:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 617577 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A5085C43217 for ; Fri, 21 Oct 2022 07:39:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229456AbiJUHjw (ORCPT ); Fri, 21 Oct 2022 03:39:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229711AbiJUHjt (ORCPT ); Fri, 21 Oct 2022 03:39:49 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C9602CDC1 for ; Fri, 21 Oct 2022 00:39:46 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1olmd7-0006N3-3x; Fri, 21 Oct 2022 09:39:45 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1olmd3-000TRd-W3; Fri, 21 Oct 2022 09:39:44 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1olmd5-009WBM-AE; Fri, 21 Oct 2022 09:39:43 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Peter Rosin Cc: linux-i2c@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH v1 5/5] i2c: mux: pca954x: Convert to .probe_new() Date: Fri, 21 Oct 2022 09:39:35 +0200 Message-Id: <20221021073935.165158-6-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20221021073935.165158-1-u.kleine-koenig@pengutronix.de> References: <20221021073935.165158-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1232; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=2/S+o0Sl0yZNxkzwr+3h++9nLDPxw+SF5fq4qF584BM=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBjUkyumYpd5mbAelPGRz0uYBXR38uXgMktTAWaxDx1 +3c7MROJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCY1JMrgAKCRDB/BR4rcrsCbzoB/ 97v36v2lfUHg9jaCLIvWBmDmDM5bM6WBeGWY+fPIV9Wq3qxNPcdRAp4aMJ1OkWgqf5v0zUOu2gl8yr b00YDtGA9ea35stAClT5mvnrUapURL9M5ASCXPX85nckaIzhlc8m0dwW3o1toqLMNV6teV4Ar9ArzT /oP47LaPTZtPTzM+OrDFYoirb2wwduJ1r56H9U8lLZ7kd6XdwZkgJQw4PgR7uGyZH3R9DdEWGHidIo 8P8OT1D3Jz5Kvds0XUnUWmZfGyjIo5jM0BvhuIPVllFCmaW3U8+JvZPdF5dn9uurcZ75KMs0WVao1W d4ICOMcUaaDnHjrpKOVWpt3NNT9s5S X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-i2c@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org .probe_new() doesn't get the i2c_device_id * parameter, so determine that explicitly in .probe(). Signed-off-by: Uwe Kleine-König --- drivers/i2c/muxes/i2c-mux-pca954x.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/i2c/muxes/i2c-mux-pca954x.c b/drivers/i2c/muxes/i2c-mux-pca954x.c index a5f458b635df..7345032633ee 100644 --- a/drivers/i2c/muxes/i2c-mux-pca954x.c +++ b/drivers/i2c/muxes/i2c-mux-pca954x.c @@ -411,9 +411,9 @@ static int pca954x_init(struct i2c_client *client, struct pca954x *data) /* * I2C init/probing/exit functions */ -static int pca954x_probe(struct i2c_client *client, - const struct i2c_device_id *id) +static int pca954x_probe(struct i2c_client *client) { + const struct i2c_device_id *id = i2c_match_id(pca954x_id, client); struct i2c_adapter *adap = client->adapter; struct device *dev = &client->dev; struct gpio_desc *gpio; @@ -554,7 +554,7 @@ static struct i2c_driver pca954x_driver = { .pm = &pca954x_pm, .of_match_table = pca954x_of_match, }, - .probe = pca954x_probe, + .probe_new = pca954x_probe, .remove = pca954x_remove, .id_table = pca954x_id, };