[alsa-devel] [PATCH v7 2/4] ASoC: Intel - add Skylake HDA audio driver

Mark Brown broonie at kernel.org
Wed Jul 8 21:01:14 CEST 2015


On Mon, Jul 06, 2015 at 08:54:24AM +0530, Vinod Koul wrote:

> +static irqreturn_t skl_interrupt(int irq, void *dev_id)
> +{
> +	struct hdac_ext_bus *ebus = dev_id;
> +	struct hdac_bus *bus = ebus_to_hbus(ebus);
> +	u32 status;
> +
> +#ifdef CONFIG_PM
> +	if (!pm_runtime_active(bus->dev))
> +		return IRQ_NONE;
> +#endif

There's a stub for pm_runtime_active for !PM which does the right thing
here, no need for ifdefs.

> +	/*configure PM */
> +	pm_runtime_set_autosuspend_delay(bus->dev, SKL_SUSPEND_DELAY);
> +	pm_runtime_use_autosuspend(bus->dev);
> +	pm_runtime_put_noidle(bus->dev);
> +	pm_runtime_allow(bus->dev);
> +
> +	pci_set_drvdata(skl->pci, ebus);

Shouldn't you be setting the driver data before you register the device
and enable PM?  Otherwise the PM callbacks might run without it being
set.

> +out_free:
> +	skl->init_failed = 1;
> +	skl_free(ebus);
> +	pci_set_drvdata(skl->pci, NULL);

No need to set the driver data to NULL, the driver core will do it.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20150708/d0ab25eb/attachment.sig>


More information about the Alsa-devel mailing list