lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAP_ceTyf-LES3m_5yEdoRhAHWG4kS9T+YmKG4KrSvux98OzhtA@mail.gmail.com>
Date:   Fri, 23 Feb 2018 16:08:21 +0100
From:   Vincent Palatin <vpalatin@...omium.org>
To:     Enric Balletbo i Serra <enric.balletbo@...labora.com>
Cc:     Lee Jones <lee.jones@...aro.org>, groeck@...omium.org,
        Gwendal Grignou <gwendal@...omium.org>, kernel@...labora.com,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 2/8] mfd: cros_ec: free IRQ automatically

On Fri, Feb 23, 2018 at 4:05 PM, Enric Balletbo i Serra
<enric.balletbo@...labora.com> wrote:
>
> From: Vincent Palatin <vpalatin@...omium.org>
>
> 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 <vpalatin@...omium.org>
> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@...labora.com>
>
> ---
>
> 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 <vpalatin@...omium.org>


>
>         return 0;
>  }
>  EXPORT_SYMBOL(cros_ec_remove);
> --
> 2.16.1
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ