Received: by 10.223.185.116 with SMTP id b49csp811398wrg; Fri, 23 Feb 2018 07:10:55 -0800 (PST) X-Google-Smtp-Source: AH8x225xitedtg54mckkEIQwKsXvvsHQWtKAGKlW5/G6PHy+9drlFpmu75uO2/K79f1RSkneoWoX X-Received: by 10.99.125.29 with SMTP id y29mr1683799pgc.277.1519398655192; Fri, 23 Feb 2018 07:10:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519398655; cv=none; d=google.com; s=arc-20160816; b=zMCQpX/ue5xTKOM2lQuYK6Uf7eIF0KZCLxlHMevTSsuYaL6PrRctuiXvsAGJ8zE7G4 4DBmOexZnSshxYLVdv6m2tgvXxEPcuaBC6R6V3PPcB7tWkBXW5DIEjy1wErtgpQwpQjX /IDtP/lzHJfB1PJvtVPNTPDiRKworaUZVFV0frOIbQ6wdabwuhX7rhhbW4YKhSjHfV2V dTLxYbswKEKTO6vj8VPfRX9ryVpFEB0JKsPpZLo4uwGAVRhsONayvNVeHKCZhZluow9X ejp4yyKHw1Abyg+MxFfZUknyODCua6ox6x1da5AGkInG1XFxmQk6qR5qNhFB7xP4iEbQ i1tg== 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=x5vm7FhwQPb26lAC1gIPEsVgrs21BMortZVuhPi6ttk=; b=yf/3vmPw04OoiqPlhqvkez3npsSX02xGw8E2oKoqiEvIrzX2T62vcgDDS+rXyXBUKe mZFijHvhXQR9405g/dWLTZXPvGczb/kRxORZYZSCgc15jUGHOjt8RF+zovdbBY6ukSfS czPEJaTVVvVsiDSU1VCVvrzq/IvRZrCKFnwMc14CrfuTpbxXqBumAsRkij9HChw2t/Oj XKtjDuNsroqLWNQhMt7SUalgLkx6cMoAvaJJOzMFiGc6W4RTtQYKU4Y1FeHpflf1B9Iq OR2xa9d7J03MkSd59F/dZpJw9yrtfshbUFKbgWcCj9LpsanJYtIjZ3bg8lDt1JgBV4Hi TfSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@google.com header.s=20161025 header.b=QI4UJmEq; dkim=fail header.i=@chromium.org header.s=google header.b=X+UPeRfY; 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 95-v6si1905196plc.612.2018.02.23.07.10.40; Fri, 23 Feb 2018 07:10:55 -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=QI4UJmEq; dkim=fail header.i=@chromium.org header.s=google header.b=X+UPeRfY; 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 S1751895AbeBWPIo (ORCPT + 99 others); Fri, 23 Feb 2018 10:08:44 -0500 Received: from mail-io0-f194.google.com ([209.85.223.194]:33495 "EHLO mail-io0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751338AbeBWPIm (ORCPT ); Fri, 23 Feb 2018 10:08:42 -0500 Received: by mail-io0-f194.google.com with SMTP id n7so10123250iob.0 for ; Fri, 23 Feb 2018 07:08:42 -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=x5vm7FhwQPb26lAC1gIPEsVgrs21BMortZVuhPi6ttk=; b=QI4UJmEqn3LjIbH3259l+dN5AKInkaYsq+9+DkbpR0ReT9nAmTBaYqZzTO/rYNwgpT 3KSRXfntv2STA0IXfr2AvkUOOXbNLZEqo23mviGhZZxX34HFw+GmrIy9YUvTm4GB5XnP ZTyGG3HEHAJFFMqfoBtWtNdb8yas3Ay6nEc67xa0UYqFKMxgS4PNqpXORCkpMcQjyLcw En2h4KN5dE8yf7vIFuSvKgeNq1QdUegvGDK6QuTbZ2WcVqMmn0vGolPYc1FPmdAC5r80 55UwT8MxNkYTLFbQQZxoAKBMkVbEvA3l0JvKGTnLoRoh+wyIRwKtPg3Cwg4rKA0PT9E/ 5IdQ== 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=x5vm7FhwQPb26lAC1gIPEsVgrs21BMortZVuhPi6ttk=; b=X+UPeRfYSu2nTvJCp23qBxIZg2235cE0NG3WYuMXcMLfU4kQt62EwhVLo+S/rdo6MG KbFDtI+0C/ygZkz6HZ4sxkDT4Z5CZlVjraDJNZLAQXPzZ8KlYN44UtoHCPN0x9jpNWxZ cbdM8Q5xBWfvS29+YkAlXd85sFBZADeLg8nZc= 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=x5vm7FhwQPb26lAC1gIPEsVgrs21BMortZVuhPi6ttk=; b=F+ptE+BHFQwvQuRxyDsnb6jF2sbNpN/rSF9cBk/ZVydFIp9bjkTxiw0x8TN65lDr+M yBiQqgrF87IDlZoj+wWCF8nyxyllzNVzBaUoDxyIr1yozCodqmXFlu7fHy93P/xCeOaN SLaRD9TLRAnbXcHhfeUcqsIvTH/wSisWW3ot2D1JapTPn/zJJ28Ty0j4EAVCLw7ThFrg Uk2nUOz6OJ/Qxn68yeHVepCf2oJB73lx0dx+oYJrnipKHWCD8mf/NLm+pz8WOOVZUbR+ N/QURA18xNFNj6oxDsmyBsHJug1p0Wo+9ibUGYlFwmZ5Zn+mEzsld8XElINHD1VpkPzf lqJg== X-Gm-Message-State: APf1xPASZ1HxxiI31q29zFHTQpWn26WcBmNZ+Wwzg2vPP7A5a5LPEcop UIoLRA4V/BzRRhVq8OwLY7u18WXYkocV9Mt5Vq/5gA== X-Received: by 10.107.29.205 with SMTP id d196mr2205774iod.18.1519398521784; Fri, 23 Feb 2018 07:08:41 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.174.133 with HTTP; Fri, 23 Feb 2018 07:08:21 -0800 (PST) In-Reply-To: <20180223150605.10417-3-enric.balletbo@collabora.com> References: <20180223150605.10417-1-enric.balletbo@collabora.com> <20180223150605.10417-3-enric.balletbo@collabora.com> From: Vincent Palatin Date: Fri, 23 Feb 2018 16:08:21 +0100 X-Google-Sender-Auth: jLIqQlFXaZoV1MpcBE_YcHm5NRA Message-ID: Subject: Re: [PATCH v2 2/8] mfd: cros_ec: free IRQ automatically To: Enric Balletbo i Serra Cc: Lee Jones , groeck@chromium.org, Gwendal Grignou , kernel@collabora.com, LKML 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 Fri, Feb 23, 2018 at 4:05 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 > > --- > > 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); > - Acked-by: Vincent Palatin > > return 0; > } > EXPORT_SYMBOL(cros_ec_remove); > -- > 2.16.1 >