linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next v2 1/5] misc: microchip: pci1xxxx: fix error handling in gp_aux_bus_probe()
@ 2022-09-07 14:58 Wei Yongjun
  2022-09-07 14:58 ` [PATCH -next v2 2/5] misc: microchip: pci1xxxx: Fix missing spin_lock_init() Wei Yongjun
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Wei Yongjun @ 2022-09-07 14:58 UTC (permalink / raw)
  To: Kumaravel Thiagarajan, Arnd Bergmann, Greg Kroah-Hartman
  Cc: Wei Yongjun, linux-gpio, linux-kernel

From: Wei Yongjun <weiyongjun1@huawei.com>

In some error handling path, resoures alloced may not released.
This patch fix them.

Fixes: 393fc2f5948f ("misc: microchip: pci1xxxx: load auxiliary bus driver for the PIO function in the multi-function endpoint of pci1xxxx device.")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
v1 - > v2: add fixes tag, fix pci_alloc_irq_vectors handing
---
 drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gp.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gp.c b/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gp.c
index bfc03028b34d..11f79f239006 100644
--- a/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gp.c
+++ b/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gp.c
@@ -87,12 +87,13 @@ static int gp_aux_bus_probe(struct pci_dev *pdev, const struct pci_device_id *id
 	retval = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES);
 
 	if (retval < 0)
-		return retval;
+		goto err_aux_dev_init_1;
 
-	pdev->irq = pci_irq_vector(pdev, 0);
-	if (pdev->irq < 0)
-		return retval;
+	retval = pci_irq_vector(pdev, 0);
+	if (retval < 0)
+		goto err_aux_dev_init_1;
 
+	pdev->irq = retval;
 	aux_bus->aux_device_wrapper[1]->gp_aux_data.irq_num = pdev->irq;
 
 	retval = auxiliary_device_init(&aux_bus->aux_device_wrapper[1]->aux_dev);
-- 
2.34.1


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

* [PATCH -next v2 2/5] misc: microchip: pci1xxxx: Fix missing spin_lock_init()
  2022-09-07 14:58 [PATCH -next v2 1/5] misc: microchip: pci1xxxx: fix error handling in gp_aux_bus_probe() Wei Yongjun
@ 2022-09-07 14:58 ` Wei Yongjun
  2022-09-08  5:59   ` Kumaravel.Thiagarajan
  2022-09-07 14:58 ` [PATCH -next v2 3/5] misc: microchip: pci1xxxx: Make symbol 'pci1xxxx_gpio_auxiliary_id_table' static Wei Yongjun
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: Wei Yongjun @ 2022-09-07 14:58 UTC (permalink / raw)
  To: Kumaravel Thiagarajan, Arnd Bergmann, Greg Kroah-Hartman
  Cc: Wei Yongjun, linux-gpio, linux-kernel

From: Wei Yongjun <weiyongjun1@huawei.com>

The driver allocates the spinlock but not initialize it.
Use spin_lock_init() on it to initialize it correctly.

Fixes: 7d3e4d807df2 ("misc: microchip: pci1xxxx: load gpio driver for the gpio controller auxiliary device enumerated by the auxiliary bus driver.")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
v1 -> v2: add fixes tag
---
 drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c b/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c
index 230503cca2ff..47e6e87938ae 100644
--- a/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c
+++ b/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c
@@ -383,6 +383,7 @@ static int pci1xxxx_gpio_probe(struct auxiliary_device *aux_dev,
 	if (!priv)
 		return -ENOMEM;
 
+	spin_lock_init(&priv->lock);
 	priv->aux_dev = aux_dev;
 
 	if (!devm_request_mem_region(&aux_dev->dev, pdata->region_start, 0x800, aux_dev->name))
-- 
2.34.1


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

* [PATCH -next v2 3/5] misc: microchip: pci1xxxx: Make symbol 'pci1xxxx_gpio_auxiliary_id_table' static
  2022-09-07 14:58 [PATCH -next v2 1/5] misc: microchip: pci1xxxx: fix error handling in gp_aux_bus_probe() Wei Yongjun
  2022-09-07 14:58 ` [PATCH -next v2 2/5] misc: microchip: pci1xxxx: Fix missing spin_lock_init() Wei Yongjun
@ 2022-09-07 14:58 ` Wei Yongjun
  2022-09-08  6:02   ` Kumaravel.Thiagarajan
  2022-09-07 14:58 ` [PATCH -next v2 4/5] misc: microchip: pci1xxxx: Add missing MODULE_DEVICE_TABLE Wei Yongjun
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: Wei Yongjun @ 2022-09-07 14:58 UTC (permalink / raw)
  To: Kumaravel Thiagarajan, Arnd Bergmann, Greg Kroah-Hartman
  Cc: Wei Yongjun, linux-gpio, linux-kernel, kernel test robot

From: Wei Yongjun <weiyongjun1@huawei.com>

The sparse tool complains as follows:

drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c:409:34: warning:
 symbol 'pci1xxxx_gpio_auxiliary_id_table' was not declared. Should it be static?

This symbol is not used outside of mchp_pci1xxxx_gpio.c, so marks it static.

Fixes: 7d3e4d807df2 ("misc: microchip: pci1xxxx: load gpio driver for the gpio controller auxiliary device enumerated by the auxiliary bus driver.")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
v1 -> v2: add fixes tag and reported-by
---
 drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c b/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c
index 47e6e87938ae..4f26871994ee 100644
--- a/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c
+++ b/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c
@@ -407,7 +407,7 @@ static int pci1xxxx_gpio_probe(struct auxiliary_device *aux_dev,
 
 static SIMPLE_DEV_PM_OPS(pci1xxxx_gpio_pm_ops, pci1xxxx_gpio_suspend, pci1xxxx_gpio_resume);
 
-const struct auxiliary_device_id pci1xxxx_gpio_auxiliary_id_table[] = {
+static const struct auxiliary_device_id pci1xxxx_gpio_auxiliary_id_table[] = {
 	{.name = "mchp_pci1xxxx_gp.gp_gpio"},
 	{}
 };
-- 
2.34.1


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

* [PATCH -next v2 4/5] misc: microchip: pci1xxxx: Add missing MODULE_DEVICE_TABLE
  2022-09-07 14:58 [PATCH -next v2 1/5] misc: microchip: pci1xxxx: fix error handling in gp_aux_bus_probe() Wei Yongjun
  2022-09-07 14:58 ` [PATCH -next v2 2/5] misc: microchip: pci1xxxx: Fix missing spin_lock_init() Wei Yongjun
  2022-09-07 14:58 ` [PATCH -next v2 3/5] misc: microchip: pci1xxxx: Make symbol 'pci1xxxx_gpio_auxiliary_id_table' static Wei Yongjun
@ 2022-09-07 14:58 ` Wei Yongjun
  2022-09-08  6:04   ` Kumaravel.Thiagarajan
  2022-09-07 14:58 ` [PATCH -next v2 5/5] misc: microchip: pci1xxxx: use module_auxiliary_driver Wei Yongjun
  2022-09-08  5:56 ` [PATCH -next v2 1/5] misc: microchip: pci1xxxx: fix error handling in gp_aux_bus_probe() Kumaravel.Thiagarajan
  4 siblings, 1 reply; 10+ messages in thread
From: Wei Yongjun @ 2022-09-07 14:58 UTC (permalink / raw)
  To: Kumaravel Thiagarajan, Arnd Bergmann, Greg Kroah-Hartman
  Cc: Wei Yongjun, linux-gpio, linux-kernel

From: Wei Yongjun <weiyongjun1@huawei.com>

This patch adds missing MODULE_DEVICE_TABLE definition which generates
correct modalias for automatic loading of this driver when it is built
as an external module.

Fixes: 7d3e4d807df2 ("misc: microchip: pci1xxxx: load gpio driver for the gpio controller auxiliary device enumerated by the auxiliary bus driver.")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
v1 -> v2: add fixes tag
---
 drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c b/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c
index 4f26871994ee..fa80a7788596 100644
--- a/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c
+++ b/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c
@@ -411,6 +411,7 @@ static const struct auxiliary_device_id pci1xxxx_gpio_auxiliary_id_table[] = {
 	{.name = "mchp_pci1xxxx_gp.gp_gpio"},
 	{}
 };
+MODULE_DEVICE_TABLE(auxiliary, pci1xxxx_gpio_auxiliary_id_table);
 
 static struct auxiliary_driver pci1xxxx_gpio_driver = {
 	.driver = {
-- 
2.34.1


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

* [PATCH -next v2 5/5] misc: microchip: pci1xxxx: use module_auxiliary_driver
  2022-09-07 14:58 [PATCH -next v2 1/5] misc: microchip: pci1xxxx: fix error handling in gp_aux_bus_probe() Wei Yongjun
                   ` (2 preceding siblings ...)
  2022-09-07 14:58 ` [PATCH -next v2 4/5] misc: microchip: pci1xxxx: Add missing MODULE_DEVICE_TABLE Wei Yongjun
@ 2022-09-07 14:58 ` Wei Yongjun
  2022-09-08  6:16   ` Kumaravel.Thiagarajan
  2022-09-08  5:56 ` [PATCH -next v2 1/5] misc: microchip: pci1xxxx: fix error handling in gp_aux_bus_probe() Kumaravel.Thiagarajan
  4 siblings, 1 reply; 10+ messages in thread
From: Wei Yongjun @ 2022-09-07 14:58 UTC (permalink / raw)
  To: Kumaravel Thiagarajan, Arnd Bergmann, Greg Kroah-Hartman
  Cc: Wei Yongjun, linux-gpio, linux-kernel

From: Wei Yongjun <weiyongjun1@huawei.com>

Use the module_auxiliary_driver() macro to make the code simpler
by eliminating module_init and module_exit calls.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c b/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c
index fa80a7788596..9cc771c604ed 100644
--- a/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c
+++ b/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c
@@ -421,19 +421,7 @@ static struct auxiliary_driver pci1xxxx_gpio_driver = {
 	.probe = pci1xxxx_gpio_probe,
 	.id_table = pci1xxxx_gpio_auxiliary_id_table
 };
-
-static int __init pci1xxxx_gpio_driver_init(void)
-{
-	return auxiliary_driver_register(&pci1xxxx_gpio_driver);
-}
-
-static void __exit pci1xxxx_gpio_driver_exit(void)
-{
-	auxiliary_driver_unregister(&pci1xxxx_gpio_driver);
-}
-
-module_init(pci1xxxx_gpio_driver_init);
-module_exit(pci1xxxx_gpio_driver_exit);
+module_auxiliary_driver(pci1xxxx_gpio_driver);
 
 MODULE_DESCRIPTION("Microchip Technology Inc. PCI1xxxx GPIO controller");
 MODULE_AUTHOR("Kumaravel Thiagarajan <kumaravel.thiagarajan@microchip.com>");
-- 
2.34.1


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

* RE: [PATCH -next v2 1/5] misc: microchip: pci1xxxx: fix error handling in gp_aux_bus_probe()
  2022-09-07 14:58 [PATCH -next v2 1/5] misc: microchip: pci1xxxx: fix error handling in gp_aux_bus_probe() Wei Yongjun
                   ` (3 preceding siblings ...)
  2022-09-07 14:58 ` [PATCH -next v2 5/5] misc: microchip: pci1xxxx: use module_auxiliary_driver Wei Yongjun
@ 2022-09-08  5:56 ` Kumaravel.Thiagarajan
  4 siblings, 0 replies; 10+ messages in thread
From: Kumaravel.Thiagarajan @ 2022-09-08  5:56 UTC (permalink / raw)
  To: weiyongjun, arnd, gregkh; +Cc: weiyongjun1, linux-gpio, linux-kernel

> -----Original Message-----
> From: Wei Yongjun <weiyongjun@huaweicloud.com>
> Sent: Wednesday, September 7, 2022 8:28 PM
> To: Kumaravel Thiagarajan - I21417
> <Kumaravel.Thiagarajan@microchip.com>; Arnd Bergmann
> <arnd@arndb.de>; Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Wei Yongjun <weiyongjun1@huawei.com>; linux-gpio@vger.kernel.org;
> linux-kernel@vger.kernel.org
> Subject: [PATCH -next v2 1/5] misc: microchip: pci1xxxx: fix error handling in
> gp_aux_bus_probe()
> 
> 
> From: Wei Yongjun <weiyongjun1@huawei.com>
> 
> In some error handling path, resoures alloced may not released.
> This patch fix them.
Greg, I have identified some more improvements necessary for the gp_aux_bus_probe function.
I am working on it.
But this patch can still be applied.

> 
> Fixes: 393fc2f5948f ("misc: microchip: pci1xxxx: load auxiliary bus driver for the PIO function in the multi-function endpoint of pci1xxxx device.")

Reviewed-by: Kumaravel Thiagarajan <kumaravel.thiagarajan@microchip.com>

> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
> v1 - > v2: add fixes tag, fix pci_alloc_irq_vectors handing
> ---
>  drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gp.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gp.c
> b/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gp.c
> index bfc03028b34d..11f79f239006 100644
> --- a/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gp.c
> +++ b/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gp.c
> @@ -87,12 +87,13 @@ static int gp_aux_bus_probe(struct pci_dev *pdev,
> const struct pci_device_id *id
>         retval = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES);
> 
>         if (retval < 0)
> -               return retval;
> +               goto err_aux_dev_init_1;
> 
> -       pdev->irq = pci_irq_vector(pdev, 0);
> -       if (pdev->irq < 0)
> -               return retval;
> +       retval = pci_irq_vector(pdev, 0);
> +       if (retval < 0)
> +               goto err_aux_dev_init_1;
> 
> +       pdev->irq = retval;
>         aux_bus->aux_device_wrapper[1]->gp_aux_data.irq_num = pdev->irq;
> 
>         retval = auxiliary_device_init(&aux_bus->aux_device_wrapper[1]-
> >aux_dev);
> --
> 2.34.1


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

* RE: [PATCH -next v2 2/5] misc: microchip: pci1xxxx: Fix missing spin_lock_init()
  2022-09-07 14:58 ` [PATCH -next v2 2/5] misc: microchip: pci1xxxx: Fix missing spin_lock_init() Wei Yongjun
@ 2022-09-08  5:59   ` Kumaravel.Thiagarajan
  0 siblings, 0 replies; 10+ messages in thread
From: Kumaravel.Thiagarajan @ 2022-09-08  5:59 UTC (permalink / raw)
  To: weiyongjun, arnd, gregkh; +Cc: weiyongjun1, linux-gpio, linux-kernel

> -----Original Message-----
> From: Wei Yongjun <weiyongjun@huaweicloud.com>
> Sent: Wednesday, September 7, 2022 8:28 PM
> To: Kumaravel Thiagarajan - I21417
> <Kumaravel.Thiagarajan@microchip.com>; Arnd Bergmann
> <arnd@arndb.de>; Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Wei Yongjun <weiyongjun1@huawei.com>; linux-gpio@vger.kernel.org;
> linux-kernel@vger.kernel.org
> Subject: [PATCH -next v2 2/5] misc: microchip: pci1xxxx: Fix missing
> spin_lock_init()
> 
> From: Wei Yongjun <weiyongjun1@huawei.com>
> 
> The driver allocates the spinlock but not initialize it.
> Use spin_lock_init() on it to initialize it correctly.
> 
> Fixes: 7d3e4d807df2 ("misc: microchip: pci1xxxx: load gpio driver for the gpio controller auxiliary device enumerated by the auxiliary bus driver.")

Reviewed-by: Kumaravel Thiagarajan <kumaravel.thiagarajan@microchip.com>

> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
> v1 -> v2: add fixes tag
> ---
>  drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c
> b/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c
> index 230503cca2ff..47e6e87938ae 100644
> --- a/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c
> +++ b/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c
> @@ -383,6 +383,7 @@ static int pci1xxxx_gpio_probe(struct auxiliary_device
> *aux_dev,
>         if (!priv)
>                 return -ENOMEM;
> 
> +       spin_lock_init(&priv->lock);
>         priv->aux_dev = aux_dev;
> 
>         if (!devm_request_mem_region(&aux_dev->dev, pdata->region_start,
> 0x800, aux_dev->name))
> --
> 2.34.1


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

* RE: [PATCH -next v2 3/5] misc: microchip: pci1xxxx: Make symbol 'pci1xxxx_gpio_auxiliary_id_table' static
  2022-09-07 14:58 ` [PATCH -next v2 3/5] misc: microchip: pci1xxxx: Make symbol 'pci1xxxx_gpio_auxiliary_id_table' static Wei Yongjun
@ 2022-09-08  6:02   ` Kumaravel.Thiagarajan
  0 siblings, 0 replies; 10+ messages in thread
From: Kumaravel.Thiagarajan @ 2022-09-08  6:02 UTC (permalink / raw)
  To: weiyongjun, arnd, gregkh; +Cc: weiyongjun1, linux-gpio, linux-kernel, lkp

> -----Original Message-----
> From: Wei Yongjun <weiyongjun@huaweicloud.com>
> Sent: Wednesday, September 7, 2022 8:28 PM
> To: Kumaravel Thiagarajan - I21417
> <Kumaravel.Thiagarajan@microchip.com>; Arnd Bergmann
> <arnd@arndb.de>; Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Wei Yongjun <weiyongjun1@huawei.com>; linux-gpio@vger.kernel.org;
> linux-kernel@vger.kernel.org; kernel test robot <lkp@intel.com>
> Subject: [PATCH -next v2 3/5] misc: microchip: pci1xxxx: Make symbol
> 'pci1xxxx_gpio_auxiliary_id_table' static
> 
> From: Wei Yongjun <weiyongjun1@huawei.com>
> 
> The sparse tool complains as follows:
> 
> drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c:409:34: warning:
>  symbol 'pci1xxxx_gpio_auxiliary_id_table' was not declared. Should it be
> static?
> 
> This symbol is not used outside of mchp_pci1xxxx_gpio.c, so marks it static.
> 
> Fixes: 7d3e4d807df2 ("misc: microchip: pci1xxxx: load gpio driver for the gpio controller auxiliary device enumerated by the auxiliary bus driver.")
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Reviewed-by: Kumaravel Thiagarajan <kumaravel.thiagarajan@microchip.com>

> ---
> v1 -> v2: add fixes tag and reported-by
> ---
>  drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c
> b/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c
> index 47e6e87938ae..4f26871994ee 100644
> --- a/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c
> +++ b/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c
> @@ -407,7 +407,7 @@ static int pci1xxxx_gpio_probe(struct auxiliary_device
> *aux_dev,
> 
>  static SIMPLE_DEV_PM_OPS(pci1xxxx_gpio_pm_ops,
> pci1xxxx_gpio_suspend, pci1xxxx_gpio_resume);
> 
> -const struct auxiliary_device_id pci1xxxx_gpio_auxiliary_id_table[] = {
> +static const struct auxiliary_device_id pci1xxxx_gpio_auxiliary_id_table[] = {
>         {.name = "mchp_pci1xxxx_gp.gp_gpio"},
>         {}
>  };
> --
> 2.34.1


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

* RE: [PATCH -next v2 4/5] misc: microchip: pci1xxxx: Add missing MODULE_DEVICE_TABLE
  2022-09-07 14:58 ` [PATCH -next v2 4/5] misc: microchip: pci1xxxx: Add missing MODULE_DEVICE_TABLE Wei Yongjun
@ 2022-09-08  6:04   ` Kumaravel.Thiagarajan
  0 siblings, 0 replies; 10+ messages in thread
From: Kumaravel.Thiagarajan @ 2022-09-08  6:04 UTC (permalink / raw)
  To: weiyongjun, arnd, gregkh; +Cc: weiyongjun1, linux-gpio, linux-kernel

> -----Original Message-----
> From: Wei Yongjun <weiyongjun@huaweicloud.com>
> Sent: Wednesday, September 7, 2022 8:28 PM
> To: Kumaravel Thiagarajan - I21417
> <Kumaravel.Thiagarajan@microchip.com>; Arnd Bergmann
> <arnd@arndb.de>; Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Wei Yongjun <weiyongjun1@huawei.com>; linux-gpio@vger.kernel.org;
> linux-kernel@vger.kernel.org
> Subject: [PATCH -next v2 4/5] misc: microchip: pci1xxxx: Add missing
> MODULE_DEVICE_TABLE
> 
> From: Wei Yongjun <weiyongjun1@huawei.com>
> 
> This patch adds missing MODULE_DEVICE_TABLE definition which generates
> correct modalias for automatic loading of this driver when it is built as an
> external module.
> 
> Fixes: 7d3e4d807df2 ("misc: microchip: pci1xxxx: load gpio driver for the gpio controller auxiliary device enumerated by the auxiliary bus driver.")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Reviewed-by: Kumaravel Thiagarajan <kumaravel.thiagarajan@microchip.com>

> ---
> v1 -> v2: add fixes tag
> ---
>  drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c
> b/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c
> index 4f26871994ee..fa80a7788596 100644
> --- a/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c
> +++ b/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c
> @@ -411,6 +411,7 @@ static const struct auxiliary_device_id
> pci1xxxx_gpio_auxiliary_id_table[] = {
>         {.name = "mchp_pci1xxxx_gp.gp_gpio"},
>         {}
>  };
> +MODULE_DEVICE_TABLE(auxiliary, pci1xxxx_gpio_auxiliary_id_table);
> 
>  static struct auxiliary_driver pci1xxxx_gpio_driver = {
>         .driver = {
> --
> 2.34.1


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

* RE: [PATCH -next v2 5/5] misc: microchip: pci1xxxx: use module_auxiliary_driver
  2022-09-07 14:58 ` [PATCH -next v2 5/5] misc: microchip: pci1xxxx: use module_auxiliary_driver Wei Yongjun
@ 2022-09-08  6:16   ` Kumaravel.Thiagarajan
  0 siblings, 0 replies; 10+ messages in thread
From: Kumaravel.Thiagarajan @ 2022-09-08  6:16 UTC (permalink / raw)
  To: weiyongjun, arnd, gregkh; +Cc: weiyongjun1, linux-gpio, linux-kernel

> -----Original Message-----
> From: Wei Yongjun <weiyongjun@huaweicloud.com>
> Sent: Wednesday, September 7, 2022 8:28 PM
> To: Kumaravel Thiagarajan - I21417
> <Kumaravel.Thiagarajan@microchip.com>; Arnd Bergmann
> <arnd@arndb.de>; Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Wei Yongjun <weiyongjun1@huawei.com>; linux-gpio@vger.kernel.org;
> linux-kernel@vger.kernel.org
> Subject: [PATCH -next v2 5/5] misc: microchip: pci1xxxx: use
> module_auxiliary_driver
> 
> From: Wei Yongjun <weiyongjun1@huawei.com>
> 
> Use the module_auxiliary_driver() macro to make the code simpler by
> eliminating module_init and module_exit calls.
> 
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Fixes: 7d3e4d807df2 ("misc: microchip: pci1xxxx: load gpio driver for the gpio controller auxiliary device enumerated by the auxiliary bus driver.")

Reviewed-by: Kumaravel Thiagarajan <kumaravel.thiagarajan@microchip.com>

> ---
>  drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c | 14 +-------------
>  1 file changed, 1 insertion(+), 13 deletions(-)
> 
> diff --git a/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c
> b/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c
> index fa80a7788596..9cc771c604ed 100644
> --- a/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c
> +++ b/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c
> @@ -421,19 +421,7 @@ static struct auxiliary_driver pci1xxxx_gpio_driver = {
>         .probe = pci1xxxx_gpio_probe,
>         .id_table = pci1xxxx_gpio_auxiliary_id_table  };
> -
> -static int __init pci1xxxx_gpio_driver_init(void) -{
> -       return auxiliary_driver_register(&pci1xxxx_gpio_driver);
> -}
> -
> -static void __exit pci1xxxx_gpio_driver_exit(void) -{
> -       auxiliary_driver_unregister(&pci1xxxx_gpio_driver);
> -}
> -
> -module_init(pci1xxxx_gpio_driver_init);
> -module_exit(pci1xxxx_gpio_driver_exit);
> +module_auxiliary_driver(pci1xxxx_gpio_driver);
> 
>  MODULE_DESCRIPTION("Microchip Technology Inc. PCI1xxxx GPIO
> controller");  MODULE_AUTHOR("Kumaravel Thiagarajan
> <kumaravel.thiagarajan@microchip.com>");
> --
> 2.34.1


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

end of thread, other threads:[~2022-09-08  6:16 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-07 14:58 [PATCH -next v2 1/5] misc: microchip: pci1xxxx: fix error handling in gp_aux_bus_probe() Wei Yongjun
2022-09-07 14:58 ` [PATCH -next v2 2/5] misc: microchip: pci1xxxx: Fix missing spin_lock_init() Wei Yongjun
2022-09-08  5:59   ` Kumaravel.Thiagarajan
2022-09-07 14:58 ` [PATCH -next v2 3/5] misc: microchip: pci1xxxx: Make symbol 'pci1xxxx_gpio_auxiliary_id_table' static Wei Yongjun
2022-09-08  6:02   ` Kumaravel.Thiagarajan
2022-09-07 14:58 ` [PATCH -next v2 4/5] misc: microchip: pci1xxxx: Add missing MODULE_DEVICE_TABLE Wei Yongjun
2022-09-08  6:04   ` Kumaravel.Thiagarajan
2022-09-07 14:58 ` [PATCH -next v2 5/5] misc: microchip: pci1xxxx: use module_auxiliary_driver Wei Yongjun
2022-09-08  6:16   ` Kumaravel.Thiagarajan
2022-09-08  5:56 ` [PATCH -next v2 1/5] misc: microchip: pci1xxxx: fix error handling in gp_aux_bus_probe() Kumaravel.Thiagarajan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).