From patchwork Sun Aug 13 19:03:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angel Iglesias X-Patchwork-Id: 135084 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b824:0:b0:3f2:4152:657d with SMTP id z4csp2367313vqi; Sun, 13 Aug 2023 13:41:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGpNkoeTpghuVKPTTKUezxSpd8gvBJa7xpsTE7aRA0uBKzqn+ATTiGccIbtf0sX37GyYr6S X-Received: by 2002:a17:906:8471:b0:993:d7fe:7f1d with SMTP id hx17-20020a170906847100b00993d7fe7f1dmr6410877ejc.28.1691959316564; Sun, 13 Aug 2023 13:41:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691959316; cv=none; d=google.com; s=arc-20160816; b=LVhRArsX1x7MPHrUlW/QyuOkvneopR54fDn9wTZQuXBU1Q95nT56NbVvXjOfwVttzi LYtCktAvRF2VXpy+zveF6zjwzSVFeRbDQ7na7G6uy8ngOWpLkphFAu3aKfQAqDYOGwly RrILZfEsfUX4Wgzo4Kp0a13+2H8dWH7GHmqqwU2GaOwoeAohkwrE0JvWu06Rhm1qBc+N b2g9P27Q0rF40N+EZs9aPbe8eBMXs6U86iWqhisnhg+OkMbHHkS+hdDg99GWIzTASmGk EPSyfxGpOqpUPKdFaasRcV2hVhuoVmf1R+d7I4MekHwubzXK0z0dHP3OHDQBfN3Qhd6f yb/g== 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=qT6KvO6AkG+6UUYiAgRCVtBsyH8WyFbCMZiWCINn7DE=; fh=Nh4Fe437KuUHrOtNRdsd/yuWVne45zJmV0OSjQBW1n8=; b=BrHHv39b+U+sUSWX5t9a9oZcos24gcgUCGsjmxVCfVvI2VOEe29kmelOcBAPlyzWHN d83HKHwpG912hZStnfx1THo01m39ymiqHD4b2elITtCjA7EDU48CFYowT125y5XDircM 9Fl8o1lBCccKzwnAhAP8qVX/4s//7qXpwCTGHF/4D3NIwPaVThi/E/grV9ekSgohelxF LS7CVG6B1lDGK7eRcGqMpstUnHIlkSPFng7KHAYHN6nR3UNdsR4xggZ23mmY5/uAD0wp 0X5Nfg9bmO1QyZ1NmfHWge4oaJRrPQ/uNw/2Iuil0cJUOCUwo4iqfaHzSUb2IVl/DJDX P3Nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=E6+akNCQ; 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 y14-20020a1709064b0e00b0099cd74432d6si6650004eju.439.2023.08.13.13.41.33; Sun, 13 Aug 2023 13:41:56 -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=E6+akNCQ; 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 S230292AbjHMTEw (ORCPT + 99 others); Sun, 13 Aug 2023 15:04:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229779AbjHMTEt (ORCPT ); Sun, 13 Aug 2023 15:04:49 -0400 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 863A31707; Sun, 13 Aug 2023 12:04:50 -0700 (PDT) Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-3fe1a17f983so32858445e9.3; Sun, 13 Aug 2023 12:04:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691953489; x=1692558289; 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=qT6KvO6AkG+6UUYiAgRCVtBsyH8WyFbCMZiWCINn7DE=; b=E6+akNCQTxQYkXQYuWbDEBrQbAOHKMdT4572BAhnUIHfO4GBE4qtnpCEXzvTrTGTsc wYfomeW6rdTeuzVCP4D5Z9yMgRtg0OH+G0mmS5AkZDJBb+jyoR9dIAiTS+OtggQmBO9y OnspnDdC5rNaxsa7OBZJcMVaMr4+Mv2ZSXmvNS1Q9FWb8CAAbaP1ZAG+0ZmHxjs7Og+d Q7w2il4caniXlHhgfrntbEnOGIi3dCWU+2MsmDtVh2aQ1a7IJ882PZvdQJjHEGaPnUWB G/3skx3sSorjyGWpge3hnPhOicA5a6eX9H95H6MdzGzP3I4aDGPUEBuTp5HDR2K4goEx 70sQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691953489; x=1692558289; 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=qT6KvO6AkG+6UUYiAgRCVtBsyH8WyFbCMZiWCINn7DE=; b=hltFgAdtgwDTdQ12RSc7Q968xaySx1uOxWctcxnQMWEhUuK54ypbBCvShSsXhw1/Jl iQm63S6mvBDTY7JuVe/bTmjNxGvQcJNr62LtxdEWrN0Ja3KQi/14pncLSFeuFaAPP4d3 b//9ERvzxzTHRFNBjxf+yrZV4JEb2VfYThNHP8A//aCoyR6w+1UgEwH1la2UdAo4cQvr QD0OZJAlQ7QKsHAzXP9BhI9eDFKZK+SrswlB0pVjPQAZMsEzD/06RKZRGvYneEtRbsYB X3FHG1yY4sDcEFj3yA/BNGKAxQ4fsQwz8zIG0ArJLS5uZGnMwjUj+ATztnKW7hk54hbR wm+w== X-Gm-Message-State: AOJu0YycOn7ZIzM6IXA8AYIf3SPhOa+gqf/kwce/wSAVxr4GOHcPfBHA +YN8D1bwZvjK0IXEknn20TWDkwERibU= X-Received: by 2002:a7b:ca52:0:b0:3fb:ab56:a66c with SMTP id m18-20020a7bca52000000b003fbab56a66cmr5700357wml.10.1691953488460; Sun, 13 Aug 2023 12:04:48 -0700 (PDT) Received: from localhost.localdomain (35.red-83-35-63.dynamicip.rima-tde.net. [83.35.63.35]) by smtp.gmail.com with ESMTPSA id a2-20020a5d4d42000000b00317ca89f6c5sm12111678wru.107.2023.08.13.12.04.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Aug 2023 12:04:48 -0700 (PDT) From: Angel Iglesias To: linux-iio@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Angel Iglesias , Jonathan Cameron , Lars-Peter Clausen , Andy Shevchenko , =?utf-8?q?Uwe_Kleine-K?= =?utf-8?q?=C3=B6nig?= Subject: [PATCH v2 1/3] iio: pressure: bmp280: i2c: Rearrange vars in reverse xmas tree order Date: Sun, 13 Aug 2023 21:03:54 +0200 Message-ID: <6a32c9c607b248abded7d3f843b000bfbd9a8a29.1691952005.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: 1774147932537695706 X-GMAIL-MSGID: 1774147932537695706 Minor cleanup reordering local variable declarations following reverse christmas tree convention. Signed-off-by: Angel Iglesias diff --git a/drivers/iio/pressure/bmp280-core.c b/drivers/iio/pressure/bmp280-core.c index 6089f3f9d8f4..ea02a623bb58 100644 --- a/drivers/iio/pressure/bmp280-core.c +++ b/drivers/iio/pressure/bmp280-core.c @@ -766,8 +766,8 @@ static const struct iio_info bmp280_info = { static int bmp280_chip_config(struct bmp280_data *data) { - u8 osrs = FIELD_PREP(BMP280_OSRS_TEMP_MASK, data->oversampling_temp + 1) | - FIELD_PREP(BMP280_OSRS_PRESS_MASK, data->oversampling_press + 1); + u8 osrs = FIELD_PREP(BMP280_OSRS_PRESS_MASK, data->oversampling_press + 1) | + FIELD_PREP(BMP280_OSRS_TEMP_MASK, data->oversampling_temp + 1); int ret; ret = regmap_write_bits(data->regmap, BMP280_REG_CTRL_MEAS, 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) diff --git a/drivers/iio/pressure/bmp280-spi.c b/drivers/iio/pressure/bmp280-spi.c index 1dff9bb7c4e9..1c9c01f1b1c7 100644 --- a/drivers/iio/pressure/bmp280-spi.c +++ b/drivers/iio/pressure/bmp280-spi.c @@ -14,8 +14,7 @@ static int bmp280_regmap_spi_write(void *context, const void *data, size_t count) { - struct device *dev = context; - struct spi_device *spi = to_spi_device(dev); + struct spi_device *spi = to_spi_device(context); u8 buf[2]; memcpy(buf, data, 2); @@ -31,8 +30,7 @@ static int bmp280_regmap_spi_write(void *context, const void *data, static int bmp280_regmap_spi_read(void *context, const void *reg, size_t reg_size, void *val, size_t val_size) { - struct device *dev = context; - struct spi_device *spi = to_spi_device(dev); + struct spi_device *spi = to_spi_device(context); return spi_write_then_read(spi, reg, reg_size, val, val_size); } From patchwork Sun Aug 13 19:03:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angel Iglesias X-Patchwork-Id: 135083 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b824:0:b0:3f2:4152:657d with SMTP id z4csp2367311vqi; Sun, 13 Aug 2023 13:41:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF8ad6efXhhZhAekMlsJMDtykLVhFjErMFUosO0oo3WVOeaEG4XZ3UanItM6nLSBZzF3fve X-Received: by 2002:a17:907:2ce9:b0:992:a9c3:244f with SMTP id hz9-20020a1709072ce900b00992a9c3244fmr7058420ejc.4.1691959316583; Sun, 13 Aug 2023 13:41:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691959316; cv=none; d=google.com; s=arc-20160816; b=wuF7hR4g7Updxqvu3dRa77tfqIBhoNNMDqj5Bh/hsUPHjet9A9eHECNl3N5MuAuxLY KHN8mFhcbs2xSgKTBSp6wsl4mwZhVDGvBPDd6jTWyfmcxYKGCJKey0xzNVU4fe2wXCTy t0cJDB3u1hcBisfCCaAZDmeoDREZYd5o0HV4GobI1y6aPe422oGKvq/SK3FInmVxokGu splmJ4GsbaSSFaFkgPO+O7jy8Gn1kWIUlqHmQ/N5JnjQt5bfrvm/ZL7Lir87gXPgP/bk THi9YGOGGO9C3/DZpfS2eHrDkoIk3OgaXNzYK+/XCCqh8SycFhtZzpvdAkHEPIMQcuKl kFmw== 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=G8YB+q6fVqTqNWWbQhr5Ldlkw+mPwEid201v9qRYkhA=; fh=Nh4Fe437KuUHrOtNRdsd/yuWVne45zJmV0OSjQBW1n8=; b=S77OnDdo/o4sH23IpJuTHvvNs8pDJWJVJOu1iPecGjL7nszpfHv/QO3LAdbqpnvxxa wbpJXH+CF9E249c+glvgLBnM8ag2Du2GlOnqznLLhTAMtCeEB3NWvab5v0+ida/iOFUZ d4BbgMOQCKAttTnQzlVcJ/fHMNL5GtVq1/xFMeTCpT08vspLergNUSJ6xPL3dsak1TlE BhlccUUFLzzhv56L5+qHbpZmGo0JgNRZJ9Mk7Vhrf3iYWPTa1lCmCidLxDkjg4XY3nCe jLxOFYLvmmjiIui+L6mxHOV689QYp3gBjD3r04qvsOEMwqZeJ9odzvoWo0MZrP3ETvjN Pi7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b="qYg4/Y3S"; 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 ce11-20020a170906b24b00b0099cfb5dcbeesi6996188ejb.74.2023.08.13.13.41.32; Sun, 13 Aug 2023 13:41:56 -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="qYg4/Y3S"; 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 S230325AbjHMTE5 (ORCPT + 99 others); Sun, 13 Aug 2023 15:04:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230059AbjHMTEy (ORCPT ); Sun, 13 Aug 2023 15:04:54 -0400 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BEE461703; Sun, 13 Aug 2023 12:04:54 -0700 (PDT) Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-31965c94001so1472705f8f.3; Sun, 13 Aug 2023 12:04:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691953493; x=1692558293; 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=G8YB+q6fVqTqNWWbQhr5Ldlkw+mPwEid201v9qRYkhA=; b=qYg4/Y3SWIucTefZvDwpfDoFKN7KRttDfZZX4g7Eu6qdFf3w2dFoAmqDm/lJb9jK32 rwTdDjzOXfchXl3uznBvP8mc+4M3hhO++asllZGUWYDO4VqQ32CF7VAcLn5buBILDUKm gz71NFh7RVLtMHrQlZw97q3Q9akGzfr+qzCiMqCfuiAU3Jcam9IFGvNb2i0igS4pACys 6u6lj8LQ5qsi0Re++mRqXkFyqCN06e18oUQ6Ny6v0aGyumXuPZN5adHlkUJ0PFVnP3cb XrEIKmIRY2UhKNtN1WyTWXNH+J8cRGDs2ROweUoLbj+g0ZTW+CezUwwM6EscdJDclqZK RS+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691953493; x=1692558293; 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=G8YB+q6fVqTqNWWbQhr5Ldlkw+mPwEid201v9qRYkhA=; b=WBpNmj41jIwV+bSgtSSTcuIgLmMtPAdLZi17FiU/Plab57ObnK5tCGaOTxj2HshsnI kGsAhDZeB/AipeB0T8t7G8/Ad8jFKBCtZDKAVy/j/1OCmw7sZL0Lk07eEv+6KieX0rOY a4Edxo7VKqP81pR5cHfw/4ro7FSSZvZwzfXb+KKIzuU2JcIFA/DxHuDNt5uGdXVEjO7C p+i+/wZyNFUcQynMc9o+zrPEICidarBCCZfKgCY38ZM7Jfdjd/dDRvEGEU8H5ar3NeP/ AkRWdgKwUAwJf0WqGecfRHO6E7w9JBzH5G+9aomEmKIZArd6iXSFzXaTD6kh6fhzfS+F YI9w== X-Gm-Message-State: AOJu0YwcVDKz1WRLejPPJ2mFlKHbd91ny+YCtAObo3OHQ+xC9mutP9fo DiqTf2V5jL+ga9xkM/nOuwpA6SClBdo= X-Received: by 2002:adf:f490:0:b0:314:17cc:31d0 with SMTP id l16-20020adff490000000b0031417cc31d0mr5387952wro.34.1691953492932; Sun, 13 Aug 2023 12:04:52 -0700 (PDT) Received: from localhost.localdomain (35.red-83-35-63.dynamicip.rima-tde.net. [83.35.63.35]) by smtp.gmail.com with ESMTPSA id a2-20020a5d4d42000000b00317ca89f6c5sm12111678wru.107.2023.08.13.12.04.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Aug 2023 12:04:52 -0700 (PDT) From: Angel Iglesias To: linux-iio@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Angel Iglesias , Jonathan Cameron , Lars-Peter Clausen , Andy Shevchenko , =?utf-8?q?Uwe_Kleine-K?= =?utf-8?q?=C3=B6nig?= Subject: [PATCH v2 2/3] iio: pressure: bmp280: Use i2c_get_match_data Date: Sun, 13 Aug 2023 21:03:55 +0200 Message-ID: <55f8dc02de16a353f0449bc1c7cb487bd776dfaf.1691952005.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: 1774147190421706509 X-GMAIL-MSGID: 1774147932346437397 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..34e3bc758493 100644 --- a/drivers/iio/pressure/bmp280-i2c.c +++ b/drivers/iio/pressure/bmp280-i2c.c @@ -11,9 +11,7 @@ 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); - if (!chip_info) - chip_info = (const struct bmp280_chip_info *) id->driver_data; + chip_info = i2c_get_match_data(client); regmap = devm_regmap_init_i2c(client, chip_info->regmap_config); if (IS_ERR(regmap)) { From patchwork Sun Aug 13 19:03:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angel Iglesias X-Patchwork-Id: 135079 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b824:0:b0:3f2:4152:657d with SMTP id z4csp2357338vqi; Sun, 13 Aug 2023 13:09:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGKJxYkjWb9c+qCqNITeAtGkuEJYl2w27DitUYelWuB+jxyIV5FzJrO39OoD2qN1gh+iVjU X-Received: by 2002:a17:90b:3105:b0:263:514:5eda with SMTP id gc5-20020a17090b310500b0026305145edamr4278933pjb.29.1691957348055; Sun, 13 Aug 2023 13:09:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691957348; cv=none; d=google.com; s=arc-20160816; b=l81z9FR3c+LnpZRfRP/0cV0otIyvr7aSrPpe1lAg1A0G1a9PLEfhes01Mj/BDNkccM X3deykTWhHbT/WowOoR078iZulQ8yRm2cc/G8GzmymYvMCMTHqX9wN176FJubXeXRP00 If8rFoluK9TbgM0lMdml7QWs/a6XQpno5KOg+0YVE+MOvihVCfWCwJ99CGlFnoHs4eS2 vu3Rea1VeeY5BFOg6roKSzg8rKOpaJ8/mOiVsoriOFDkt6yVyWGaKtK57Iblh5iGSloe sIIxRRWjEVnv9GjPJ41SEMS3rMGxyffIO9/SBRGfvezIVbvAyWnfRke9tEIzt0e7+wmY t+Jw== 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=q0YioFxfrQNoWhYJLctdcMwWLrNlPOgKU0KVIAKARic=; fh=Nh4Fe437KuUHrOtNRdsd/yuWVne45zJmV0OSjQBW1n8=; b=q9GnLEfuFQKFD2lxjzOSpU0raIHzB9VOQnGbG8ctFt9opjCoHggSDhIMOxJeoVUl57 ZqsF0GDZjpHNfoZQbuou7K7RxsSHHqQfq/5nYzBehrntCRSBb+1AtvB0jB/CX4opHTS9 Ec8cMoniGxhFcPGYXbx/t/YUr8+qW7++pLyj54Jry8fFjAKrTxfM/4A0/BjDSTLqDJFR lhbaDzQRsy1I+o2p2IHxTmG1PAvAsU9W8BxVPyMWAZplC99GkdV0fXfIysAnOa9O9op6 etmRI0M2ZsAtlT40Q4Uz5it1NJeIkrMd7cIkdIqOxQfW3WiHntfbQPFumJhZJ2Gca/4B /JCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=eouFrZkW; 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 pg4-20020a17090b1e0400b00263d1729212si9597657pjb.85.2023.08.13.13.08.51; Sun, 13 Aug 2023 13:09:08 -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=eouFrZkW; 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 S231309AbjHMTFF (ORCPT + 99 others); Sun, 13 Aug 2023 15:05:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230437AbjHMTFA (ORCPT ); Sun, 13 Aug 2023 15:05:00 -0400 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27CEC1708; Sun, 13 Aug 2023 12:04:59 -0700 (PDT) Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-3fe2d218eedso34064215e9.0; Sun, 13 Aug 2023 12:04:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691953497; x=1692558297; 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=q0YioFxfrQNoWhYJLctdcMwWLrNlPOgKU0KVIAKARic=; b=eouFrZkWNTsq3yIsbTMErask3onhLhMEfCyXEiTRIbW2jz13bNQTMjJjDE/Qq/24/9 y0KxbpzhkNvlndVRGLKoHpiDcaNDwb2OopCYJGEPL30kn98l8rIoA7hcxcjTygjW7Mic 1FjyPQrZ4tq2FSD8gB9piYDYjEKqYTxGmIvgFQOJRtr/SdudtR9vewb5/+RUGAZIUyrz aZMhxK1uXt+fDJkAvDs8c/YZwsW++zaVSorcE7WxTnvsEOOYSpNUuaruTD6T04Mdmq89 jDrysFkvPgi2ghCQuJRQ8bJ8NnqfOocaOrNBVpDBJug6YOVI1D65ZXrcYndQcA5jq6TW p+SQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691953497; x=1692558297; 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=q0YioFxfrQNoWhYJLctdcMwWLrNlPOgKU0KVIAKARic=; b=GZrkxjzRfAvg/4bH5Q6i2mJWD7KvTbLv9h0W7FqF2BgJQM4DAO1EC8AhvqHH6OpE8p W3GfORU3lkm1jvde+cFt+Sz/CZdEvBW4GLrnt07G4P/ZuvuGRcqOcsxJ7MzEeYsVF9q5 miDWQOlhNw7Z7ZiR/kh4YvBuwBXFUAgzuwU+Dp6mJqoATbHiSpdjR0j9jTfc9dwYVeZA 3p9m27KkBU6/rrPB9B+eRvYGdMmP7AOVQXhNmaR3a/lVwYC2e3iAOARsm0nv/cSgBEXm Rt+9aqlVszsTXNgNx4Eu/Al6CCXdLeO1kVhllK06yrxSzhFEX/oxuC0VCHqR5TXeM2il WqCw== X-Gm-Message-State: AOJu0YxGMSS4Zul5F8KVSx8EOWwPFsxeQFgwyP75P7xGpnXzeM7LB5IN BDKMbZHFMDRYKR1P+JG3msFfXibSQYM= X-Received: by 2002:adf:e6c7:0:b0:314:10d8:b482 with SMTP id y7-20020adfe6c7000000b0031410d8b482mr5491655wrm.65.1691953497345; Sun, 13 Aug 2023 12:04:57 -0700 (PDT) Received: from localhost.localdomain (35.red-83-35-63.dynamicip.rima-tde.net. [83.35.63.35]) by smtp.gmail.com with ESMTPSA id a2-20020a5d4d42000000b00317ca89f6c5sm12111678wru.107.2023.08.13.12.04.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Aug 2023 12:04:57 -0700 (PDT) From: Angel Iglesias To: linux-iio@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Angel Iglesias , Jonathan Cameron , Lars-Peter Clausen , Andy Shevchenko , =?utf-8?q?Uwe_Kleine-K?= =?utf-8?q?=C3=B6nig?= Subject: [PATCH v2 3/3] iio: pressure: bmp280: Use spi_get_device_match_data() Date: Sun, 13 Aug 2023 21:03:56 +0200 Message-ID: <655dde2866d7d28c233eeca507b3d59e90584b74.1691952005.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: 1774145868428749460 X-GMAIL-MSGID: 1774145868428749460 Use the spi_get_device_match_data() helper instead of device_get_match_data() and the fallback match_id logic. Signed-off-by: Angel Iglesias diff --git a/drivers/iio/pressure/bmp280-spi.c b/drivers/iio/pressure/bmp280-spi.c index 1c9c01f1b1c7..433d6fac83c4 100644 --- a/drivers/iio/pressure/bmp280-spi.c +++ b/drivers/iio/pressure/bmp280-spi.c @@ -56,9 +56,7 @@ static int bmp280_spi_probe(struct spi_device *spi) return ret; } - chip_info = device_get_match_data(&spi->dev); - if (!chip_info) - chip_info = (const struct bmp280_chip_info *) id->driver_data; + chip_info = spi_get_device_match_data(spi); regmap = devm_regmap_init(&spi->dev, &bmp280_regmap_bus,