Received: by 10.223.185.116 with SMTP id b49csp355622wrg; Tue, 20 Feb 2018 00:01:48 -0800 (PST) X-Google-Smtp-Source: AH8x226/CNj/dqnpApGwl9ciGYiqAGug2aJij8xv5JnDpXh0TVG9fabvvUhh3G6AYZw44vwckOOs X-Received: by 10.98.156.71 with SMTP id f68mr17416252pfe.193.1519113708785; Tue, 20 Feb 2018 00:01:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519113708; cv=none; d=google.com; s=arc-20160816; b=k78/dTkSMFNdiwdSrbYuqytmkCqEevMzlJpZmKs0eIucaygIhUDy8JxaRaQjlwDfDf +BRFU/sfIz4tKiFS8TiQaeLvwCS6IM7lz8iR1jGbpsLuUPpz754V4Ki6hKKFJWt0/9eg 4eFNaj7o+QYBZyuKtTw9e5PaZaUEBt3Aj2UzvrtpcfLdrI527S4j9hfKhfaPcxncIjp+ wr8W4C0ReGkUVTNrXtfmr+t29yCtJgRgBM+R6QSwtsManhIQQRPaVbNWvadYqHO467uY mPArkzVclggPLVrrqWJYBkOLgjiRID58yIFluD86TrspsYjRSKigUvvx9lw9eJvh0YII F2OA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature:dkim-signature :arc-authentication-results; bh=710RoBwaZGv7JvhJcpDFXApHMNTg2iw4fFB8V5IuQnE=; b=ZqZ4eg5YeR65mzJlwY0SG3Bt0tBHuy3b5aBK+t1h5xS1zMryXMPpGkF1BCP2OpszZD hyrPJ4T/zPY41rvIzS0jEKLmdyE6lxneb4Fn60YtJArGvUEsIIQ7G8Erhi4gApMcF0Bp hJ0rCUuMe5+ot4jHtVQLd1yZF+wbs9FR/WRVrOfTL7xHbaALoP8JMmkm2TIjCEOZK2zP jfxxVSDLwctffgyjnqpLt3SEwHd4sTb1Yk0zYxpvTKW9pem7cekyTYvArM2YPxx/KYzt Cw5ORXOrf/Dj1eyOVOdNP3XJFIoyqUmd5BbdRE0lKfXGN8P4CcKmlzXoygXv1MO/8nC2 mtQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@google.com header.s=20161025 header.b=LYsr3MEZ; dkim=fail header.i=@chromium.org header.s=google header.b=RFQ0ub8F; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a20-v6si6975997plm.683.2018.02.20.00.01.34; Tue, 20 Feb 2018 00:01:48 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@google.com header.s=20161025 header.b=LYsr3MEZ; dkim=fail header.i=@chromium.org header.s=google header.b=RFQ0ub8F; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751391AbeBTIA4 (ORCPT + 99 others); Tue, 20 Feb 2018 03:00:56 -0500 Received: from mail-io0-f195.google.com ([209.85.223.195]:41505 "EHLO mail-io0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751302AbeBTIAy (ORCPT ); Tue, 20 Feb 2018 03:00:54 -0500 Received: by mail-io0-f195.google.com with SMTP id e4so13941000iob.8 for ; Tue, 20 Feb 2018 00:00:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=710RoBwaZGv7JvhJcpDFXApHMNTg2iw4fFB8V5IuQnE=; b=LYsr3MEZTirDpcEeznowaL7m+P1JYgAKO3zc7vSR/Mt7MN8e8FvnY4VLpnYlPpWXhk ferwtoZh0wIyhBcVxIEt3OiccHBl4mSIalUHRafGkxODh4tL9VfDY5Uz2oR4dXe89Xpo CEnRFBYEga0NwnrQUuxM6blwJK3j8mH7H+t7/LUY5rsfqSE1c1q5VQECSKmyq4O8Fgnc s0M/kiR89OCjuZ396vM6LKRSrZt8h3UzrN2DVR2JTTIW1QyxqO9Bjv3M/vZRwNj9567F MGL/Cdp09vtvIYoZD03TjY9QbJFuAI4jr4roA90PQ6wigyf4Zz44taMF3RNPwKWf94Hg JM2A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=710RoBwaZGv7JvhJcpDFXApHMNTg2iw4fFB8V5IuQnE=; b=RFQ0ub8FwrjfkqbpYt/to/BH1hGhk5brAR4Cs0MjGKPvV2PabhPhjoeRh22famvrDQ XzXqELoSMRc+T0JDG55H1MmELkg6B8hQGI9oKI/oWaHUrgxpgw6c1w+QUARXN4PuS/6V nDutbpPotbAAkfoj/j0CA5fNX156/QQrJlZ4k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=710RoBwaZGv7JvhJcpDFXApHMNTg2iw4fFB8V5IuQnE=; b=n+bk10OABSYGXgUUTQayr2gI4U/cT7jAp4KcL5J5pIYtT2tQq6Xl7LGeiblJD6QxtE rNU3yslLLi95xr2cdgw2+Xg8wv6F5yOM9UT7x1sGxN2OREjM4btTM5T9G5nHqEYeAGle 6SzW4GQ8phE/1R1XyTDy59YDt+8Q7mIvOWWmP6E6v3ZW9JDIFufInhvZoHIxWS017+EB yZ4FnoSjAq3NEGFqI6/Y3Gdu2DRUwK4skyN8yGeE8uu2gYCAtedOxkKDfVteHRnG3U5y heqgrH6R6h33YuUTZaJ9yyIKu8a+CroiPNSASiEHG6ZiRlEY7mkDmBOvLla5EMdZd5Ca DR+Q== X-Gm-Message-State: APf1xPCj5ss1lYN46wa5cEGceK+G+uRXTIBnPEu3idJhH39rTqpBrNgd dg47H2UT0kP+liitxRzxCEDQYdYSzS8+/XBRZ1Wx3w== X-Received: by 10.107.48.209 with SMTP id w200mr22389099iow.128.1519113653769; Tue, 20 Feb 2018 00:00:53 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.174.133 with HTTP; Tue, 20 Feb 2018 00:00:33 -0800 (PST) In-Reply-To: <20180219224043.21383-1-enric.balletbo@collabora.com> References: <20180219224043.21383-1-enric.balletbo@collabora.com> From: Vincent Palatin Date: Tue, 20 Feb 2018 09:00:33 +0100 X-Google-Sender-Auth: Ose3kmPFKBmyipzlFp94S1nEXgo Message-ID: Subject: Re: [PATCH 2/6] mfd: cros_ec: free IRQ automatically To: Enric Balletbo i Serra Cc: Lee Jones , groeck@chromium.org, Gwendal Grignou , Benson Leung , LKML , kernel@collabora.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 19, 2018 at 11:40 PM, Enric Balletbo i Serra wrote: > From: Vincent Palatin > > Free the IRQ we might have requested when removing the cros_ec device, > so we can unload and reload the driver properly. > > Signed-off-by: Vincent Palatin > Signed-off-by: Enric Balletbo i Serra > --- > drivers/mfd/cros_ec.c | 17 ++++++----------- > 1 file changed, 6 insertions(+), 11 deletions(-) > > diff --git a/drivers/mfd/cros_ec.c b/drivers/mfd/cros_ec.c > index 74780f2964a1..d1a4fbee9380 100644 > --- a/drivers/mfd/cros_ec.c > +++ b/drivers/mfd/cros_ec.c > @@ -119,9 +119,9 @@ int cros_ec_register(struct cros_ec_device *ec_dev) > } > > if (ec_dev->irq) { > - err = request_threaded_irq(ec_dev->irq, NULL, ec_irq_thread, > - IRQF_TRIGGER_LOW | IRQF_ONESHOT, > - "chromeos-ec", ec_dev); > + err = devm_request_threaded_irq(dev, ec_dev->irq, NULL, > + ec_irq_thread, IRQF_TRIGGER_LOW | IRQF_ONESHOT, > + "chromeos-ec", ec_dev); > if (err) { > dev_err(dev, "Failed to request IRQ %d: %d", > ec_dev->irq, err); > @@ -135,7 +135,7 @@ int cros_ec_register(struct cros_ec_device *ec_dev) > dev_err(dev, > "Failed to register Embedded Controller subdevice %d\n", > err); > - goto fail_mfd; > + return err; > } > > if (ec_dev->max_passthru) { > @@ -153,7 +153,7 @@ int cros_ec_register(struct cros_ec_device *ec_dev) > dev_err(dev, > "Failed to register Power Delivery subdevice %d\n", > err); > - goto fail_mfd; > + return err; > } > } > > @@ -162,7 +162,7 @@ int cros_ec_register(struct cros_ec_device *ec_dev) > if (err) { > mfd_remove_devices(dev); > dev_err(dev, "Failed to register sub-devices\n"); > - goto fail_mfd; > + return err; > } > } > > @@ -180,11 +180,6 @@ int cros_ec_register(struct cros_ec_device *ec_dev) > cros_ec_acpi_install_gpe_handler(dev); > > return 0; > - > -fail_mfd: > - if (ec_dev->irq) > - free_irq(ec_dev->irq, ec_dev); > - return err; > } > EXPORT_SYMBOL(cros_ec_register); You need to remove the "free_irq(ec_dev->irq, ec_dev);" in cros_ec_remove() too. as done there: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/866858/15/drivers/mfd/cros_ec.c it was missing originally but was added by: 'f58b14e6632a mfd: cros_ec: Free IRQ on exit' > > -- > 2.16.1 >