diff mbox series

[v2,1/2] iio: magnetometer: yamaha-yas530: Use i2c_get_match_data()

Message ID 20230812065741.20990-2-biju.das.jz@bp.renesas.com (mailing list archive)
State Accepted
Headers show
Series Use i2c_get_match_data() for yamaha-yas530 | expand

Commit Message

Biju Das Aug. 12, 2023, 6:57 a.m. UTC
Simplify the probe() by replacing device_get_match_data() with
i2c_get_match_data().

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v1->v2:
 * Split dropping enum chip_ids as separate patch
---
 drivers/iio/magnetometer/yamaha-yas530.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Andy Shevchenko Aug. 15, 2023, 6:50 a.m. UTC | #1
On Sat, Aug 12, 2023 at 07:57:40AM +0100, Biju Das wrote:
> Simplify the probe() by replacing device_get_match_data() with
> i2c_get_match_data().

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Jonathan Cameron Aug. 28, 2023, 1:09 p.m. UTC | #2
On Tue, 15 Aug 2023 09:50:18 +0300
Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:

> On Sat, Aug 12, 2023 at 07:57:40AM +0100, Biju Das wrote:
> > Simplify the probe() by replacing device_get_match_data() with
> > i2c_get_match_data().  
> 
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Applied just this patch.

Thanks,

Jonathan

>
diff mbox series

Patch

diff --git a/drivers/iio/magnetometer/yamaha-yas530.c b/drivers/iio/magnetometer/yamaha-yas530.c
index c5e485bfc6fc..7b041bb38693 100644
--- a/drivers/iio/magnetometer/yamaha-yas530.c
+++ b/drivers/iio/magnetometer/yamaha-yas530.c
@@ -1434,9 +1434,7 @@  static int yas5xx_probe(struct i2c_client *i2c)
 		goto assert_reset;
 	}
 
-	ci = device_get_match_data(dev);
-	if (!ci)
-		ci = (const struct yas5xx_chip_info *)id->driver_data;
+	ci = i2c_get_match_data(i2c);
 	yas5xx->chip_info = ci;
 
 	ret = regmap_read(yas5xx->map, YAS5XX_DEVICE_ID, &id_check);