From patchwork Sun Oct 23 13:22:42 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: 13016257 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 589EEFA373F for ; Sun, 23 Oct 2022 13:23:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230476AbiJWNXh (ORCPT ); Sun, 23 Oct 2022 09:23:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230457AbiJWNXa (ORCPT ); Sun, 23 Oct 2022 09:23:30 -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 03D976FC4A for ; Sun, 23 Oct 2022 06:23:29 -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 1omawX-0006qH-Vo; Sun, 23 Oct 2022 15:23:10 +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 1omawW-000ygH-4u; Sun, 23 Oct 2022 15:23:08 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1omawV-00A3Qk-DM; Sun, 23 Oct 2022 15:23:07 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dan Robertson , Jonathan Cameron Cc: Wolfram Sang , Lars-Peter Clausen , linux-iio@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 03/23] iio: accel: bma400: Convert to i2c's .probe_new Date: Sun, 23 Oct 2022 15:22:42 +0200 Message-Id: <20221023132302.911644-4-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20221023132302.911644-1-u.kleine-koenig@pengutronix.de> References: <20221023132302.911644-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1717; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=LFfCPOIAMk+cTROD/thqfLSzOM/JB9AegkaUfckA+jY=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBjVT9IZLkBQIYChZWJldf7a7/KlVJ8XEKyYnuPe2++ n8S+mCSJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCY1U/SAAKCRDB/BR4rcrsCfInB/ 9/c0s4rOpEarUjTJmCgIU5xNDbFXNFOlHqBWD2lUVfgTBbetEcisosqLXb9wvyKSwM6HW46RTtHIa7 uAYUvJ7As/b8aCvorj6iA3RQBPplHbVsxXklYycOTT6MdrFZOxgaFPR0pfmqmiFY67nP4Dv61zSfDk RmsR32gff6itS9YbYff0YqYLiNfWUMwZ8dynD3SJ7PQB4oyWhszsjnMGBrTH5EzKbdNcRM5PkxyhYZ KhMKeD/r8ZzQBDCV4TIUKVJzwI5ZofaYxXTUab/irEAkaXAavc0KDHPsWRZtemPmNHDmo3makPxURY JwQYyjmRc7quqUWmxtZpgxH4IoVwVI 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-iio@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@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/iio/accel/bma400_i2c.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/iio/accel/bma400_i2c.c b/drivers/iio/accel/bma400_i2c.c index 1ba2a982ea73..cf7a830d6baf 100644 --- a/drivers/iio/accel/bma400_i2c.c +++ b/drivers/iio/accel/bma400_i2c.c @@ -13,10 +13,16 @@ #include "bma400.h" -static int bma400_i2c_probe(struct i2c_client *client, - const struct i2c_device_id *id) +static const struct i2c_device_id bma400_i2c_ids[] = { + { "bma400", 0 }, + { } +}; +MODULE_DEVICE_TABLE(i2c, bma400_i2c_ids); + +static int bma400_i2c_probe(struct i2c_client *client) { struct regmap *regmap; + const struct i2c_device_id *id = i2c_match_id(bma400_i2c_ids, client); regmap = devm_regmap_init_i2c(client, &bma400_regmap_config); if (IS_ERR(regmap)) { @@ -27,12 +33,6 @@ static int bma400_i2c_probe(struct i2c_client *client, return bma400_probe(&client->dev, regmap, client->irq, id->name); } -static const struct i2c_device_id bma400_i2c_ids[] = { - { "bma400", 0 }, - { } -}; -MODULE_DEVICE_TABLE(i2c, bma400_i2c_ids); - static const struct of_device_id bma400_of_i2c_match[] = { { .compatible = "bosch,bma400" }, { } @@ -44,7 +44,7 @@ static struct i2c_driver bma400_i2c_driver = { .name = "bma400", .of_match_table = bma400_of_i2c_match, }, - .probe = bma400_i2c_probe, + .probe_new = bma400_i2c_probe, .id_table = bma400_i2c_ids, };