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: 131550 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp675839vqr; Sat, 5 Aug 2023 16:38:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHRXpVexGne2QE4pX9m874rqU6zaiD/9WmsBN6+MmDHIBOVyln/UIQjQTwH1CoFg4iqJ8db X-Received: by 2002:a17:90b:4f48:b0:268:b64b:f684 with SMTP id pj8-20020a17090b4f4800b00268b64bf684mr5129042pjb.33.1691278730742; Sat, 05 Aug 2023 16:38:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691278730; cv=none; d=google.com; s=arc-20160816; b=oxEX8MFTGh9GkWcAWOVbI3NCvdJtW/qfbE6tjpNftM7ZoWP4O+G+237A0JjRCx9MbZ pHbwtRELkwLt+yGxtByGQLxJ48PozPPg96bZVnDqJuBdEYPtGZQpEh1orSa/GBEyba1b 1tiX3xKAl3T+rHhD0T9OhITxmjlY887lytG8oTY9BL4VrK697qS1vhOdITkuJ1sFSoJY jDp3vZxXj56sSq0TWSkJC3O2AVoQcCmU58Pz5c5kxueVKfmWmG/9atWmGX2ZOg20EWzj Rh6CcODYffk6vfaUObQyECzZrLX1FCI03jykZ3Dr2Yqf6fKqVXotO+c9BD+33+L+TwAV Mm8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=rhe3k7N6Zudq4d/t7ExDf16kdAR6Hv2A6e2F4vngjQY=; fh=IsiLy6JSrE46s8FLSvjAHSHod6n3PCFgfRLA/rXEpK4=; b=utdSc1FqQ+SlpA/A/y2I5r8WBGmOPVkv6gt4H0+jqxivvExqg5RThddCGYcPcCaYN1 4xvuI6hC9g3I2J2wCk8Kmw7Xvfb2d/5auNlymqo8zAGdT15yDkUX56uD/z74eL9TczyF CIxeDvld6updCmy6ZDPLLDKrN5LRGFwnOdWT6FsYSa3RWcDxfMUXBTSC54eezBJEmZKw ASQymRXjHvDnOE0PRPdapKt0fnQhkA+UOYgUrYldgS0X297CcS1G1UGSvA2H5ARNQGKg /yl1VrzTZwAQ77Wktv64T08r7l5bfWUK/hLVGqMKM/Ov47ENUwh/9byWvI/avv0+IHoI zRzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=YWBvoYpa; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f24-20020a17090aa79800b0026306246efdsi6823651pjq.84.2023.08.05.16.38.38; Sat, 05 Aug 2023 16:38:50 -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=@gmail.com header.s=20221208 header.b=YWBvoYpa; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230072AbjHEXPZ (ORCPT + 99 others); Sat, 5 Aug 2023 19:15:25 -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-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 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773434286255088290 X-GMAIL-MSGID: 1773434286255088290 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: 131555 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp707458vqr; Sat, 5 Aug 2023 18:34:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHMt89969XeCzvx5/sF5TYVN0xi5luGOZzbKsXbKbqVhrQ8LKnb2rssBIrT2n+pjcoInsmD X-Received: by 2002:a05:6a20:a11a:b0:13e:b58a:e3e8 with SMTP id q26-20020a056a20a11a00b0013eb58ae3e8mr5575296pzk.50.1691285655849; Sat, 05 Aug 2023 18:34:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691285655; cv=none; d=google.com; s=arc-20160816; b=LWbYzHxYgmhl9eBPzL0T2qiZyAwVtXXsqZMAl55kgsOVlm3zcxTQO2+UNyoGqK5yWM SDZLlH81QSj75zzNTf1RijIA8Y4i5q5qZvaLcpv+bvzW7wOCN3D9SARtuWQ7mCk5XrUn et2jMtZBdEIvHqX8cTZ8sUCFIdzhFom5/Q1NADAgdOljAsuMaFUzfLw5T2JOZmaGYCLB C0hckuHrNkg9mbUTvtMOcq5PXw0neF/99vgetlMdSNycL4TFDDawLcKJqCr26RKyWRK6 j6xmp3lXXKLbF1ecPoHYgQEKeeLsHNyPj+fncOwOLxDhbH0BlHqojOBqP9dBMiPSCVeY 4GZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=XLYg/J+UJ6fbY/mN9HM7bVyp2sfI4lnm/dmzqkwlIjY=; fh=IsiLy6JSrE46s8FLSvjAHSHod6n3PCFgfRLA/rXEpK4=; b=Xyfal5bkzywIDkHFpFrPvt3pP3xLnMsQorWHw/Z8XAzgAa1xWA9jw290H4K3JrntuL RSqHMDAuy2sg5V1G/bpmEcxXVtX0NIJA1BCQEOgS0qHjgPg1uC/CGpCGLukcMuNbq9nn F1OICMBya14t5pTjVtXTGe68mv2ljGRJbU3s5cDBR2YQ2elOpvLKLJ48bJiY93C7oPQX RijMVcAGblWgHHpKQ5LemMon6AY/ArITOHsAIYOo73VT783nbOYVE2Bmkv2z9+QlxP/3 5i1VkMTUEL1EdsmkjjTtfViNx9CpeQnHK1hcHqlxCNV30Kntga9aXsHkgiyGTxfKMTeo MjZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=H3ug8b0C; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j34-20020a632322000000b005644829012fsi3874805pgj.701.2023.08.05.18.34.02; Sat, 05 Aug 2023 18:34:15 -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=@gmail.com header.s=20221208 header.b=H3ug8b0C; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229479AbjHEXP7 (ORCPT + 99 others); Sat, 5 Aug 2023 19:15:59 -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-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 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773441547696744009 X-GMAIL-MSGID: 1773441547696744009 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)) {