[v2,1/5] iio: pressure: bmp280: Use i2c_get_match_data()

Message ID 0554ddae62ba04ccacf58c2de04ec598c876665e.1697994521.git.ang.iglesiasg@gmail.com
State New
Headers
Series Add support for BMP390 and various driver cleanups |

Commit Message

Angel Iglesias Oct. 22, 2023, 5:22 p.m. UTC
  From: Biju Das <biju.das.jz@bp.renesas.com>

Replace device_get_match_data() and id lookup for retrieving match data
by i2c_get_match_data().

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
  

Comments

Andy Shevchenko Oct. 23, 2023, 11:21 a.m. UTC | #1
On Sun, Oct 22, 2023 at 07:22:17PM +0200, Angel Iglesias wrote:
> From: Biju Das <biju.das.jz@bp.renesas.com>
> 
> Replace device_get_match_data() and id lookup for retrieving match data
> by i2c_get_match_data().
> 
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Hmm... What tools have you used to format/send this? It seems differs
to what `git format-patch` does.
  
Angel Iglesias Oct. 23, 2023, 2 p.m. UTC | #2
On Mon, 2023-10-23 at 14:21 +0300, Andy Shevchenko wrote:
> On Sun, Oct 22, 2023 at 07:22:17PM +0200, Angel Iglesias wrote:
> > From: Biju Das <biju.das.jz@bp.renesas.com>
> > 
> > Replace device_get_match_data() and id lookup for retrieving match data
> > by i2c_get_match_data().
> > 
> > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> > Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> 
> Hmm... What tools have you used to format/send this? It seems differs
> to what `git format-patch` does.
> 

I just applied this patch from Biju's series with "git am" and then generated
this series running the following invocation:
"git format-patch -v2 -p -n --thread --cover-letter 
--to=linux-iio@vger.kernel.org --base=iio_upstream/togreg HEAD~5"
My work repository is publicly available here:
https://github.com/angiglesias/linux/commits/iio-bmp280-add-bmp390-support

Kind regards,
Angel
  
Andy Shevchenko Oct. 23, 2023, 8:05 p.m. UTC | #3
On Mon, Oct 23, 2023 at 04:00:53PM +0200, Angel Iglesias wrote:
> On Mon, 2023-10-23 at 14:21 +0300, Andy Shevchenko wrote:
> > On Sun, Oct 22, 2023 at 07:22:17PM +0200, Angel Iglesias wrote:
> > > From: Biju Das <biju.das.jz@bp.renesas.com>
> > > 
> > > Replace device_get_match_data() and id lookup for retrieving match data
> > > by i2c_get_match_data().
> > > 
> > > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> > > Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > 
> > Hmm... What tools have you used to format/send this? It seems differs
> > to what `git format-patch` does.
> 
> I just applied this patch from Biju's series with "git am" and then generated
> this series running the following invocation:
> "git format-patch -v2 -p -n --thread --cover-letter 
> --to=linux-iio@vger.kernel.org --base=iio_upstream/togreg HEAD~5"
> My work repository is publicly available here:
> https://github.com/angiglesias/linux/commits/iio-bmp280-add-bmp390-support

Somehow the diffstat is stripped off...
  

Patch

diff --git a/drivers/iio/pressure/bmp280-i2c.c b/drivers/iio/pressure/bmp280-i2c.c
index dbe630ad05b5..b3e069730f97 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;
 	const struct i2c_device_id *id = i2c_client_get_device_id(client);
 
-	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)) {