From: Illia Smyrnov <x0194613@ti.com>
To: Matthias Brugger <matthias.bgg@gmail.com>
Cc: Grant Likely <grant.likely@secretlab.ca>,
Rob Herring <rob.herring@calxeda.com>,
Rob Landley <rob@landley.net>, Daniel Mack <zonque@gmail.com>,
Enric Balletbo Serra <eballetbo@gmail.com>,
Javier Martinez Canillas <martinez.javier@gmail.com>,
<devicetree-discuss@lists.ozlabs.org>,
<linux-doc@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<spi-devel-general@lists.sourceforge.net>,
<linux-omap@vger.kernel.org>,
<ezequiel.garcia@free-electrons.com>
Subject: Re: [PATCH] spi: spi-omap2-mcspi.c: Add dts for slave device configuration.
Date: Tue, 14 May 2013 12:53:31 +0300 [thread overview]
Message-ID: <5192099B.4000203@ti.com> (raw)
In-Reply-To: <CAB=otbTtRN9xyO0whNz-UbW+Xo0_X8XWLcWZt=7MfUfrnNqwww@mail.gmail.com>
> @@ -745,6 +781,11 @@ static int omap2_mcspi_setup_transfer(struct
> spi_device *spi,
> mcspi = spi_master_get_devdata(spi->master);
> spi_cntrl = mcspi->master;
>
> + if (!cd && spi->dev.of_node) {
> + cd = omap2_mcspi_get_slave_ctrldata(spi);
> + spi->controller_data = cd;
Here you call omap2_mcspi_get_slave_ctrldata function that allocate
memory for cd structure, but this memory never freed.
Also, why do you read DT data in omap2_mcspi_setup_transfer function?
Under certain conditions the omap2_mcspi_setup_transfer function may be
calling for each transfer and each call it will check (!cd &&
spi->dev.of_node) condition.
Consider to move DT data read code from omap2_mcspi_setup_transfer to
omap2_mcspi_setup function and free spi->controller_data pointer in
omap2_mcspi_cleanup function.
prev parent reply other threads:[~2013-05-14 9:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-25 23:00 [PATCH] spi: spi-omap2-mcspi.c: Add dts for slave device configuration Matthias Brugger
[not found] ` <1364252415-3613-1-git-send-email-matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-04-08 12:18 ` Matthias Brugger
[not found] ` <CABuKBeKN+cPbsf95mTvDfzAwzOh4V-+bycp=sujNndDeMG2HMw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-04-08 12:40 ` Mark Brown
2013-04-17 15:11 ` Mark Brown
[not found] ` <CAB=otbTtRN9xyO0whNz-UbW+Xo0_X8XWLcWZt=7MfUfrnNqwww@mail.gmail.com>
2013-05-14 9:53 ` Illia Smyrnov [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=5192099B.4000203@ti.com \
--to=x0194613@ti.com \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=eballetbo@gmail.com \
--cc=ezequiel.garcia@free-electrons.com \
--cc=grant.likely@secretlab.ca \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=martinez.javier@gmail.com \
--cc=matthias.bgg@gmail.com \
--cc=rob.herring@calxeda.com \
--cc=rob@landley.net \
--cc=spi-devel-general@lists.sourceforge.net \
--cc=zonque@gmail.com \
/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).