From patchwork Mon Jun 24 13:42:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 18073 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f72.google.com (mail-yh0-f72.google.com [209.85.213.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4DC3B25CFE for ; Mon, 24 Jun 2013 13:42:17 +0000 (UTC) Received: by mail-yh0-f72.google.com with SMTP id z20sf16065215yhz.11 for ; Mon, 24 Jun 2013 06:42:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-beenthere:x-forwarded-to:x-forwarded-for:delivered-to:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :mime-version:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe :content-type; bh=2vUDQXZQhKlauwslaVDIrJxmv36o/bTvzKffzPLLZ5w=; b=a/SDSYDVtCnY4+hgSgPBZiGC9HnF17sAG87u9ycliB4As/46sS0tHwmi5xIgWJxVnB hxLyi+VtBbGDxGnwhRtsldqiv9/09uG/pbrJmjw0o3TNrxXg9+PBXfXc0jPqczlaUwZX 3j0xrNVe/ZaTauI28jqJ0igVxhwKrSnciOA5YXO8ZoawpBqO2DiiEWRwpw3/Hgr45762 zGzfQpqSXrsCEGYp2Pybnd5iM+Usa1BiGo554G3rI+L3Sc3UpqC/qpIt0kQ4tVpdKkQf I7BnK1Zx1Y6k59XJ/Uj2Qi2HKr27eSxXC4p3wAqC3GZQ4sLly0atnZbH4pFFqrWW3F2m e49w== X-Received: by 10.236.125.200 with SMTP id z48mr483585yhh.55.1372081336680; Mon, 24 Jun 2013 06:42:16 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.119.67 with SMTP id ks3ls2139816qeb.57.gmail; Mon, 24 Jun 2013 06:42:16 -0700 (PDT) X-Received: by 10.220.192.138 with SMTP id dq10mr11209819vcb.23.1372081336407; Mon, 24 Jun 2013 06:42:16 -0700 (PDT) Received: from mail-ve0-x22f.google.com (mail-ve0-x22f.google.com [2607:f8b0:400c:c01::22f]) by mx.google.com with ESMTPS id i3si4882719vdw.9.2013.06.24.06.42.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Jun 2013 06:42:16 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::22f is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c01::22f; Received: by mail-ve0-f175.google.com with SMTP id da11so8768887veb.34 for ; Mon, 24 Jun 2013 06:42:16 -0700 (PDT) X-Received: by 10.58.29.228 with SMTP id n4mr331979veh.50.1372081336336; Mon, 24 Jun 2013 06:42:16 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.165.8 with SMTP id yu8csp28068veb; Mon, 24 Jun 2013 06:42:15 -0700 (PDT) X-Received: by 10.236.140.138 with SMTP id e10mr12782997yhj.135.1372081335654; Mon, 24 Jun 2013 06:42:15 -0700 (PDT) Received: from comal.ext.ti.com (comal.ext.ti.com. [198.47.26.152]) by mx.google.com with ESMTPS id q69si6017044yhj.176.2013.06.24.06.42.15 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 24 Jun 2013 06:42:15 -0700 (PDT) Received-SPF: pass (google.com: domain of peter.ujfalusi@ti.com designates 198.47.26.152 as permitted sender) client-ip=198.47.26.152; Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id r5ODgAa7007500; Mon, 24 Jun 2013 08:42:10 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id r5ODgAeD002938; Mon, 24 Jun 2013 08:42:10 -0500 Received: from dlelxv22.itg.ti.com (172.17.1.197) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.2.342.3; Mon, 24 Jun 2013 08:42:10 -0500 Received: from barack.emea.dhcp.ti.com (barack.emea.dhcp.ti.com [137.167.125.74]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id r5ODg7o7028079; Mon, 24 Jun 2013 08:42:09 -0500 From: Peter Ujfalusi To: Mark Brown , Liam Girdwood CC: Misael Lopez Cruz , , , Jyri Sarha Subject: [PATCH 1/4] ASoC: twl6040: Drop using devm_request_threaded_irq() Date: Mon, 24 Jun 2013 15:42:03 +0200 Message-ID: <1372081326-6917-2-git-send-email-peter.ujfalusi@ti.com> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1372081326-6917-1-git-send-email-peter.ujfalusi@ti.com> References: <1372081326-6917-1-git-send-email-peter.ujfalusi@ti.com> MIME-Version: 1.0 X-Gm-Message-State: ALoCoQlBWtaIH3quuh0dO3Z5pW0agrH55GvTB3zuAZrq+ednFVG358s4VL4p8eL8KF2krFqg9fZM X-Original-Sender: peter.ujfalusi@ti.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::22f is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , We need to free the irq at twl6040_remove() which is called when the machine driver has been removed (the card has been removed). If we fail to do that, next time when the machine driver is loaded the codec's probe will fail since the irq has been already requested. Signed-off-by: Peter Ujfalusi --- sound/soc/codecs/twl6040.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c index 9b9a6e5..c2f2fdb 100644 --- a/sound/soc/codecs/twl6040.c +++ b/sound/soc/codecs/twl6040.c @@ -1143,7 +1143,7 @@ static int twl6040_probe(struct snd_soc_codec *codec) mutex_init(&priv->mutex); - ret = devm_request_threaded_irq(codec->dev, priv->plug_irq, NULL, + ret = request_threaded_irq(priv->plug_irq, NULL, twl6040_audio_handler, IRQF_NO_SUSPEND, "twl6040_irq_plug", codec); if (ret) { @@ -1159,6 +1159,9 @@ static int twl6040_probe(struct snd_soc_codec *codec) static int twl6040_remove(struct snd_soc_codec *codec) { + struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec); + + free_irq(priv->plug_irq, codec); twl6040_set_bias_level(codec, SND_SOC_BIAS_OFF); return 0;