mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v3] iio: gyro: bmg160_spi: add of_match_table
@ 2025-03-06 14:57 Jun Yan
  2025-03-07  3:46 ` Marcelo Schmitt
  0 siblings, 1 reply; 3+ messages in thread
From: Jun Yan @ 2025-03-06 14:57 UTC (permalink / raw)
  To: jic23; +Cc: lars, linux-iio, linux-kernel, Jun Yan

Add the missing of_match_table to bmg160_spi
driver to enhance device tree compatibility.

Signed-off-by: Jun Yan <jerrysteve1101@gmail.com>

---

Changes in v3
- Adjust the content of the commit message; there are no code changes.
- Link to v2: https://lore.kernel.org/linux-iio/20250220165001.273325-1-jerrysteve1101@gmail.com/

Changes in v2
- Fix a syntax error (a missing comma after the .of_match_table = bmg160_of_match).
- Fix the style issues found by checkpatch.pl.
- Link to v1: https://lore.kernel.org/linux-iio/20250219150254.24664-1-jerrysteve1101@gmail.com/

---
 drivers/iio/gyro/bmg160_spi.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/iio/gyro/bmg160_spi.c b/drivers/iio/gyro/bmg160_spi.c
index fc2e453527b9..ac04b3b1b554 100644
--- a/drivers/iio/gyro/bmg160_spi.c
+++ b/drivers/iio/gyro/bmg160_spi.c
@@ -41,9 +41,19 @@ static const struct spi_device_id bmg160_spi_id[] = {
 
 MODULE_DEVICE_TABLE(spi, bmg160_spi_id);
 
+static const struct of_device_id bmg160_of_match[] = {
+	{ .compatible = "bosch,bmg160" },
+	{ .compatible = "bosch,bmi055_gyro" },
+	{ .compatible = "bosch,bmi088_gyro" },
+	{ }
+};
+
+MODULE_DEVICE_TABLE(of, bmg160_of_match);
+
 static struct spi_driver bmg160_spi_driver = {
 	.driver = {
 		.name	= "bmg160_spi",
+		.of_match_table = bmg160_of_match,
 		.pm	= &bmg160_pm_ops,
 	},
 	.probe		= bmg160_spi_probe,
-- 
2.48.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v3] iio: gyro: bmg160_spi: add of_match_table
  2025-03-06 14:57 [PATCH v3] iio: gyro: bmg160_spi: add of_match_table Jun Yan
@ 2025-03-07  3:46 ` Marcelo Schmitt
  2025-03-08 14:34   ` Jonathan Cameron
  0 siblings, 1 reply; 3+ messages in thread
From: Marcelo Schmitt @ 2025-03-07  3:46 UTC (permalink / raw)
  To: Jun Yan; +Cc: jic23, lars, linux-iio, linux-kernel

On 03/06, Jun Yan wrote:
> Add the missing of_match_table to bmg160_spi
> driver to enhance device tree compatibility.
> 
> Signed-off-by: Jun Yan <jerrysteve1101@gmail.com>
> 
> ---

LGTM

Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>

> 
> Changes in v3
> - Adjust the content of the commit message; there are no code changes.
> - Link to v2: https://lore.kernel.org/linux-iio/20250220165001.273325-1-jerrysteve1101@gmail.com/
> 
> Changes in v2
> - Fix a syntax error (a missing comma after the .of_match_table = bmg160_of_match).
> - Fix the style issues found by checkpatch.pl.
> - Link to v1: https://lore.kernel.org/linux-iio/20250219150254.24664-1-jerrysteve1101@gmail.com/
> 
> ---
>  drivers/iio/gyro/bmg160_spi.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/iio/gyro/bmg160_spi.c b/drivers/iio/gyro/bmg160_spi.c
> index fc2e453527b9..ac04b3b1b554 100644
> --- a/drivers/iio/gyro/bmg160_spi.c
> +++ b/drivers/iio/gyro/bmg160_spi.c
> @@ -41,9 +41,19 @@ static const struct spi_device_id bmg160_spi_id[] = {
>  
>  MODULE_DEVICE_TABLE(spi, bmg160_spi_id);
>  
> +static const struct of_device_id bmg160_of_match[] = {
> +	{ .compatible = "bosch,bmg160" },
> +	{ .compatible = "bosch,bmi055_gyro" },
> +	{ .compatible = "bosch,bmi088_gyro" },
> +	{ }
> +};
> +
> +MODULE_DEVICE_TABLE(of, bmg160_of_match);
> +
>  static struct spi_driver bmg160_spi_driver = {
>  	.driver = {
>  		.name	= "bmg160_spi",
> +		.of_match_table = bmg160_of_match,
>  		.pm	= &bmg160_pm_ops,
>  	},
>  	.probe		= bmg160_spi_probe,
> -- 
> 2.48.1
> 
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v3] iio: gyro: bmg160_spi: add of_match_table
  2025-03-07  3:46 ` Marcelo Schmitt
@ 2025-03-08 14:34   ` Jonathan Cameron
  0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2025-03-08 14:34 UTC (permalink / raw)
  To: Marcelo Schmitt; +Cc: Jun Yan, lars, linux-iio, linux-kernel

On Fri, 7 Mar 2025 00:46:29 -0300
Marcelo Schmitt <marcelo.schmitt1@gmail.com> wrote:

> On 03/06, Jun Yan wrote:
> > Add the missing of_match_table to bmg160_spi
> > driver to enhance device tree compatibility.

Wrap commit messages to 75 chars.

> > 
> > Signed-off-by: Jun Yan <jerrysteve1101@gmail.com>
> > 
> > ---  
> 
> LGTM
> 
> Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Applied with commit message wrap tweaked.  Initially applied to the
testing branch of iio.git to give some exposure to the 0-day bot.

Thanks,

Jonathan

> 
> > 
> > Changes in v3
> > - Adjust the content of the commit message; there are no code changes.
> > - Link to v2: https://lore.kernel.org/linux-iio/20250220165001.273325-1-jerrysteve1101@gmail.com/
> > 
> > Changes in v2
> > - Fix a syntax error (a missing comma after the .of_match_table = bmg160_of_match).
> > - Fix the style issues found by checkpatch.pl.
> > - Link to v1: https://lore.kernel.org/linux-iio/20250219150254.24664-1-jerrysteve1101@gmail.com/
> > 
> > ---
> >  drivers/iio/gyro/bmg160_spi.c | 10 ++++++++++
> >  1 file changed, 10 insertions(+)
> > 
> > diff --git a/drivers/iio/gyro/bmg160_spi.c b/drivers/iio/gyro/bmg160_spi.c
> > index fc2e453527b9..ac04b3b1b554 100644
> > --- a/drivers/iio/gyro/bmg160_spi.c
> > +++ b/drivers/iio/gyro/bmg160_spi.c
> > @@ -41,9 +41,19 @@ static const struct spi_device_id bmg160_spi_id[] = {
> >  
> >  MODULE_DEVICE_TABLE(spi, bmg160_spi_id);
> >  
> > +static const struct of_device_id bmg160_of_match[] = {
> > +	{ .compatible = "bosch,bmg160" },
> > +	{ .compatible = "bosch,bmi055_gyro" },
> > +	{ .compatible = "bosch,bmi088_gyro" },
> > +	{ }
> > +};
> > +
> > +MODULE_DEVICE_TABLE(of, bmg160_of_match);
> > +
> >  static struct spi_driver bmg160_spi_driver = {
> >  	.driver = {
> >  		.name	= "bmg160_spi",
> > +		.of_match_table = bmg160_of_match,
> >  		.pm	= &bmg160_pm_ops,
> >  	},
> >  	.probe		= bmg160_spi_probe,
> > -- 
> > 2.48.1
> > 
> >   


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-03-08 14:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-06 14:57 [PATCH v3] iio: gyro: bmg160_spi: add of_match_table Jun Yan
2025-03-07  3:46 ` Marcelo Schmitt
2025-03-08 14:34   ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®