From patchwork Sat Aug 5 23:15:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angel Iglesias X-Patchwork-Id: 13342700 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 6482EC0015E for ; Sat, 5 Aug 2023 23:15:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229939AbjHEXPY (ORCPT ); Sat, 5 Aug 2023 19:15:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229999AbjHEXPW (ORCPT ); Sat, 5 Aug 2023 19:15:22 -0400 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A31A2120; Sat, 5 Aug 2023 16:15:21 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-4fe0d5f719dso5584247e87.2; Sat, 05 Aug 2023 16:15:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691277319; x=1691882119; 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=rhe3k7N6Zudq4d/t7ExDf16kdAR6Hv2A6e2F4vngjQY=; b=YWBvoYpa/M2LeZSO0wmxlBmS4HVBByAUStNuCHphyZgobdUE8mIdiB2SjYUclSBeYW zpEVmYu2xrsOZI+MzHz1SFzDUspr+FNjG/L/Ynp/wLFp7QjrDYbGVWe0CW9ypTwSBjqA p9gQaWikLDm16XjigKEupiUHe8pSjpHNhmNHtdQCuPDPTUjB5bExtOw/pWjdQd0K1KbF vljnC0zj5ix1EyOkrNc0FaGLo8RD8oo6/XLf49vhpnUsAX3np0XDJIAl4yb1QBtWPPxL jnNyArei3Tmtu4pRz933V8wEjrtDbE0yVwKlx4RqI4HNR8blxBEqPhLURAXCFu3GMsYQ 5U/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691277319; x=1691882119; 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=rhe3k7N6Zudq4d/t7ExDf16kdAR6Hv2A6e2F4vngjQY=; b=ILfUyI9nWr5M5g5OUi9vCpVLd/7EFFCy8qSv6J9kUMsuMvzcQ/ez7pQ3Y1hmbnimr3 gYDB5wJP8jZZmnAdFlPUK0vLsa06D+qoXYcPJUARogxMQ5bpwieA2F9qV7UwuL30euLj IwDNsikcdBaFxPy7Jf7QpRLGtOuDZ0p9Uo4AsRGa7rRH/OCTW1aXhqYgE+VXUOsvLyhF QsSm1kN5MKyvpmJlAuWkdzvd37lzNBoKswGDMzWnwlmeUw0Bruy+bMQfDfqow/NhOJ+j QW4oRLx7SUOdzl8veNNi+i6Mf2ympiQfezlyZUXg07BqmqDUggmu6ROxVxbmB6a9lWMF ryzQ== X-Gm-Message-State: AOJu0Yyja23oTPRhPyiriFTp9aT9ROoUXdifOuCWWRzP+mWfEO1ysrP+ BIxHs1bA5qLJcoraHLG6itFWO5g7rEw= X-Google-Smtp-Source: AGHT+IHNiVBO9XT0BL7AOhaa5lD/J6dWqynwTVGcBFwKCtq0BZ/r8DcmsQ4GQNJCmW6DL/fxXdemxw== X-Received: by 2002:a19:8c5a:0:b0:4fb:889c:c53d with SMTP id i26-20020a198c5a000000b004fb889cc53dmr3497341lfj.10.1691277318747; Sat, 05 Aug 2023 16:15:18 -0700 (PDT) Received: from toolbox.taileb357.ts.net (89.red-83-35-60.dynamicip.rima-tde.net. [83.35.60.89]) by smtp.gmail.com with ESMTPSA id s9-20020adfecc9000000b0031416362e23sm6212531wro.3.2023.08.05.16.15.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Aug 2023 16:15:18 -0700 (PDT) From: Angel Iglesias To: linux-iio@vger.kernel.org Cc: Angel Iglesias , Jonathan Cameron , Lars-Peter Clausen , Andy Shevchenko , =?utf-8?q?Uwe_Kleine-K?= =?utf-8?q?=C3=B6nig?= , linux-kernel@vger.kernel.org Subject: [PATCH 1/2] iio: pressure: bmp280: i2c: Rearrange vars in reverse xmas tree order Date: Sun, 6 Aug 2023 01:15:02 +0200 Message-ID: <80c7bf32dee57a4a21e5c623b9adbc5e1175f2de.1691276610.git.ang.iglesiasg@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org Minor cleanup reordering local variable declarations following reverse christmas tree convention. Signed-off-by: Angel Iglesias diff --git a/drivers/iio/pressure/bmp280-i2c.c b/drivers/iio/pressure/bmp280-i2c.c index dbe630ad05b5..693eb1975fdc 100644 --- a/drivers/iio/pressure/bmp280-i2c.c +++ b/drivers/iio/pressure/bmp280-i2c.c @@ -7,9 +7,9 @@ static int bmp280_i2c_probe(struct i2c_client *client) { - struct regmap *regmap; - const struct bmp280_chip_info *chip_info; const struct i2c_device_id *id = i2c_client_get_device_id(client); + const struct bmp280_chip_info *chip_info; + struct regmap *regmap; chip_info = device_get_match_data(&client->dev); if (!chip_info) From patchwork Sat Aug 5 23:15:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angel Iglesias X-Patchwork-Id: 13342701 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 9D148C04A6A for ; Sat, 5 Aug 2023 23:15:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229906AbjHEXP6 (ORCPT ); Sat, 5 Aug 2023 19:15:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229999AbjHEXP6 (ORCPT ); Sat, 5 Aug 2023 19:15:58 -0400 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C56D426BE; Sat, 5 Aug 2023 16:15:44 -0700 (PDT) Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-3fe4b45a336so13360155e9.1; Sat, 05 Aug 2023 16:15:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691277343; x=1691882143; 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=XLYg/J+UJ6fbY/mN9HM7bVyp2sfI4lnm/dmzqkwlIjY=; b=H3ug8b0CDCTepLMQsXNP2LkonvE8Y1AJvRJ8q5Sa1DgdXuaKoUGfdeZxRfGyW4zXAD 4d/Cr2HToB5v6VnWHhQiM3pOhOPlR4JGOlJRmRGLXNavcEzA5WsTJygBDiIDlG2675zs prWx7iI2ILpz2ZG28ImDaEE3lnFZyMQxl5INF3azCejE1zsywvc/RePKC2+gc2vRl1NZ kTs0kQ5PMmnk5nci4Ao3h8F/QZwxdhZ9J6C5r2cBjeyg02Z0kG3FFkH1t3kjfKC1D8Cq hdYBKPf9RQHVf0egXPLpHvEWhkK39GhCOaJvg5/hORoluEiwgsSTkXVJBMNRZ+jQ97UB lTJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691277343; x=1691882143; 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=XLYg/J+UJ6fbY/mN9HM7bVyp2sfI4lnm/dmzqkwlIjY=; b=OeAbJE/xK6nEr5mI2wJ9n9yokon1zYnjRVoTg0y3/xuPQYSNGz9dLT6NuFf6V3jl37 Vr9q675BmRzB2bZdd2aUioNpIIk5BCFgp1IzkSJAGk3YB7KTxMHKRmB5+EAlC3fcM03Y Cyv2dvDkiLf9GMXdS7eZwDpO5gCW0En1nKROIge2uFSls/Gf+lR5o5YrLojzan0z7ywq DOVaHF9nwoa0JaRSqfybET1FBdqtbsk+qcDeuktOTuIS75F+hmEA1XjgzWp7pUw4OTKe prkh5au8znO092Yf/uQ1Jq2eRjNaP902Cnic853raT3sP5UvRyVO7X0Ftrk+mc5pf19K hk4g== X-Gm-Message-State: AOJu0YypoCFidl12pbKVDBTHjEa4Spmu6ASgMf9RAmUWXUuSembL54BK AT7Pd18zo6K7wfdnDi7vK5eGEcaS0gw= X-Google-Smtp-Source: AGHT+IFlxP+wGNHdHStcPnqROvQbpKscKDaAOAhTsJ+MrJL5NYJLHY+zLvPS2+4edL+v4KL9A3Va/A== X-Received: by 2002:a5d:408b:0:b0:317:6653:60b8 with SMTP id o11-20020a5d408b000000b00317665360b8mr3450975wrp.50.1691277342682; Sat, 05 Aug 2023 16:15:42 -0700 (PDT) Received: from toolbox.taileb357.ts.net (89.red-83-35-60.dynamicip.rima-tde.net. [83.35.60.89]) by smtp.gmail.com with ESMTPSA id s9-20020adfecc9000000b0031416362e23sm6212531wro.3.2023.08.05.16.15.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Aug 2023 16:15:42 -0700 (PDT) From: Angel Iglesias To: linux-iio@vger.kernel.org Cc: Angel Iglesias , Jonathan Cameron , Lars-Peter Clausen , Andy Shevchenko , =?utf-8?q?Uwe_Kleine-K?= =?utf-8?q?=C3=B6nig?= , linux-kernel@vger.kernel.org Subject: [PATCH 2/2] iio: pressure: bmp280: Use i2c_get_match_data Date: Sun, 6 Aug 2023 01:15:03 +0200 Message-ID: X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org Replaces device_get_match_data() and fallback match_id logic by new unified helper function i2c_get_match_data(). Signed-off-by: Angel Iglesias diff --git a/drivers/iio/pressure/bmp280-i2c.c b/drivers/iio/pressure/bmp280-i2c.c index 693eb1975fdc..4ebaa4edc4fc 100644 --- a/drivers/iio/pressure/bmp280-i2c.c +++ b/drivers/iio/pressure/bmp280-i2c.c @@ -11,9 +11,9 @@ static int bmp280_i2c_probe(struct i2c_client *client) const struct bmp280_chip_info *chip_info; struct regmap *regmap; - chip_info = device_get_match_data(&client->dev); + chip_info = i2c_get_match_data(client); if (!chip_info) - chip_info = (const struct bmp280_chip_info *) id->driver_data; + return -ENODEV; regmap = devm_regmap_init_i2c(client, chip_info->regmap_config); if (IS_ERR(regmap)) {