All of lore.kernel.org
 help / color / mirror / Atom feed
From: Angel Iglesias <ang.iglesiasg@gmail.com>
To: linux-iio@vger.kernel.org
Cc: "Biju Das" <biju.das.jz@bp.renesas.com>,
	linux-kernel@vger.kernel.org,
	"Angel Iglesias" <ang.iglesiasg@gmail.com>,
	"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
	"Jonathan Cameron" <jic23@kernel.org>,
	"Lars-Peter Clausen" <lars@metafoo.de>,
	"Phil Elwell" <phil@raspberrypi.com>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Subject: [PATCH v2 2/5] iio: pressure: bmp280: Use spi_get_device_match_data()
Date: Sun, 22 Oct 2023 19:22:18 +0200	[thread overview]
Message-ID: <9ea8ac90b2b8a8cf45803d0435243c0bee009b37.1697994521.git.ang.iglesiasg@gmail.com> (raw)
In-Reply-To: <cover.1697994521.git.ang.iglesiasg@gmail.com>

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 <ang.iglesiasg@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

diff --git a/drivers/iio/pressure/bmp280-spi.c b/drivers/iio/pressure/bmp280-spi.c
index 1dff9bb7c4e9..2eed483a8cc4 100644
--- a/drivers/iio/pressure/bmp280-spi.c
+++ b/drivers/iio/pressure/bmp280-spi.c
@@ -58,9 +58,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,
-- 
2.42.0


  parent reply	other threads:[~2023-10-22 17:23 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-22 17:22 [PATCH v2 0/5] Add support for BMP390 and various driver cleanups Angel Iglesias
2023-10-22 17:22 ` [PATCH v2 1/5] iio: pressure: bmp280: Use i2c_get_match_data() Angel Iglesias
2023-10-23 11:21   ` Andy Shevchenko
2023-10-23 14:00     ` Angel Iglesias
2023-10-23 20:05       ` Andy Shevchenko
2023-10-22 17:22 ` Angel Iglesias [this message]
2023-10-22 17:22 ` [PATCH v2 3/5] iio: pressure: bmp280: Rearrange vars in reverse xmas tree order Angel Iglesias
2023-10-22 17:22 ` [PATCH v2 4/5] iio: pressure: bmp280: Allow multiple chips id per family of devices Angel Iglesias
2023-10-23 11:25   ` Andy Shevchenko
     [not found]     ` <20231027144234.0ad6c7b6@jic23-huawei>
     [not found]       ` <20231027144625.36cc694c@jic23-huawei>
2023-10-28 11:23         ` Angel Iglesias
2023-10-28 13:07           ` Jonathan Cameron
2023-10-22 17:22 ` [PATCH v2 5/5] iio: pressure: bmp280: Add support for BMP390 Angel Iglesias

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9ea8ac90b2b8a8cf45803d0435243c0bee009b37.1697994521.git.ang.iglesiasg@gmail.com \
    --to=ang.iglesiasg@gmail.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=biju.das.jz@bp.renesas.com \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linus.walleij@linaro.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=phil@raspberrypi.com \
    --cc=u.kleine-koenig@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.