Received: by 10.223.185.116 with SMTP id b49csp808830wrg; Fri, 23 Feb 2018 07:08:56 -0800 (PST) X-Google-Smtp-Source: AH8x227Hdbm6Uovycr6PPOocgpTQABu53i7mTF6wV3qdDi1U0ooes35aWXjXc1WS95DMizOALjzN X-Received: by 10.98.73.140 with SMTP id r12mr2068395pfi.229.1519398536333; Fri, 23 Feb 2018 07:08:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519398536; cv=none; d=google.com; s=arc-20160816; b=YVwfKGtzUaq4F1IM96YJzJp6SutooiZAEI7cuak2rghnMksOtpMi+fyF9zgTE7H3cX 5w2JDivCkYiSuNdFvBkvtMDSd0VNZRT8CmMiAGGCIwsb1xCsQT7GYQWEQA2+s4meylQl op7VXI9xneuMk4QmHXwlu85MJ5j/1SP8oLLO3C0z7iTVoeXAhNoYrFUCDNSBr7EaZqyv boMta5Y5Lk3uz3BsgyHqWqiBVWFXTqO3KskzTZJmPThaNJlh1W9kgeod5R0+FR4cIShs bWhvASeCo5CRtGKiFJUsJ/rEt0pCzIwgG7b7pPawzHCt29Yz6A0xwMuHFDA1s1DTbd/i zokg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=K7YJqThgb0fl+uK4Rq/vCLcXVtM9kXc/SuXgRCSS3oA=; b=hFRcdikHTp3hZz31kEy2WdVFATBFVTuNtHD82YfMUyscuicrZ1JyFH+tZn6eiJRydO ebYBKBzErL2/ugW+hhUzlGifQ5EzoAojO0lS0HaE0llny6bAsojnmHaL+GlzmYqfizv9 PF+1bRwW6fv/2baI/Q3jBpVsZGJi7Km5qcjw5uVmPRPPoGnoVbFJepRPjH2JcDifVC0D +VhO6FcKgdGdudK0uGgQ4ijig3uIm9k8T9QihAiSN+4t5YLXnuuQB4wZIElukUgcjEjP 2AlflPRSSiQeOgPUBBQztJd06yN35kZQ0cxc1/dYpszMIvv5eusTDEBJ6Sd8w/6tk6AO hovQ== ARC-Authentication-Results: i=1; mx.google.com; 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=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n3-v6si1884311pld.347.2018.02.23.07.08.41; Fri, 23 Feb 2018 07:08:56 -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; 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=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751916AbeBWPHO (ORCPT + 99 others); Fri, 23 Feb 2018 10:07:14 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:37276 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751412AbeBWPGR (ORCPT ); Fri, 23 Feb 2018 10:06:17 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: eballetbo) with ESMTPSA id F0D24277511 From: Enric Balletbo i Serra To: lee.jones@linaro.org Cc: groeck@chromium.org, gwendal@chromium.org, kernel@collabora.com, linux-kernel@vger.kernel.org, Vincent Palatin Subject: [PATCH v2 2/8] mfd: cros_ec: free IRQ automatically Date: Fri, 23 Feb 2018 16:05:59 +0100 Message-Id: <20180223150605.10417-3-enric.balletbo@collabora.com> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180223150605.10417-1-enric.balletbo@collabora.com> References: <20180223150605.10417-1-enric.balletbo@collabora.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- Changes in v2: - [2/8] Remove the free_irq in cros_ec_remove. drivers/mfd/cros_ec.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/drivers/mfd/cros_ec.c b/drivers/mfd/cros_ec.c index 74780f2964a1..ea8aa704b61e 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); @@ -194,9 +189,6 @@ int cros_ec_remove(struct cros_ec_device *ec_dev) cros_ec_acpi_remove_gpe_handler(); - if (ec_dev->irq) - free_irq(ec_dev->irq, ec_dev); - return 0; } EXPORT_SYMBOL(cros_ec_remove); -- 2.16.1