Skip to content

Commit 1d15a10

Browse files
Lyudethierryreding
authored andcommitted
drm/tegra: Get ref for DP AUX channel, not its ddc adapter
While we're taking a reference of the DDC adapter for a DP AUX channel in tegra_sor_probe() because we're going to be using that adapter with the SOR, now that we've moved where AUX registration happens the actual device structure for the DDC adapter isn't initialized yet. Which means that we can't really take a reference from it to try to keep it around anymore. This should be fine though, because we can just take a reference of its parent instead. v2: * Avoid calling i2c_put_adapter() in tegra_output_remove() for eDP/DP cases Signed-off-by: Lyude Paul <[email protected]> Fixes: 39c17ae ("drm/tegra: Don't register DP AUX channels before connectors") Cc: Lyude Paul <[email protected]> Cc: Thierry Reding <[email protected]> Cc: Jonathan Hunter <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Thierry Reding <[email protected]>
1 parent dc9a91d commit 1d15a10

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

drivers/gpu/drm/tegra/output.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,13 @@ int tegra_output_probe(struct tegra_output *output)
180180

181181
void tegra_output_remove(struct tegra_output *output)
182182
{
183+
int connector_type = output->connector.connector_type;
184+
183185
if (output->hpd_gpio)
184186
free_irq(output->hpd_irq, output);
185187

186-
if (output->ddc)
188+
if (connector_type != DRM_MODE_CONNECTOR_eDP &&
189+
connector_type != DRM_MODE_CONNECTOR_DisplayPort && output->ddc)
187190
i2c_put_adapter(output->ddc);
188191
}
189192

drivers/gpu/drm/tegra/sor.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3745,11 +3745,11 @@ static int tegra_sor_probe(struct platform_device *pdev)
37453745
if (!sor->aux)
37463746
return -EPROBE_DEFER;
37473747

3748-
if (get_device(&sor->aux->ddc.dev)) {
3749-
if (try_module_get(sor->aux->ddc.owner))
3748+
if (get_device(sor->aux->dev)) {
3749+
if (try_module_get(sor->aux->dev->driver->owner))
37503750
sor->output.ddc = &sor->aux->ddc;
37513751
else
3752-
put_device(&sor->aux->ddc.dev);
3752+
put_device(sor->aux->dev);
37533753
}
37543754
}
37553755

0 commit comments

Comments
 (0)