treewide: convert gpio-export to platform driver
authorRené van Dorst <[email protected]>
Thu, 19 Jul 2018 10:55:55 +0000 (12:55 +0200)
committerJo-Philipp Wich <[email protected]>
Tue, 18 Dec 2018 16:47:43 +0000 (17:47 +0100)
Without this patch you will get an error "gpio-export probe deferral
not supported" when you try to export i2c expander gpio pins.

gpio-export is probed long before i2c-bus and i2c expander are created
and it doesn't retry it so none pins are exported.

Signed-off-by: René van Dorst <[email protected]>
apply the change to all instances of the gpio exports patch
Signed-off-by: Mathias Kresin <[email protected]>
(backported from 0ae9396556584db2dac73364af44758a5ccf4873)

target/linux/ipq806x/patches-4.14/0066-GPIO-add-named-gpio-exports.patch
target/linux/lantiq/patches-4.14/0030-GPIO-add-named-gpio-exports.patch
target/linux/ramips/patches-4.14/0024-GPIO-add-named-gpio-exports.patch

index daeb8c0acdb273090c7166924726badeaf05dbc1..3f7de4716a727b9604701bceeb0158b6bfdeece2 100644 (file)
@@ -32,7 +32,7 @@ Signed-off-by: John Crispin <[email protected]>
 +      { /* sentinel */ }
 +};
 +
-+static int __init of_gpio_export_probe(struct platform_device *pdev)
++static int of_gpio_export_probe(struct platform_device *pdev)
 +{
 +      struct device_node *np = pdev->dev.of_node;
 +      struct device_node *cnp;
@@ -85,13 +85,10 @@ Signed-off-by: John Crispin <[email protected]>
 +              .owner  = THIS_MODULE,
 +              .of_match_table = of_match_ptr(gpio_export_ids),
 +      },
++      .probe          = of_gpio_export_probe,
 +};
 +
-+static int __init of_gpio_export_init(void)
-+{
-+      return platform_driver_probe(&gpio_export_driver, of_gpio_export_probe);
-+}
-+device_initcall(of_gpio_export_init);
++module_platform_driver(gpio_export_driver);
 --- a/drivers/gpio/gpiolib-sysfs.c
 +++ b/drivers/gpio/gpiolib-sysfs.c
 @@ -553,7 +553,7 @@ static struct class gpio_class = {
index 784786b7c87e944d84cf9765c0b678a92d073a67..0ac8e50240edf3f08c43d519813cce38f1e351ec 100644 (file)
@@ -34,7 +34,7 @@ Signed-off-by: John Crispin <[email protected]>
 +      { /* sentinel */ }
 +};
 +
-+static int __init of_gpio_export_probe(struct platform_device *pdev)
++static int of_gpio_export_probe(struct platform_device *pdev)
 +{
 +      struct device_node *np = pdev->dev.of_node;
 +      struct device_node *cnp;
@@ -87,13 +87,10 @@ Signed-off-by: John Crispin <[email protected]>
 +              .owner  = THIS_MODULE,
 +              .of_match_table = of_match_ptr(gpio_export_ids),
 +      },
++      .probe          = of_gpio_export_probe,
 +};
 +
-+static int __init of_gpio_export_init(void)
-+{
-+      return platform_driver_probe(&gpio_export_driver, of_gpio_export_probe);
-+}
-+device_initcall(of_gpio_export_init);
++module_platform_driver(gpio_export_driver);
 +
 +#endif
 --- a/include/asm-generic/gpio.h
index da8ac96eb04c6d07b195b2644df5740f21012fcd..9b5562481a387dc36adca0749322605d9e9a820e 100644 (file)
@@ -32,7 +32,7 @@ Signed-off-by: John Crispin <[email protected]>
 +      { /* sentinel */ }
 +};
 +
-+static int __init of_gpio_export_probe(struct platform_device *pdev)
++static int of_gpio_export_probe(struct platform_device *pdev)
 +{
 +      struct device_node *np = pdev->dev.of_node;
 +      struct device_node *cnp;
@@ -85,13 +85,10 @@ Signed-off-by: John Crispin <[email protected]>
 +              .owner  = THIS_MODULE,
 +              .of_match_table = of_match_ptr(gpio_export_ids),
 +      },
++      .probe          = of_gpio_export_probe,
 +};
 +
-+static int __init of_gpio_export_init(void)
-+{
-+      return platform_driver_probe(&gpio_export_driver, of_gpio_export_probe);
-+}
-+device_initcall(of_gpio_export_init);
++module_platform_driver(gpio_export_driver);
 --- a/drivers/gpio/gpiolib-sysfs.c
 +++ b/drivers/gpio/gpiolib-sysfs.c
 @@ -553,7 +553,7 @@ static struct class gpio_class = {