From: Ben Dooks <ben-SMNkleLxa3Z6Wcw2j4pizdi2O/JbrIOy@public.gmane.org>
To: Axel Lin <axel.lin-8E1dMatC8ynQT0dZR+AlfA@public.gmane.org>
Cc: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>,
Kukjin Kim <kgene.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] spi: s3c24xx: Convert to use devm_kzalloc
Date: Thu, 3 Apr 2014 14:26:25 +0100 [thread overview]
Message-ID: <20140403132625.GR4400@trinity.fluff.org> (raw)
In-Reply-To: <1396237049.12196.1.camel@phoenix>
On Mon, Mar 31, 2014 at 11:37:29AM +0800, Axel Lin wrote:
> Simplify the cleanup code.
>
> Signed-off-by: Axel Lin <axel.lin-8E1dMatC8ynQT0dZR+AlfA@public.gmane.org>
Acked-by: Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>
> ---
> drivers/spi/spi-s3c24xx.c | 10 +++-------
> 1 file changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/spi/spi-s3c24xx.c b/drivers/spi/spi-s3c24xx.c
> index bed2338..6db14e5 100644
> --- a/drivers/spi/spi-s3c24xx.c
> +++ b/drivers/spi/spi-s3c24xx.c
> @@ -183,7 +183,9 @@ static int s3c24xx_spi_setup(struct spi_device *spi)
>
> /* allocate settings on the first call */
> if (!cs) {
> - cs = kzalloc(sizeof(struct s3c24xx_spi_devstate), GFP_KERNEL);
> + cs = devm_kzalloc(&spi->dev,
> + sizeof(struct s3c24xx_spi_devstate),
> + GFP_KERNEL);
> if (!cs) {
> dev_err(&spi->dev, "no memory for controller state\n");
> return -ENOMEM;
> @@ -209,11 +211,6 @@ static int s3c24xx_spi_setup(struct spi_device *spi)
> return 0;
> }
>
> -static void s3c24xx_spi_cleanup(struct spi_device *spi)
> -{
> - kfree(spi->controller_state);
> -}
> -
> static inline unsigned int hw_txbyte(struct s3c24xx_spi *hw, int count)
> {
> return hw->tx ? hw->tx[count] : 0;
> @@ -543,7 +540,6 @@ static int s3c24xx_spi_probe(struct platform_device *pdev)
> hw->bitbang.txrx_bufs = s3c24xx_spi_txrx;
>
> hw->master->setup = s3c24xx_spi_setup;
> - hw->master->cleanup = s3c24xx_spi_cleanup;
>
> dev_dbg(hw->dev, "bitbang at %p\n", &hw->bitbang);
>
> --
> 1.8.3.2
>
>
>
--
Ben Dooks, ben-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org, http://www.fluff.org/ben/
Large Hadron Colada: A large Pina Colada that makes the universe disappear.
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2014-04-03 13:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-31 3:37 [PATCH] spi: s3c24xx: Convert to use devm_kzalloc Axel Lin
2014-04-01 2:02 ` Jingoo Han
2014-04-01 11:10 ` Mark Brown
2014-04-03 13:26 ` Ben Dooks [this message]
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=20140403132625.GR4400@trinity.fluff.org \
--to=ben-smnklelxa3z6wcw2j4pizdi2o/jbrioy@public.gmane.org \
--cc=axel.lin-8E1dMatC8ynQT0dZR+AlfA@public.gmane.org \
--cc=ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org \
--cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=kgene.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
--cc=linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).