Skip to content

Commit 7b2baa4

Browse files
andy-shevjwrdegoede
authored andcommitted
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: Andy Shevchenko <[email protected]> Reviewed-by: Daniel Scally <[email protected]> Tested-by: Daniel Scally <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]>
1 parent 7199418 commit 7b2baa4

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

drivers/platform/x86/intel-int3472/intel_skl_int3472_clk_and_regulator.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,3 +193,9 @@ int skl_int3472_register_regulator(struct int3472_discrete_device *int3472,
193193

194194
return ret;
195195
}
196+
197+
void skl_int3472_unregister_regulator(struct int3472_discrete_device *int3472)
198+
{
199+
regulator_unregister(int3472->regulator.rdev);
200+
gpiod_put(int3472->regulator.gpio);
201+
}

drivers/platform/x86/intel-int3472/intel_skl_int3472_common.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@ union acpi_object *skl_int3472_get_acpi_buffer(struct acpi_device *adev,
112112
char *id);
113113
int skl_int3472_fill_cldb(struct acpi_device *adev, struct int3472_cldb *cldb);
114114
int skl_int3472_register_clock(struct int3472_discrete_device *int3472);
115+
115116
int skl_int3472_register_regulator(struct int3472_discrete_device *int3472,
116117
struct acpi_resource_gpio *agpio);
118+
void skl_int3472_unregister_regulator(struct int3472_discrete_device *int3472);
117119

118120
#endif

drivers/platform/x86/intel-int3472/intel_skl_int3472_discrete.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,15 +400,15 @@ int skl_int3472_discrete_remove(struct platform_device *pdev)
400400
struct int3472_discrete_device *int3472 = platform_get_drvdata(pdev);
401401

402402
gpiod_remove_lookup_table(&int3472->gpios);
403-
regulator_unregister(int3472->regulator.rdev);
404403
clk_unregister(int3472->clock.clk);
405404

406405
if (int3472->clock.cl)
407406
clkdev_drop(int3472->clock.cl);
408407

409-
gpiod_put(int3472->regulator.gpio);
410408
gpiod_put(int3472->clock.ena_gpio);
411409
gpiod_put(int3472->clock.led_gpio);
412410

411+
skl_int3472_unregister_regulator(int3472);
412+
413413
return 0;
414414
}

0 commit comments

Comments
 (0)