All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: Alexander Shiyan <shc_work@mail.ru>
Cc: linux-kernel@vger.kernel.org, Samuel Ortiz <sameo@linux.intel.com>
Subject: Re: [PATCH 3/3] mfd: mc13xxx: Simplify "probe" & "remove"
Date: Mon, 16 Dec 2013 08:43:13 +0000	[thread overview]
Message-ID: <20131216084313.GF18769@lee--X1> (raw)
In-Reply-To: <1387026192-21234-3-git-send-email-shc_work@mail.ru>

> This patch simplifies "probe" and "remove" functions by moving
> some initialization code in the driver core.
> 
> Signed-off-by: Alexander Shiyan <shc_work@mail.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

  reply	other threads:[~2013-12-16  8:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-14 13:03 [PATCH 1/3] mfd: mc13xxx: Remove useless symbol MFD_MC13783 Alexander Shiyan
2013-12-14 13:03 ` [PATCH 2/3] mfd: mc13xxx: Remove duplicate mc13xxx_get_flags() declaration Alexander Shiyan
2013-12-16  9:08   ` Lee Jones
2013-12-14 13:03 ` [PATCH 3/3] mfd: mc13xxx: Simplify "probe" & "remove" Alexander Shiyan
2013-12-16  8:43   ` Lee Jones [this message]
2013-12-16  9:06     ` Alexander Shiyan
2013-12-16 13:53   ` Lee Jones
2013-12-16  9:07 ` [PATCH 1/3] mfd: mc13xxx: Remove useless symbol MFD_MC13783 Lee Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131216084313.GF18769@lee--X1 \
    --to=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sameo@linux.intel.com \
    --cc=shc_work@mail.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.