netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] net: rfkill: gpio: Switch to devm_acpi_dev_add_driver_gpios()
@ 2017-06-10 19:10 Andy Shevchenko
  2017-06-13  9:08 ` Johannes Berg
  0 siblings, 1 reply; 2+ messages in thread
From: Andy Shevchenko @ 2017-06-10 19:10 UTC (permalink / raw)
  To: Johannes Berg, linux-wireless, David S. Miller, netdev; +Cc: Andy Shevchenko

Switch to use managed variant of acpi_dev_add_driver_gpios() to simplify
error path and fix potentially wrong assingment if ->probe() fails.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 net/rfkill/rfkill-gpio.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/net/rfkill/rfkill-gpio.c b/net/rfkill/rfkill-gpio.c
index 76c01cbd56e3..41bd496531d4 100644
--- a/net/rfkill/rfkill-gpio.c
+++ b/net/rfkill/rfkill-gpio.c
@@ -81,8 +81,7 @@ static int rfkill_gpio_acpi_probe(struct device *dev,
 
 	rfkill->type = (unsigned)id->driver_data;
 
-	return acpi_dev_add_driver_gpios(ACPI_COMPANION(dev),
-					 acpi_rfkill_default_gpios);
+	return devm_acpi_dev_add_driver_gpios(dev, acpi_rfkill_default_gpios);
 }
 
 static int rfkill_gpio_probe(struct platform_device *pdev)
@@ -154,8 +153,6 @@ static int rfkill_gpio_remove(struct platform_device *pdev)
 	rfkill_unregister(rfkill->rfkill_dev);
 	rfkill_destroy(rfkill->rfkill_dev);
 
-	acpi_dev_remove_driver_gpios(ACPI_COMPANION(&pdev->dev));
-
 	return 0;
 }
 
-- 
2.11.0

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

* Re: [PATCH v1] net: rfkill: gpio: Switch to devm_acpi_dev_add_driver_gpios()
  2017-06-10 19:10 [PATCH v1] net: rfkill: gpio: Switch to devm_acpi_dev_add_driver_gpios() Andy Shevchenko
@ 2017-06-13  9:08 ` Johannes Berg
  0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2017-06-13  9:08 UTC (permalink / raw)
  To: Andy Shevchenko, linux-wireless, David S. Miller, netdev

On Sat, 2017-06-10 at 22:10 +0300, Andy Shevchenko wrote:
> Switch to use managed variant of acpi_dev_add_driver_gpios() to
> simplify
> error path and fix potentially wrong assingment if ->probe() fails.
> 
Looks fine, applied.

johannes

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

end of thread, other threads:[~2017-06-13  9:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-10 19:10 [PATCH v1] net: rfkill: gpio: Switch to devm_acpi_dev_add_driver_gpios() Andy Shevchenko
2017-06-13  9:08 ` Johannes Berg

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).