From patchwork Sun Oct 30 17:53:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angel Iglesias X-Patchwork-Id: 13025172 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 B25E2C38A02 for ; Sun, 30 Oct 2022 17:53:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229544AbiJ3Rxr (ORCPT ); Sun, 30 Oct 2022 13:53:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229441AbiJ3Rxp (ORCPT ); Sun, 30 Oct 2022 13:53:45 -0400 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7537A462; Sun, 30 Oct 2022 10:53:44 -0700 (PDT) Received: by mail-wr1-x42c.google.com with SMTP id cl5so1435601wrb.9; Sun, 30 Oct 2022 10:53:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=uh99+98k9DjiwRCEQNWBVpY/+xrac0K5mOZC2PhRLgk=; b=ejW67cUc978YaFYovxPuidvFmLZpzJiHzXjm5a2qGRTyOBt2JXcH9CJJgBz862Xo0o Bvc2yA/T92e8xjkoS0JWE6YyS6vtQ4i/hqmm30/q6/sDPBe8/bkb/3GLFv7v/3uegzwD 09PDOS/S5/G+LcwBAXNLuExYOJKzV+HD1FXzCMWlaetC9AR9pA9FVPyMkbvcWfCtXBQP 0zdLGOtD5IJ/ORuqGaHmKiJ8JqsVKKVj41Q931KZg6F//Pje/y9iH17AwuOAtggjH1MJ n7hdVbKxfLni/gknE4n/5PXhrWnp6PN4OMjf2dpxLqjGveJXilVwPCIZw1nfxMAS8BTs tlYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uh99+98k9DjiwRCEQNWBVpY/+xrac0K5mOZC2PhRLgk=; b=dLxuaVSxkL6K6IaDAPxMifVyfYo0Xf5AiTYHxZNzZ2rJCSGFKvjQAym+xUT0dUUIYr cy49tSLS7xvOaVS3LDKhYvxBWghGgtZC2JVd2nVa3Z8I0yCUR+pcGDSgiXggbBLnBx3Y ulop5ai6usz05nfLEgHzt/fvyAuOT1n4oZN9Cilb9odE1Xgt0Q4jSCzFq1lYXTSlZrEC pcan3YP97ZfVd1K7oSDIuNSuJqeDVQGzt7KNIcLiIAbE9UbGafiqYg+f8YXHHqIFtZAD MUYVx08jtRAIR9iyHpYcMvmoqcxpnzb3/e/2UrdYfpmRsAgEr150jmBz8mbOM1I6R8ls nb+A== X-Gm-Message-State: ACrzQf0ivusPPKHB3Kt4Vw7SkUE/xVh5F+YOqk2062krlIBajiuEFfka WQyGK+8+PRshrtj2M9zvxHiepR5Q2Xc= X-Google-Smtp-Source: AMsMyM5PGlZg3od3i7+EKna5RUd+ykP954zC/EqwpeGpw5it30+xH9uv+tZ9mZOOcJFwxZOP0dqb7Q== X-Received: by 2002:adf:e405:0:b0:236:6e0d:6ed2 with SMTP id g5-20020adfe405000000b002366e0d6ed2mr5661404wrm.338.1667152423307; Sun, 30 Oct 2022 10:53:43 -0700 (PDT) Received: from localhost.localdomain (188.red-83-35-57.dynamicip.rima-tde.net. [83.35.57.188]) by smtp.gmail.com with ESMTPSA id be7-20020a05600c1e8700b003a83ca67f73sm5111182wmb.3.2022.10.30.10.53.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Oct 2022 10:53:43 -0700 (PDT) From: Angel Iglesias To: linux-iio@vger.kernel.org Cc: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Andy Shevchenko , =?utf-8?q?Nuno_S=C3=A1?= , Jonathan Cameron , Angel Iglesias , Lars-Peter Clausen , Ulf Hansson , Paul Cercueil , "Rafael J. Wysocki" , linux-kernel@vger.kernel.org Subject: [RFC PATCH 2/2] iio: pressure: bmp280: convert to i2c's .probe_new() Date: Sun, 30 Oct 2022 18:53:11 +0100 Message-Id: X-Mailer: git-send-email 2.38.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org Use i2c_client_get_device_id() to get the i2c_device_id* parameter in the .new_probe() callback. Signed-off-by: Angel Iglesias --- drivers/iio/pressure/bmp280-i2c.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/iio/pressure/bmp280-i2c.c b/drivers/iio/pressure/bmp280-i2c.c index 0c27211f3ea0..20073b09b3e3 100644 --- a/drivers/iio/pressure/bmp280-i2c.c +++ b/drivers/iio/pressure/bmp280-i2c.c @@ -5,11 +5,11 @@ #include "bmp280.h" -static int bmp280_i2c_probe(struct i2c_client *client, - const struct i2c_device_id *id) +static int bmp280_i2c_probe(struct i2c_client *client) { - struct regmap *regmap; + const struct i2c_device_id *id = i2c_client_get_device_id(client); const struct regmap_config *regmap_config; + struct regmap *regmap; switch (id->driver_data) { case BMP180_CHIP_ID: @@ -65,7 +65,7 @@ static struct i2c_driver bmp280_i2c_driver = { .of_match_table = bmp280_of_i2c_match, .pm = pm_ptr(&bmp280_dev_pm_ops), }, - .probe = bmp280_i2c_probe, + .probe_new = bmp280_i2c_probe, .id_table = bmp280_i2c_id, }; module_i2c_driver(bmp280_i2c_driver);