Commit 7b2baa40 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Hans de Goede

platform/x86: intel_skl_int3472: Provide skl_int3472_unregister_regulator()

For the sake of APIs to be properly layered provide
skl_int3472_unregister_regulator().
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: default avatarDaniel Scally <djrscally@gmail.com>
Tested-by: default avatarDaniel Scally <djrscally@gmail.com>
Link: https://lore.kernel.org/r/20210618125516.53510-5-andriy.shevchenko@linux.intel.comSigned-off-by: default avatarHans de Goede <hdegoede@redhat.com>
parent 71994187
...@@ -193,3 +193,9 @@ int skl_int3472_register_regulator(struct int3472_discrete_device *int3472, ...@@ -193,3 +193,9 @@ int skl_int3472_register_regulator(struct int3472_discrete_device *int3472,
return ret; return ret;
} }
void skl_int3472_unregister_regulator(struct int3472_discrete_device *int3472)
{
regulator_unregister(int3472->regulator.rdev);
gpiod_put(int3472->regulator.gpio);
}
...@@ -112,7 +112,9 @@ union acpi_object *skl_int3472_get_acpi_buffer(struct acpi_device *adev, ...@@ -112,7 +112,9 @@ union acpi_object *skl_int3472_get_acpi_buffer(struct acpi_device *adev,
char *id); char *id);
int skl_int3472_fill_cldb(struct acpi_device *adev, struct int3472_cldb *cldb); int skl_int3472_fill_cldb(struct acpi_device *adev, struct int3472_cldb *cldb);
int skl_int3472_register_clock(struct int3472_discrete_device *int3472); int skl_int3472_register_clock(struct int3472_discrete_device *int3472);
int skl_int3472_register_regulator(struct int3472_discrete_device *int3472, int skl_int3472_register_regulator(struct int3472_discrete_device *int3472,
struct acpi_resource_gpio *agpio); struct acpi_resource_gpio *agpio);
void skl_int3472_unregister_regulator(struct int3472_discrete_device *int3472);
#endif #endif
...@@ -400,15 +400,15 @@ int skl_int3472_discrete_remove(struct platform_device *pdev) ...@@ -400,15 +400,15 @@ int skl_int3472_discrete_remove(struct platform_device *pdev)
struct int3472_discrete_device *int3472 = platform_get_drvdata(pdev); struct int3472_discrete_device *int3472 = platform_get_drvdata(pdev);
gpiod_remove_lookup_table(&int3472->gpios); gpiod_remove_lookup_table(&int3472->gpios);
regulator_unregister(int3472->regulator.rdev);
clk_unregister(int3472->clock.clk); clk_unregister(int3472->clock.clk);
if (int3472->clock.cl) if (int3472->clock.cl)
clkdev_drop(int3472->clock.cl); clkdev_drop(int3472->clock.cl);
gpiod_put(int3472->regulator.gpio);
gpiod_put(int3472->clock.ena_gpio); gpiod_put(int3472->clock.ena_gpio);
gpiod_put(int3472->clock.led_gpio); gpiod_put(int3472->clock.led_gpio);
skl_int3472_unregister_regulator(int3472);
return 0; return 0;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment