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: <20131216084313.GF18769@lee--X1>
Date:	Mon, 16 Dec 2013 08:43:13 +0000
From:	Lee Jones <lee.jones@...aro.org>
To:	Alexander Shiyan <shc_work@...l.ru>
Cc:	linux-kernel@...r.kernel.org, Samuel Ortiz <sameo@...ux.intel.com>
Subject: Re: [PATCH 3/3] mfd: mc13xxx: Simplify "probe" & "remove"

> This patch simplifies "probe" and "remove" functions by moving
> some initialization code in the driver core.
> 
> Signed-off-by: Alexander Shiyan <shc_work@...l.ru>
> ---
>  drivers/mfd/mc13xxx-core.c | 36 +++++++++++++++++-------------------
>  drivers/mfd/mc13xxx-i2c.c  | 18 ++++--------------
>  drivers/mfd/mc13xxx-spi.c  | 19 ++++++-------------
>  drivers/mfd/mc13xxx.h      |  6 ++----
>  4 files changed, 29 insertions(+), 50 deletions(-)
> 
> diff --git a/drivers/mfd/mc13xxx-core.c b/drivers/mfd/mc13xxx-core.c
> index b0c7cb0..06e64b6 100644
> --- a/drivers/mfd/mc13xxx-core.c
> +++ b/drivers/mfd/mc13xxx-core.c

<snip>

> -	ret = request_threaded_irq(irq, NULL, mc13xxx_irq_thread,
> +	ret = request_threaded_irq(mc13xxx->irq, NULL, mc13xxx_irq_thread,
>  			IRQF_ONESHOT | IRQF_TRIGGER_HIGH, "mc13xxx", mc13xxx);

Please use devm_* managed resources, then you can remove the free_irq().

<snip>

> -void mc13xxx_common_cleanup(struct mc13xxx *mc13xxx)
> +int mc13xxx_common_exit(struct device *dev)
>  {
> +	struct mc13xxx *mc13xxx = dev_get_drvdata(dev);
> +
>  	free_irq(mc13xxx->irq, mc13xxx);

Here.


> -	spi_set_drvdata(spi, mc13xxx);
> +	dev_set_drvdata(&spi->dev, mc13xxx);
> +

What's the point of this? It does the same thing?

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ