Skip to content

Commit 7540599

Browse files
andy-shevjwrdegoede
authored andcommitted
platform/x86: intel_skl_int3472: Provide skl_int3472_unregister_clock()
For the sake of APIs to be properly layered provide skl_int3472_unregister_clock(). 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 7b2baa4 commit 7540599

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
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
@@ -130,6 +130,12 @@ int skl_int3472_register_clock(struct int3472_discrete_device *int3472)
130130
return ret;
131131
}
132132

133+
void skl_int3472_unregister_clock(struct int3472_discrete_device *int3472)
134+
{
135+
clkdev_drop(int3472->clock.cl);
136+
clk_unregister(int3472->clock.clk);
137+
}
138+
133139
int skl_int3472_register_regulator(struct int3472_discrete_device *int3472,
134140
struct acpi_resource_gpio *agpio)
135141
{

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,9 @@ int skl_int3472_tps68470_probe(struct i2c_client *client);
111111
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);
114+
114115
int skl_int3472_register_clock(struct int3472_discrete_device *int3472);
116+
void skl_int3472_unregister_clock(struct int3472_discrete_device *int3472);
115117

116118
int skl_int3472_register_regulator(struct int3472_discrete_device *int3472,
117119
struct acpi_resource_gpio *agpio);

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -400,10 +400,9 @@ 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-
clk_unregister(int3472->clock.clk);
404403

405-
if (int3472->clock.cl)
406-
clkdev_drop(int3472->clock.cl);
404+
if (int3472->clock.ena_gpio)
405+
skl_int3472_unregister_clock(int3472);
407406

408407
gpiod_put(int3472->clock.ena_gpio);
409408
gpiod_put(int3472->clock.led_gpio);

0 commit comments

Comments
 (0)